[clang] Fix callee type generation (PR #186272)

Paul Kirth via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 13 09:25:56 PDT 2026


================
@@ -3267,8 +3267,10 @@ void CodeGenModule::createFunctionTypeMetadataForIcall(const FunctionDecl *FD,
 
 void CodeGenModule::createCalleeTypeMetadataForIcall(const QualType &QT,
                                                      llvm::CallBase *CB) {
-  // Only if needed for call graph section and only for indirect calls.
-  if (!CodeGenOpts.CallGraphSection || !CB->isIndirectCall())
+  // Only if needed for call graph section and only for indirect calls that are
+  // visible externally.
+  if (!CodeGenOpts.CallGraphSection || !CB->isIndirectCall() ||
+      !isExternallyVisible(QT->getLinkage()))
----------------
ilovepi wrote:

Then, I guess leave a TODO about trying to eliminate skipping internal symbols. I'm almost certain that will break how any of this was designed to work in the first place, and I'm still rather unconvinced by the analysis and reasoning about precicly what's wrong.

https://github.com/llvm/llvm-project/pull/186272


More information about the cfe-commits mailing list