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,
|
void CGDebugInfo::addHeapAllocSiteMetadata(llvm::CallBase *CI,
|
||||||
QualType AllocatedTy,
|
QualType AllocatedTy,
|
||||||
SourceLocation Loc) {
|
SourceLocation Loc) {
|
||||||
|
if (CGM.getCodeGenOpts().getDebugInfo() <=
|
||||||
|
codegenoptions::DebugLineTablesOnly)
|
||||||
|
return;
|
||||||
llvm::MDNode *node;
|
llvm::MDNode *node;
|
||||||
if (AllocatedTy->isVoidType())
|
if (AllocatedTy->isVoidType())
|
||||||
node = llvm::MDNode::get(CGM.getLLVMContext(), None);
|
node = llvm::MDNode::get(CGM.getLLVMContext(), None);
|
||||||
|
|
|
@ -1639,8 +1639,7 @@ llvm::Value *CodeGenFunction::EmitCXXNewExpr(const CXXNewExpr *E) {
|
||||||
EmitNewDeleteCall(*this, allocator, allocatorType, allocatorArgs);
|
EmitNewDeleteCall(*this, allocator, allocatorType, allocatorArgs);
|
||||||
|
|
||||||
// Set !heapallocsite metadata on the call to operator new.
|
// Set !heapallocsite metadata on the call to operator new.
|
||||||
if (CGM.getCodeGenOpts().getDebugInfo() != codegenoptions::NoDebugInfo &&
|
if (getDebugInfo())
|
||||||
getDebugInfo())
|
|
||||||
if (auto *newCall = dyn_cast<llvm::CallBase>(RV.getScalarVal()))
|
if (auto *newCall = dyn_cast<llvm::CallBase>(RV.getScalarVal()))
|
||||||
getDebugInfo()->addHeapAllocSiteMetadata(newCall, allocType,
|
getDebugInfo()->addHeapAllocSiteMetadata(newCall, allocType,
|
||||||
E->getExprLoc());
|
E->getExprLoc());
|
||||||
|
|
Loading…
Reference in New Issue