]> granicus.if.org Git - llvm/commit
Add support for DW_TAG_thrown_type.
authorAdrian Prantl <aprantl@apple.com>
Wed, 26 Apr 2017 22:56:44 +0000 (22:56 +0000)
committerAdrian Prantl <aprantl@apple.com>
Wed, 26 Apr 2017 22:56:44 +0000 (22:56 +0000)
commit1bf6297ee851658922ea3d7c31fe14b6a41d746d
treefa6ef9325d7e0cad4662c1dbe1321c8dd226de47
parent2db23b3bbe96288e750a0b88bb50896ae36065f7
Add support for DW_TAG_thrown_type.

For Swift we would like to be able to encode the error types that a
function may throw, so the debugger can display them alongside the
function's return value when finish-ing a function.

DWARF defines DW_TAG_thrown_type (intended to be used for C++ throw()
declarations) that is a perfect fit for this purpose. This patch wires
up support for DW_TAG_thrown_type in LLVM by adding a list of thrown
types to DISubprogram.

To offset the cost of the extra pointer, there is a follow-up patch
that turns DISubprogram into a variable-length node.

rdar://problem/29481673

Differential Revision: https://reviews.llvm.org/D32559

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301489 91177308-0d34-0410-b5e6-96231b3b80d8
17 files changed:
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/DwarfUnit.cpp
lib/CodeGen/AsmPrinter/DwarfUnit.h
lib/IR/AsmWriter.cpp
lib/IR/DIBuilder.cpp
lib/IR/DebugInfoMetadata.cpp
lib/IR/LLVMContextImpl.h
lib/IR/Verifier.cpp
test/Assembler/disubprogram.ll
test/DebugInfo/Generic/thrownTypes.ll [new file with mode: 0644]
test/Verifier/DISubprogram.ll [new file with mode: 0644]
unittests/IR/IRBuilderTest.cpp
unittests/IR/MetadataTest.cpp