[clang] [clang][DebugInfo] Attach `DISubprogram` to additional call variants (PR #166202)

J. Ryan Stinnett via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 7 05:44:37 PST 2025


================
@@ -6277,6 +6277,21 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
     pushDestroy(QualType::DK_nontrivial_c_struct, Ret.getAggregateAddress(),
                 RetTy);
 
+  if (CalleeDecl) {
+    // Generate function declaration DISuprogram in order to be used
+    // in debug info about call sites.
+    if (CGDebugInfo *DI = getDebugInfo()) {
+      CodeGenFunction CalleeCGF(CGM);
----------------
jryans wrote:

Correct, call site emission is skipped for O0, so I agree that in that light, the O0 regressions warrant further investigation.

Currently the check for O0 happens after collecting the function arguments, so I'll try repeating the O0 check a bit earlier so that we hopefully abort earlier and do less work.

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


More information about the cfe-commits mailing list