OSDN Git Service

IR: Stop abusing DW_TAG_base_type for compile unit arrays
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Thu, 12 Feb 2015 21:52:11 +0000 (21:52 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Thu, 12 Feb 2015 21:52:11 +0000 (21:52 +0000)
commite53f1302f96c1c38b5f272b25417d42550ed6412
tree48c8328f3bac47649b14424cad9908afe93f84d8
parent3231937293d470314ea8213ebfae29d3d6206255
IR: Stop abusing DW_TAG_base_type for compile unit arrays

The sub-arrays for compile units have for a long time been initialized
to distinct temporary nodes with the `DW_TAG_base_type` tag, with no
other operands.  These invalid `DIBasicType`s are later replaced with
appropriate arrays.

This seems like a poor man's assertion that the arrays do eventually get
replaced.  These days, temporaries in the graph will cause assertions
when writing bitcode or assembly, so this isn't necessary.  Use
temporary empty tuples instead.

Note that the whole idea of using temporaries and then replacing them
later is wasteful here.  We never actually want to merge compile units
by uniquing based on content.  Compile units should use `getDistinct()`
instead of `get()`, and then their operands can be freely replaced later
on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228967 91177308-0d34-0410-b5e6-96231b3b80d8
lib/IR/DIBuilder.cpp