[PATCH] D35583: Debug Info: Add a file: field to DIImportedEntity

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 18 14:15:52 PDT 2017


aprantl created this revision.
Herald added subscribers: eraman, mehdi_amini.

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.


Repository:
  rL LLVM

https://reviews.llvm.org/D35583

Files:
  include/llvm/IR/DIBuilder.h
  include/llvm/IR/DebugInfoMetadata.h
  lib/AsmParser/LLParser.cpp
  lib/Bitcode/Reader/MetadataLoader.cpp
  lib/Bitcode/Writer/BitcodeWriter.cpp
  lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
  lib/IR/AsmWriter.cpp
  lib/IR/DIBuilder.cpp
  lib/IR/DebugInfoMetadata.cpp
  lib/IR/LLVMContextImpl.h
  test/Assembler/diimportedentity.ll
  test/Bitcode/DIGlobalVariableExpression.ll
  test/Bitcode/upgrade-importedentity.ll
  test/Bitcode/upgrade-importedentity.ll.bc
  test/DebugInfo/Generic/namespace.ll
  test/DebugInfo/X86/DIModule.ll
  test/DebugInfo/X86/DIModuleContext.ll
  test/DebugInfo/X86/fission-inline.ll
  test/DebugInfo/X86/gnu-public-names.ll
  test/DebugInfo/X86/lexical-block-file-inline.ll
  test/DebugInfo/X86/pr19307.ll
  test/Linker/pr26037.ll
  test/ThinLTO/X86/debuginfo-cu-import.ll
  tools/clang/lib/CodeGen/CGDebugInfo.cpp
  tools/clang/test/CodeGen/debug-info-imported-entity.cpp
  tools/clang/test/CodeGenCXX/debug-info-anon-namespace.cpp
  tools/clang/test/CodeGenCXX/debug-info-namespace.cpp
  tools/clang/test/Modules/DebugInfoTransitiveImport.m
  tools/clang/test/Modules/ExtDebugInfo.cpp
  tools/clang/test/Modules/Inputs/module.map
  tools/clang/test/Modules/debug-info-moduleimport.m
  unittests/IR/IRBuilderTest.cpp
  unittests/IR/MetadataTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35583.107176.patch
Type: text/x-patch
Size: 47759 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170718/78891deb/attachment-0001.bin>


More information about the llvm-commits mailing list