forked from OSchip/llvm-project
Change debuginfo check for addHeapAllocSiteMetadata
Summary: Move check inside of addHeapAllocSiteMetadata(). Change check to DebugInfo <= DebugLineTablesOnly. Reviewers: akhuang Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D81481
This commit is contained in:
parent
7a38618a20
commit
bc38793852
|
@ -2149,6 +2149,9 @@ llvm::DIType *CGDebugInfo::getOrCreateStandaloneType(QualType D,
|
|||
void CGDebugInfo::addHeapAllocSiteMetadata(llvm::CallBase *CI,
|
||||
QualType AllocatedTy,
|
||||
SourceLocation Loc) {
|
||||
if (CGM.getCodeGenOpts().getDebugInfo() <=
|
||||
codegenoptions::DebugLineTablesOnly)
|
||||
return;
|
||||
llvm::MDNode *node;
|
||||
if (AllocatedTy->isVoidType())
|
||||
node = llvm::MDNode::get(CGM.getLLVMContext(), None);
|
||||
|
|
|
@ -1639,8 +1639,7 @@ llvm::Value *CodeGenFunction::EmitCXXNewExpr(const CXXNewExpr *E) {
|
|||
EmitNewDeleteCall(*this, allocator, allocatorType, allocatorArgs);
|
||||
|
||||
// Set !heapallocsite metadata on the call to operator new.
|
||||
if (CGM.getCodeGenOpts().getDebugInfo() != codegenoptions::NoDebugInfo &&
|
||||
getDebugInfo())
|
||||
if (getDebugInfo())
|
||||
if (auto *newCall = dyn_cast<llvm::CallBase>(RV.getScalarVal()))
|
||||
getDebugInfo()->addHeapAllocSiteMetadata(newCall, allocType,
|
||||
E->getExprLoc());
|
||||
|
|
Loading…
Reference in New Issue