diff options
author | Adrian Prantl <aprantl@apple.com> | 2017-07-19 00:09:54 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2017-07-19 00:09:54 +0000 |
commit | 9563b5a5e126f25d1966ac92a07bf033de01bc81 (patch) | |
tree | 7acb1dedd26abc711feb617c458d246e6a92d66d /test/Bitcode | |
parent | 35375a35c17d7c45f3067362f87388533ee5c558 (diff) |
Debug Info: Add a file: field to DIImportedEntity.
DIImportedEntity has a line number, but not a file field. To determine
the decl_line/decl_file we combine the line number from the
DIImportedEntity with the file from the DIImportedEntity's scope. This
does not work correctly when the parent scope is a DINamespace or a
DIModule, both of which do not have a source file.
This patch adds a file field to DIImportedEntity to unambiguously
identify the source location of the using/import declaration. Most
testcase updates are mechanical, the interesting one is the removal of
the FIXME in test/DebugInfo/Generic/namespace.ll.
This fixes PR33822. See https://bugs.llvm.org/show_bug.cgi?id=33822
for more context.
<rdar://problem/33357889>
https://bugs.llvm.org/show_bug.cgi?id=33822
Differential Revision: https://reviews.llvm.org/D35583
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308398 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Bitcode')
-rw-r--r-- | test/Bitcode/DIGlobalVariableExpression.ll | 2 | ||||
-rw-r--r-- | test/Bitcode/upgrade-importedentity.ll | 15 | ||||
-rw-r--r-- | test/Bitcode/upgrade-importedentity.ll.bc | bin | 0 -> 1216 bytes |
3 files changed, 16 insertions, 1 deletions
diff --git a/test/Bitcode/DIGlobalVariableExpression.ll b/test/Bitcode/DIGlobalVariableExpression.ll index 31c3fda1b00..3cf08247282 100644 --- a/test/Bitcode/DIGlobalVariableExpression.ll +++ b/test/Bitcode/DIGlobalVariableExpression.ll @@ -36,4 +36,4 @@ !9 = !{!"clang version 4.0.0 (trunk 286129) (llvm/trunk 286128)"} !10 = distinct !DIGlobalVariable(name: "c", scope: !1, file: !2, line: 1, type: !5, isLocal: false, isDefinition: true, expr: !DIExpression(DW_OP_constu, 23, DW_OP_stack_value)) !11 = distinct !DIGlobalVariable(name: "h", scope: !1, file: !2, line: 2, type: !5, isLocal: false, isDefinition: true) -!12 = !DIImportedEntity(tag: DW_TAG_imported_declaration, line: 1, scope: !1, entity: !11) +!12 = !DIImportedEntity(tag: DW_TAG_imported_declaration, file: !2, line: 1, scope: !1, entity: !11) diff --git a/test/Bitcode/upgrade-importedentity.ll b/test/Bitcode/upgrade-importedentity.ll new file mode 100644 index 00000000000..134ccf1f3ea --- /dev/null +++ b/test/Bitcode/upgrade-importedentity.ll @@ -0,0 +1,15 @@ +; RUN: llvm-dis < %s.bc | FileCheck %s +; RUN: verify-uselistorder < %s.bc + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!9, !10} + +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 5.0.0 (trunk 308185) (llvm/trunk 308186)", emissionKind: FullDebug, imports: !3) +!1 = !DIFile(filename: "using.ii", directory: "/") +!3 = !{!4} +!4 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !5, entity: !8, line: 301) +; CHECK: !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !4, entity: !5) +!5 = !DINamespace(name: "M", scope: null) +!8 = !DINamespace(name: "N", scope: null) +!9 = !{i32 2, !"Dwarf Version", i32 4} +!10 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/test/Bitcode/upgrade-importedentity.ll.bc b/test/Bitcode/upgrade-importedentity.ll.bc Binary files differnew file mode 100644 index 00000000000..7fa833b5046 --- /dev/null +++ b/test/Bitcode/upgrade-importedentity.ll.bc |