[llvm] r350047 - DebugInfo: Add assembly comments for debug_addr contribution header fields
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Sun Dec 23 23:09:50 PST 2018
Author: dblaikie
Date: Sun Dec 23 23:09:50 2018
New Revision: 350047
URL: http://llvm.org/viewvc/llvm-project?rev=350047&view=rev
Log:
DebugInfo: Add assembly comments for debug_addr contribution header fields
Added:
llvm/trunk/test/DebugInfo/X86/addr_comments.ll
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/AddressPool.cpp
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AddressPool.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AddressPool.cpp?rev=350047&r1=350046&r2=350047&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AddressPool.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AddressPool.cpp Sun Dec 23 23:09:50 2018
@@ -31,9 +31,13 @@ void AddressPool::emitHeader(AsmPrinter
+ sizeof(uint8_t) // address_size
+ sizeof(uint8_t) // segment_selector_size
+ AddrSize * Pool.size(); // entries
+ Asm.OutStreamer->AddComment("Length of contribution");
Asm.emitInt32(Length); // TODO: Support DWARF64 format.
+ Asm.OutStreamer->AddComment("DWARF version number");
Asm.emitInt16(Asm.getDwarfVersion());
+ Asm.OutStreamer->AddComment("Address size");
Asm.emitInt8(AddrSize);
+ Asm.OutStreamer->AddComment("Segment selector size");
Asm.emitInt8(0); // TODO: Support non-zero segment_selector_size.
}
Added: llvm/trunk/test/DebugInfo/X86/addr_comments.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/addr_comments.ll?rev=350047&view=auto
==============================================================================
--- llvm/trunk/test/DebugInfo/X86/addr_comments.ll (added)
+++ llvm/trunk/test/DebugInfo/X86/addr_comments.ll Sun Dec 23 23:09:50 2018
@@ -0,0 +1,33 @@
+; RUN: llc %s -mtriple=i386-unknown-linux-gnu -filetype=asm -o - | FileCheck %s
+
+; CHECK: .section .debug_addr
+; CHECK: .long 8 # Length of contribution
+; CHECK: .short 5 # DWARF version number
+; CHECK: .byte 4 # Address size
+; CHECK: .byte 0 # Segment selector size
+; CHECK: .Laddr_table_base0:
+; CHECK: .long .Lfunc_begin0
+
+; Function Attrs: noinline nounwind optnone uwtable
+define dso_local void @foo() #0 !dbg !7 {
+entry:
+ ret void, !dbg !10
+}
+
+attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
+
+!llvm.dbg.cu = !{!0}
+!llvm.module.flags = !{!3, !4, !5}
+!llvm.ident = !{!6}
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 8.0.0 (trunk 350004) (llvm/trunk 350008)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)
+!1 = !DIFile(filename: "foo.c", directory: "/usr/local/google/home/blaikie/dev/scratch")
+!2 = !{}
+!3 = !{i32 2, !"Dwarf Version", i32 5}
+!4 = !{i32 2, !"Debug Info Version", i32 3}
+!5 = !{i32 1, !"wchar_size", i32 4}
+!6 = !{!"clang version 8.0.0 (trunk 350004) (llvm/trunk 350008)"}
+!7 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !8, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
+!8 = !DISubroutineType(types: !9)
+!9 = !{null}
+!10 = !DILocation(line: 2, column: 1, scope: !7)
More information about the llvm-commits
mailing list