Skip to content

Conversation

@Prabhuk
Copy link
Contributor

@Prabhuk Prabhuk commented Oct 1, 2025

This patch adds clang CodeGen option to emit callgraph section.
The -fcall-graph-section Driver flag is introduced to control
the CallGraphSection CodeGen option.

This patch adds clang CodeGen option to emit callgraph section.
The `-fcall-graph-section` Driver flag is introduced to control
the `CallGraphSection` CodeGen option.
@github-actions
Copy link

github-actions bot commented Oct 1, 2025

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff origin/main HEAD --extensions c,cpp,h -- clang/test/CodeGen/call-graph-section-templates.cpp clang/test/CodeGen/call-graph-section-virtual-methods.cpp clang/test/CodeGen/call-graph-section.c clang/test/CodeGen/call-graph-section.cpp clang/test/Driver/call-graph-section.c clang/lib/CodeGen/BackendUtil.cpp clang/lib/CodeGen/CGCall.cpp clang/lib/CodeGen/CodeGenModule.cpp clang/lib/CodeGen/CodeGenModule.h clang/lib/Driver/ToolChains/Clang.cpp clang/lib/Driver/ToolChains/CommonArgs.cpp

⚠️
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing origin/main to the base branch/commit you want to compare against.
⚠️

View the diff from clang-format here.
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 1e03e0b06..fdba3dd2f 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -3080,7 +3080,7 @@ void CodeGenModule::createFunctionTypeMetadataForIcall(const FunctionDecl *FD,
   // Add the generalized identifier if not added already.
   if (!hasExistingGeneralizedTypeMD(F)) {
     QualType GenPtrFnType = GeneralizeFunctionType(getContext(), FD->getType(),
-                                                  /*GeneralizePointers=*/true);
+                                                   /*GeneralizePointers=*/true);
     F->addTypeMetadata(0, CreateMetadataIdentifierGeneralized(GenPtrFnType));
   }
 

Copy link
Collaborator

@shafik shafik left a comment

Choose a reason for hiding this comment

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

Please update the subject to reflect the nature of the change.

@Prabhuk Prabhuk closed this Oct 21, 2025
@Prabhuk Prabhuk deleted the callgraph_clang branch October 21, 2025 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants