diff options
author | Scott Linder <scott@scottlinder.com> | 2018-02-23 23:01:06 +0000 |
---|---|---|
committer | Scott Linder <scott@scottlinder.com> | 2018-02-23 23:01:06 +0000 |
commit | 16c7bdaf3245d23b9b441144f5efb610e2044927 (patch) | |
tree | 870f3b5c5c606b19951cb4433f3887825bc61e56 /llvm/test/CodeGen | |
parent | 5e2f6ba51e89c9b9625902f0c36493ad46e46a3b (diff) | |
download | bcm5719-llvm-16c7bdaf3245d23b9b441144f5efb610e2044927.tar.gz bcm5719-llvm-16c7bdaf3245d23b9b441144f5efb610e2044927.zip |
[DebugInfo] Support DWARF v5 source code embedding extension
In DWARF v5 the Line Number Program Header is extensible, allowing values with
new content types. In this extension a content type is added,
DW_LNCT_LLVM_source, which contains the embedded source code of the file.
Add new optional attribute for !DIFile IR metadata called source which contains
source text. Use this to output the source to the DWARF line table of code
objects. Analogously extend METADATA_FILE in Bitcode and .file directive in ASM
to support optional source.
Teach llvm-dwarfdump and llvm-objdump about the new values. Update the output
format of llvm-dwarfdump to make room for the new attribute on file_names
entries, and support embedded sources for the -source option in llvm-objdump.
Differential Revision: https://reviews.llvm.org/D42765
llvm-svn: 325970
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r-- | llvm/test/CodeGen/BPF/dwarfdump.ll | 4 | ||||
-rw-r--r-- | llvm/test/CodeGen/Generic/dwarf-md5.ll | 22 | ||||
-rw-r--r-- | llvm/test/CodeGen/X86/dwarf-comp-dir.ll | 6 |
3 files changed, 21 insertions, 11 deletions
diff --git a/llvm/test/CodeGen/BPF/dwarfdump.ll b/llvm/test/CodeGen/BPF/dwarfdump.ll index c7cd886522a..f079751391c 100644 --- a/llvm/test/CodeGen/BPF/dwarfdump.ll +++ b/llvm/test/CodeGen/BPF/dwarfdump.ll @@ -59,6 +59,8 @@ attributes #1 = { nounwind readnone } !26 = !DILocation(line: 7, column: 17, scope: !2) !27 = !DILocation(line: 9, column: 9, scope: !2) -; CHECK: file_names[ 1] 0 0x00000000 0x00000000 "testprog.c" +; CHECK: file_names[ 1]: +; CHECK-NEXT: name: "testprog.c" +; CHECK-NEXT: dir_index: 0 ; CHECK: 0x0000000000000000 2 ; CHECK: 0x0000000000000028 7 diff --git a/llvm/test/CodeGen/Generic/dwarf-md5.ll b/llvm/test/CodeGen/Generic/dwarf-md5.ll index 001a67e90ea..b9977200de1 100644 --- a/llvm/test/CodeGen/Generic/dwarf-md5.ll +++ b/llvm/test/CodeGen/Generic/dwarf-md5.ll @@ -16,13 +16,21 @@ ; ASM: .file 1 ".{{/|\\\\}}t1.h" md5 "11111111111111111111111111111111" ; ASM: .file 2 ".{{/|\\\\}}t2.h" md5 "22222222222222222222222222222222" -; OBJ-4: Dir Mod Time File Len File Name -; OBJ-4: file_names[ 1] 1 0x00000000 0x00000000 "t1.h" -; OBJ-4: file_names[ 2] 1 0x00000000 0x00000000 "t2.h" - -; OBJ-5: Dir MD5 Checksum File Name -; OBJ-5: file_names[ 0] 1 11111111111111111111111111111111 "t1.h" -; OBJ-5: file_names[ 1] 1 22222222222222222222222222222222 "t2.h" +; OBJ-4: file_names[ 1]: +; OBJ-4-NEXT: name: "t1.h" +; OBJ-4-NEXT: dir_index: 1 +; OBJ-4: file_names[ 2]: +; OBJ-4-NEXT: name: "t2.h" +; OBJ-4-NEXT: dir_index: 1 + +; OBJ-5: file_names[ 0]: +; OBJ-5-NEXT: name: "t1.h" +; OBJ-5-NEXT: dir_index: 1 +; OBJ-5-NEXT: md5_checksum: 11111111111111111111111111111111 +; OBJ-5: file_names[ 1]: +; OBJ-5-NEXT: name: "t2.h" +; OBJ-5-NEXT: dir_index: 1 +; OBJ-5-NEXT: md5_checksum: 22222222222222222222222222222222 ; ModuleID = 't.c' source_filename = "t.c" diff --git a/llvm/test/CodeGen/X86/dwarf-comp-dir.ll b/llvm/test/CodeGen/X86/dwarf-comp-dir.ll index 8d9f7c0e8d0..f308b890ed3 100644 --- a/llvm/test/CodeGen/X86/dwarf-comp-dir.ll +++ b/llvm/test/CodeGen/X86/dwarf-comp-dir.ll @@ -15,7 +15,7 @@ target triple = "x86_64-unknown-linux-gnu" !7 = !{!6} ; The important part of the following check is that dir = #0. -; Dir Mod Time File Len File Name -; ---- ---------- ---------- --------------------------- -; CHECK: file_names[ 1] 0 0x00000000 0x00000000 "empty.c" +; CHECK: file_names[ 1]: +; CHECK-NEXT: name: "empty.c" +; CHECK-NEXT: dir_index: 0 !5 = !{i32 1, !"Debug Info Version", i32 3} |