1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
llvm-mirror/lib/AsmParser
Adrian Prantl 821c2290a5 Add DWARF for discriminated unions
n Rust, an enum that carries data in the variants is, essentially, a
discriminated union. Furthermore, the Rust compiler will perform
space optimizations on such enums in some situations. Previously,
DWARF for these constructs was emitted using a hack (a magic field
name); but this approach stopped working when more space optimizations
were added in https://github.com/rust-lang/rust/pull/45225.

This patch changes LLVM to allow discriminated unions to be
represented in DWARF. It adds createDiscriminatedUnionType and
createDiscriminatedMemberType to DIBuilder and then arranges for this
to be emitted using DWARF's DW_TAG_variant_part and DW_TAG_variant.

Note that DWARF requires that a discriminated union be represented as
a structure with a variant part. However, as Rust only needs to emit
pure discriminated unions, this is what I chose to expose on
DIBuilder.

Patch by Tom Tromey!

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

llvm-svn: 324426
2018-02-06 23:45:59 +00:00
..
CMakeLists.txt modules: Add explicit dependency on intrinsics_gen 2015-06-16 00:44:12 +00:00
LLLexer.cpp Hardware-assisted AddressSanitizer (llvm part). 2017-12-09 00:21:41 +00:00
LLLexer.h Remove empty non-virtual destructors or mark them =default when non-public 2015-04-11 15:32:26 +00:00
LLParser.cpp Add DWARF for discriminated unions 2018-02-06 23:45:59 +00:00
LLParser.h LLParser: add an argument for overriding data layout and do not check alloca addr space 2018-01-30 22:32:39 +00:00
LLToken.h Hardware-assisted AddressSanitizer (llvm part). 2017-12-09 00:21:41 +00:00
LLVMBuild.txt Add dependency from AsmParser to BinaryFormat. 2017-06-07 04:24:33 +00:00
Parser.cpp LLParser: add an argument for overriding data layout and do not check alloca addr space 2018-01-30 22:32:39 +00:00