[PATCH] D81481: Change debuginfo check for addHeapAllocSiteMetadata

Arthur Eubanks via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 9 11:34:16 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGbc38793852c0: Change debuginfo check for addHeapAllocSiteMetadata (authored by aeubanks).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81481/new/

https://reviews.llvm.org/D81481

Files:
  clang/lib/CodeGen/CGDebugInfo.cpp
  clang/lib/CodeGen/CGExprCXX.cpp


Index: clang/lib/CodeGen/CGExprCXX.cpp
===================================================================
--- clang/lib/CodeGen/CGExprCXX.cpp
+++ clang/lib/CodeGen/CGExprCXX.cpp
@@ -1639,8 +1639,7 @@
       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());
Index: clang/lib/CodeGen/CGDebugInfo.cpp
===================================================================
--- clang/lib/CodeGen/CGDebugInfo.cpp
+++ clang/lib/CodeGen/CGDebugInfo.cpp
@@ -2149,6 +2149,9 @@
 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);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81481.269621.patch
Type: text/x-patch
Size: 1303 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200609/c4cca27a/attachment.bin>


More information about the cfe-commits mailing list