[PATCH] D98668: Support !heapallocsite attachments in StripDebugInfo().

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 16 10:05:49 PDT 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGc3a18bb1e831: Support !heapallocsite attachments in StripDebugInfo(). (authored by aprantl).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98668

Files:
  llvm/lib/IR/DebugInfo.cpp
  llvm/test/Transforms/Util/strip-nonlinetable-debuginfo-heapallocsite.ll


Index: llvm/test/Transforms/Util/strip-nonlinetable-debuginfo-heapallocsite.ll
===================================================================
--- llvm/test/Transforms/Util/strip-nonlinetable-debuginfo-heapallocsite.ll
+++ llvm/test/Transforms/Util/strip-nonlinetable-debuginfo-heapallocsite.ll
@@ -1,4 +1,5 @@
 ; RUN: opt -S -strip-nonlinetable-debuginfo %s -o - |  FileCheck %s
+; RUN: opt -S -strip-debug %s -o - |  FileCheck %s
 ; int *get() { return new int[256]; }
 ; ModuleID = '/tmp/heapallocsite.cpp'
 source_filename = "/tmp/heapallocsite.cpp"
@@ -26,7 +27,7 @@
 !llvm.module.flags = !{!3, !4, !5, !6}
 !llvm.ident = !{!7}
 
-; CHECK-LABEL: !0 =
+; CHECK-LABEL: !llvm.ident
 ; CHECK-NOT: !DIBasicType(name: "int"
 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 13.0.0 (git at github.com:llvm/llvm-project 6d4ce49dae17715de502acbd50ab4c9b3c18215b)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None, sysroot: "/")
 !1 = !DIFile(filename: "/tmp/heapallocsite.cpp", directory: "/Volumes/Data/llvm-project")
Index: llvm/lib/IR/DebugInfo.cpp
===================================================================
--- llvm/lib/IR/DebugInfo.cpp
+++ llvm/lib/IR/DebugInfo.cpp
@@ -345,6 +345,9 @@
         if (NewLoopID != LoopID)
           I.setMetadata(LLVMContext::MD_loop, NewLoopID);
       }
+      // Strip heapallocsite attachments, they point into the DIType system.
+      if (I.hasMetadataOtherThanDebugLoc())
+        I.setMetadata("heapallocsite", nullptr);
     }
   }
   return Changed;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98668.331028.patch
Type: text/x-patch
Size: 1599 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210316/e3e5c306/attachment.bin>


More information about the llvm-commits mailing list