[PATCH] D71593: [DebugInfo] Call site entries cannot be generated for FrameSetup calls

Lewis Revill via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 11 13:28:04 PST 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGa6bd1256ce8a: [DebugInfo] Call site entries cannot be generated for FrameSetup calls (authored by lewis-revill).

Changed prior to commit:
  https://reviews.llvm.org/D71593?vs=242724&id=243979#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71593

Files:
  llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
  llvm/test/DebugInfo/RISCV/saverestore.ll


Index: llvm/test/DebugInfo/RISCV/saverestore.ll
===================================================================
--- /dev/null
+++ llvm/test/DebugInfo/RISCV/saverestore.ll
@@ -0,0 +1,28 @@
+; RUN: llc -mtriple=riscv32 -mattr=+save-restore < %s
+
+; Ensure that the addition of framesetup instructions which call save/restore
+; libcalls do not cause a crash when DIFlagAllCallsDescribed is set.
+
+define i32 @main() noreturn nounwind !dbg !7 {
+entry:
+  tail call void @exit(i32 0)
+  unreachable
+}
+
+declare void @exit(i32) noreturn
+
+!llvm.dbg.cu = !{!0}
+!llvm.module.flags = !{!3, !4, !5}
+!llvm.ident = !{!6}
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)
+!1 = !DIFile(filename: "saverestore.c", directory: ".")
+!2 = !{}
+!3 = !{i32 7, !"Dwarf Version", i32 5}
+!4 = !{i32 2, !"Debug Info Version", i32 3}
+!5 = !{i32 1, !"wchar_size", i32 4}
+!6 = !{!"clang"}
+!7 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 1, type: !8, scopeLine: 1, flags: DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2)
+!8 = !DISubroutineType(types: !9)
+!9 = !{!10}
+!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
Index: llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
===================================================================
--- llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -767,6 +767,11 @@
       if (!MI.isCandidateForCallSiteEntry())
         continue;
 
+      // Skip instructions marked as frame setup, as they are not interesting to
+      // the user.
+      if (MI.getFlag(MachineInstr::FrameSetup))
+        continue;
+
       // TODO: Add support for targets with delay slots (see: beginInstruction).
       if (MI.hasDelaySlot())
         return;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71593.243979.patch
Type: text/x-patch
Size: 1932 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200211/83d79a99/attachment-0001.bin>


More information about the llvm-commits mailing list