Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
29d4db2
[𝘀𝗽𝗿] changes to main this commit is based on
Prabhuk Nov 20, 2024
8f53618
[𝘀𝗽𝗿] initial version
Prabhuk Nov 20, 2024
a794047
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil Dec 10, 2024
abfcb9c
Reorder commits.
Prabhuk Dec 10, 2024
de23806
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil Mar 12, 2025
05307cf
Update LTO compilation CodeGen flag for call-graph-section.
Prabhuk Mar 12, 2025
6a12be2
Fix EOF newlines.
Prabhuk Mar 12, 2025
a068971
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil Mar 13, 2025
54a3db2
Add requested tests part 1.
Prabhuk Mar 13, 2025
74044aa
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil Mar 13, 2025
77672ec
Update comments in tests.
Prabhuk Mar 13, 2025
1826b03
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil Mar 13, 2025
a8e2bd8
Updated the test as reviewers suggested.
Prabhuk Mar 13, 2025
2f7dbf2
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil Mar 13, 2025
3b605a6
Scoped enum. Simplify test.
Prabhuk Mar 13, 2025
7014fef
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil Mar 13, 2025
db11fc7
Remove unnecessary cast.
Prabhuk Mar 13, 2025
eb582bd
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil Mar 13, 2025
673481e
Remove unnecessary asserts. Remove autos for better readability.
Prabhuk Mar 13, 2025
6388364
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil Mar 13, 2025
694cfd0
Reorder IR metadata and rename temporary var names in test.
Prabhuk Mar 13, 2025
f90b397
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil Mar 14, 2025
270074f
Add RISC-V support. Clean up test files.
Prabhuk Mar 14, 2025
da8ae04
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil Mar 15, 2025
6045320
Clean up test files.
Prabhuk Mar 15, 2025
573eebe
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil Mar 19, 2025
a175709
Address review comments.
Prabhuk Mar 19, 2025
823a513
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil Apr 19, 2025
b5b2b10
Use callee_type metadata instead of OB.
Prabhuk Apr 19, 2025
2cac836
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil Apr 19, 2025
5ede050
Address review comments.
Prabhuk Apr 19, 2025
0c78d0a
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil Apr 23, 2025
d0a96ac
Rebase on top of llvm stack.
Prabhuk Apr 23, 2025
7a1c8fb
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil Apr 23, 2025
89c896b
Rebase on parent llvm change.
Prabhuk Apr 23, 2025
a56ccb8
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil Apr 23, 2025
c53d51d
Address review comments.
Prabhuk Apr 23, 2025
ab46191
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil Apr 24, 2025
839da25
Address review comments.
Prabhuk Apr 24, 2025
5b36796
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil Apr 24, 2025
43d6eed
Rebase on parent.
Prabhuk Apr 24, 2025
05057b8
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil Apr 24, 2025
5188f32
Rebase on parent.
Prabhuk Apr 24, 2025
2131b83
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil Apr 28, 2025
c5a12e9
Rebase on parent.
Prabhuk Apr 28, 2025
759a709
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil Apr 29, 2025
5cdb84e
Rebase on llvm changes.
Prabhuk Apr 29, 2025
32c7adb
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil May 1, 2025
75dec8e
Rebase on parent.
Prabhuk May 1, 2025
8a289b1
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil May 5, 2025
e0020f5
Rebase on parent.
Prabhuk May 5, 2025
9c21da8
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil May 10, 2025
f165443
Rebase on parent change.
Prabhuk May 10, 2025
f83a155
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil May 13, 2025
2745a8a
Rebase on parent llvm changes.
Prabhuk May 13, 2025
03ad07f
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil May 13, 2025
12df871
Rebase on parent.
Prabhuk May 13, 2025
edf799d
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil May 14, 2025
2a3c23d
Rebase on parent
Prabhuk May 14, 2025
d04642b
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil May 14, 2025
d4d4533
Rebase on main.
Prabhuk May 14, 2025
8bbbe12
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil May 27, 2025
37d3ef9
Rebase on parent.
Prabhuk May 27, 2025
ca6d2cc
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil May 27, 2025
c02cbb9
Rebase change.
Prabhuk May 27, 2025
8f07a4c
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil Jun 11, 2025
b16770b
Rebase.
Prabhuk Jun 11, 2025
0e29abc
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil Jun 11, 2025
1e773e1
Rebase on parent
Prabhuk Jun 11, 2025
38fc4f5
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil Jul 10, 2025
7b9cbb3
Rebase on top of main.
Prabhuk Jul 10, 2025
b7d5e7f
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil Jul 18, 2025
9591c3a
Rebase on parent.
Prabhuk Jul 18, 2025
c262b69
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil Jul 18, 2025
07f7768
Rebase on parent
Prabhuk Jul 18, 2025
125ddcd
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil Jul 18, 2025
15a1b29
Rebase on top of parent change.
Prabhuk Jul 18, 2025
9eff07d
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil Jul 18, 2025
1c0f1ab
Rebase on parent.
Prabhuk Jul 18, 2025
1ba8c04
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil Jul 18, 2025
0c1ec48
Rebase on parent.
Prabhuk Jul 18, 2025
c9f6c5c
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil Jul 18, 2025
9592631
Address review comments.
Prabhuk Jul 18, 2025
c09082e
[𝘀𝗽𝗿] changes introduced through rebase
necipfazil Jul 21, 2025
80c3580
Rebase on parent.
Prabhuk Jul 21, 2025
c67f714
Fix review comment on test file.
Prabhuk Jul 21, 2025
7f95a40
[𝘀𝗽𝗿] changes introduced through rebase
Prabhuk Jul 22, 2025
410bb0d
Rebase.
Prabhuk Jul 22, 2025
7321a3e
[𝘀𝗽𝗿] changes introduced through rebase
Prabhuk Jul 23, 2025
66c858e
Rebase on parent llvm change.
Prabhuk Jul 23, 2025
2d81ecc
[𝘀𝗽𝗿] changes introduced through rebase
Prabhuk Jul 23, 2025
c2294fa
Rebase on main.
Prabhuk Jul 23, 2025
571a431
[𝘀𝗽𝗿] changes introduced through rebase
Prabhuk Jul 23, 2025
6884d2a
Rebase.
Prabhuk Jul 23, 2025
036be4e
[𝘀𝗽𝗿] changes introduced through rebase
Prabhuk Jul 28, 2025
1fb27f8
Rebase on parent.
Prabhuk Jul 28, 2025
4ec81ea
[𝘀𝗽𝗿] changes introduced through rebase
Prabhuk Jul 28, 2025
9d29e55
Rebase on llvm changes.
Prabhuk Jul 28, 2025
23c8579
[𝘀𝗽𝗿] changes introduced through rebase
Prabhuk Jul 30, 2025
00f7d91
Rebase on main.
Prabhuk Jul 30, 2025
2924f11
[𝘀𝗽𝗿] changes introduced through rebase
Prabhuk Jul 31, 2025
0aa3d97
Rebase on main.
Prabhuk Jul 31, 2025
50a5786
[𝘀𝗽𝗿] changes introduced through rebase
Prabhuk Jul 31, 2025
a6b4a13
Rebase on parent.
Prabhuk Jul 31, 2025
f4d6c96
Rebase on main.
Prabhuk Jul 31, 2025
d349feb
Make Driver flag experimental.
Prabhuk Jul 31, 2025
d50a454
Merge branch 'main' into users/Prabhuk/sprclangcallgraphsection-add-c…
Prabhuk Oct 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions clang/include/clang/Basic/CodeGenOptions.def
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ CODEGENOPT(EnableNoundefAttrs, 1, 0, Benign) ///< Enable emitting `noundef` attr
CODEGENOPT(DebugPassManager, 1, 0, Benign) ///< Prints debug information for the new
///< pass manager.
CODEGENOPT(DisableRedZone , 1, 0, Benign) ///< Set when -mno-red-zone is enabled.
CODEGENOPT(CallGraphSection, 1, 0, Benign) ///< Emit a call graph section into the
///< object file.
CODEGENOPT(EmitCallSiteInfo, 1, 0, Benign) ///< Emit call site info only in the case of
///< '-g' + 'O>0' level.
CODEGENOPT(IndirectTlsSegRefs, 1, 0, Benign) ///< Set when -mno-tls-direct-seg-refs
Expand Down
6 changes: 6 additions & 0 deletions clang/include/clang/Driver/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -4533,6 +4533,12 @@ defm data_sections : BoolFOption<"data-sections",
PosFlag<SetTrue, [], [ClangOption, CC1Option],
"Place each data in its own section">,
NegFlag<SetFalse>>;
defm experimental_call_graph_section
: BoolFOption<"experimental-call-graph-section",
CodeGenOpts<"CallGraphSection">, DefaultFalse,
PosFlag<SetTrue, [], [ClangOption, CC1Option],
"Emit a call graph section">,
NegFlag<SetFalse>>;
defm stack_size_section : BoolFOption<"stack-size-section",
CodeGenOpts<"StackSizeSection">, DefaultFalse,
PosFlag<SetTrue, [], [ClangOption, CC1Option],
Expand Down
1 change: 1 addition & 0 deletions clang/lib/CodeGen/BackendUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ static bool initTargetOptions(const CompilerInstance &CI,
Options.StackUsageOutput = CodeGenOpts.StackUsageOutput;
Options.EmitAddrsig = CodeGenOpts.Addrsig;
Options.ForceDwarfFrameSection = CodeGenOpts.ForceDwarfFrameSection;
Options.EmitCallGraphSection = CodeGenOpts.CallGraphSection;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TargetOptions :(

Options.EmitCallSiteInfo = CodeGenOpts.EmitCallSiteInfo;
Options.EnableAIXExtendedAltivecABI = LangOpts.EnableAIXExtendedAltivecABI;
Options.XRayFunctionIndex = CodeGenOpts.XRayFunctionIndex;
Expand Down
4 changes: 4 additions & 0 deletions clang/lib/Driver/ToolChains/Clang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6442,6 +6442,10 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back(A->getValue());
}

if (Args.hasFlag(options::OPT_fexperimental_call_graph_section,
options::OPT_fno_experimental_call_graph_section, false))
CmdArgs.push_back("-fexperimental-call-graph-section");

Args.addOptInFlag(CmdArgs, options::OPT_fstack_size_section,
options::OPT_fno_stack_size_section);

Expand Down
5 changes: 5 additions & 0 deletions clang/lib/Driver/ToolChains/CommonArgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1272,6 +1272,11 @@ void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args,
CmdArgs.push_back(
Args.MakeArgString(Twine(PluginOptPrefix) + "-stack-size-section"));

if (Args.hasFlag(options::OPT_fexperimental_call_graph_section,
options::OPT_fno_experimental_call_graph_section, false))
CmdArgs.push_back(
Args.MakeArgString(Twine(PluginOptPrefix) + "-call-graph-section"));

// Setup statistics file output.
SmallString<128> StatsFile = getStatsFileName(Args, Output, *Input, D);
if (!StatsFile.empty())
Expand Down
5 changes: 5 additions & 0 deletions clang/test/Driver/call-graph-section.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// RUN: %clang -### -fexperimental-call-graph-section %s 2>&1 | FileCheck --check-prefix=CALL-GRAPH-SECTION %s
// RUN: %clang -### -fexperimental-call-graph-section -fno-experimental-call-graph-section %s 2>&1 | FileCheck --check-prefix=NO-CALL-GRAPH-SECTION %s

// CALL-GRAPH-SECTION: "-fexperimental-call-graph-section"
// NO-CALL-GRAPH-SECTION-NOT: "-fexperimental-call-graph-section"