File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change 3838#include " llvm/IR/Attributes.h"
3939#include " llvm/IR/CallingConv.h"
4040#include " llvm/IR/DataLayout.h"
41+ #include " llvm/IR/DebugInfoMetadata.h"
4142#include " llvm/IR/InlineAsm.h"
4243#include " llvm/IR/IntrinsicInst.h"
4344#include " llvm/IR/Intrinsics.h"
@@ -6277,10 +6278,13 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
62776278 pushDestroy (QualType::DK_nontrivial_c_struct, Ret.getAggregateAddress (),
62786279 RetTy);
62796280
6280- if (CalleeDecl) {
6281- // Generate function declaration DISuprogram in order to be used
6282- // in debug info about call sites.
6283- if (CGDebugInfo *DI = getDebugInfo ()) {
6281+ // Generate function declaration DISuprogram in order to be used
6282+ // in debug info about call sites.
6283+ if (CGDebugInfo *DI = getDebugInfo ()) {
6284+ // Ensure call site info would actually be emitted before collecting
6285+ // further callee info.
6286+ if (CalleeDecl && !CalleeDecl->hasAttr <NoDebugAttr>() &&
6287+ DI->getCallSiteRelatedAttrs () != llvm::DINode::FlagZero) {
62846288 CodeGenFunction CalleeCGF (CGM);
62856289 const GlobalDecl &CalleeGlobalDecl =
62866290 Callee.getAbstractInfo ().getCalleeDecl ();
Original file line number Diff line number Diff line change @@ -678,6 +678,10 @@ class CGDebugInfo {
678678 // / Emit symbol for debugger that holds the pointer to the vtable.
679679 void emitVTableSymbol (llvm::GlobalVariable *VTable, const CXXRecordDecl *RD);
680680
681+ // / Return flags which enable debug info emission for call sites, provided
682+ // / that it is supported and enabled.
683+ llvm::DINode::DIFlags getCallSiteRelatedAttrs () const ;
684+
681685private:
682686 // / Amend \p I's DebugLoc with \p Group (its source atom group) and \p
683687 // / Rank (lower nonzero rank is higher precedence). Does nothing if \p I
@@ -828,10 +832,6 @@ class CGDebugInfo {
828832 llvm::GlobalVariable *Var, llvm::DIScope *DContext);
829833
830834
831- // / Return flags which enable debug info emission for call sites, provided
832- // / that it is supported and enabled.
833- llvm::DINode::DIFlags getCallSiteRelatedAttrs () const ;
834-
835835 // / Get the printing policy for producing names for debug info.
836836 PrintingPolicy getPrintingPolicy () const ;
837837
You can’t perform that action at this time.
0 commit comments