diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-16 01:53:33 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-16 01:53:33 +0000 |
commit | f15c6f803268e880d3673e8b1a6dfee87982454e (patch) | |
tree | 9ddfd12a9bbb5468d22152e9b0aa356fabe18be1 /llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp | |
parent | 526ab07e3c07a6e130e797033a616953576c8830 (diff) | |
download | bcm5719-llvm-f15c6f803268e880d3673e8b1a6dfee87982454e.tar.gz bcm5719-llvm-f15c6f803268e880d3673e8b1a6dfee87982454e.zip |
DebugInfo: Gut DIDescriptor
PR23080 is almost finished. With this commit, there's no consequential
API in `DIDescriptor` and its subclasses. What's left?
- Default-constructed to `nullptr`.
- Handy `const_cast<>` (constructed from `const`, but accessors are
non-`const`).
I think the safe way to catch those is to delete the classes and fix
compile errors. That'll be my next step, after I delete the `DITypeRef`
(etc.) wrapper around `MDTypeRef`.
llvm-svn: 235069
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp index 46f3eb3201d..91546529877 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -1405,9 +1405,10 @@ void DwarfUnit::constructArrayTypeDIE(DIE &Buffer, DICompositeType CTy) { // Add subranges to array type. DIArray Elements = CTy->getElements(); for (unsigned i = 0, N = Elements.size(); i < N; ++i) { - DIDescriptor Element = Elements[i]; - if (Element.getTag() == dwarf::DW_TAG_subrange_type) - constructSubrangeDIE(Buffer, cast<MDSubrange>(Element), IdxTy); + // FIXME: Should this really be such a loose cast? + if (auto *Element = dyn_cast_or_null<DebugNode>(Elements[i])) + if (Element->getTag() == dwarf::DW_TAG_subrange_type) + constructSubrangeDIE(Buffer, cast<MDSubrange>(Element), IdxTy); } } |