OSDN Git Service

IR / debug info: Add a DWOId field to DICompileUnit,
authorAdrian Prantl <aprantl@apple.com>
Thu, 21 May 2015 20:37:30 +0000 (20:37 +0000)
committerAdrian Prantl <aprantl@apple.com>
Thu, 21 May 2015 20:37:30 +0000 (20:37 +0000)
commit849c7601a03398d2cba5325d778eb0bed63252f2
tree751e0dbb31905cd1d45c4350c07cf4f9db686521
parent5368a26e16bc1c930103aeb710abdfe803da4446
IR / debug info: Add a DWOId field to DICompileUnit,
so DWARF skeleton CUs can be expression in IR. A skeleton CU is a
(typically empty) DW_TAG_compile_unit that has a DW_AT_(GNU)_dwo_name and
a DW_AT_(GNU)_dwo_id attribute. It is used to refer to external debug info.

This is a prerequisite for clang module debugging as discussed in
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-November/040076.html.
In order to refer to external types stored in split DWARF (dwo) objects,
such as clang modules, we need to emit skeleton CUs, which identify the
dwarf object (i.e., the clang module) by filename (the SplitDebugFilename)
and a hash value, the dwo_id.

This patch only contains the IR changes. The idea is that a CUs with a
non-zero dwo_id field will be emitted together with a DW_AT_GNU_dwo_name
and DW_AT_GNU_dwo_id attribute.

http://reviews.llvm.org/D9488
rdar://problem/20091852

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237949 91177308-0d34-0410-b5e6-96231b3b80d8
13 files changed:
include/llvm/IR/DIBuilder.h
include/llvm/IR/DebugInfoMetadata.h
lib/AsmParser/LLParser.cpp
lib/Bitcode/Reader/BitcodeReader.cpp
lib/Bitcode/Writer/BitcodeWriter.cpp
lib/IR/AsmWriter.cpp
lib/IR/DIBuilder.cpp
lib/IR/DebugInfoMetadata.cpp
lib/IR/LLVMContextImpl.h
test/Assembler/mdcompileunit.ll
test/Bitcode/DICompileUnit-no-DWOId.ll [new file with mode: 0644]
test/Bitcode/DICompileUnit-no-DWOId.ll.bc [new file with mode: 0644]
unittests/IR/MetadataTest.cpp