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

Orlando Cazalet-Hyams via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 6 04:06:40 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);
----------------
OCHyams wrote:

Is this kind of `CodeGenFunction` instantiation done elsewhere (how expensive is it?); I think it's usually passed around by ref (can we get at it from somewhere else? can `this` be used instead or does the existing per-function state interfere with that).

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


More information about the cfe-commits mailing list