[llvm] r243134 - DI: Only DICompositeType has getElements(), NFC
Duncan P. N. Exon Smith
dexonsmith at apple.com
Fri Jul 24 11:17:17 PDT 2015
Author: dexonsmith
Date: Fri Jul 24 13:17:17 2015
New Revision: 243134
URL: http://llvm.org/viewvc/llvm-project?rev=243134&view=rev
Log:
DI: Only DICompositeType has getElements(), NFC
There is an assertion inside `DICompositeTypeBase::getElements()` that
`this` is not a `DISubroutineType`, leaving only `DICompositeType`.
Make that clear at the call sites.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=243134&r1=243133&r2=243134&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Fri Jul 24 13:17:17 2015
@@ -187,7 +187,7 @@ const DIType *DbgVariable::getType() con
if (tag == dwarf::DW_TAG_pointer_type)
subType = resolve(cast<DIDerivedType>(Ty)->getBaseType());
- auto Elements = cast<DICompositeTypeBase>(subType)->getElements();
+ auto Elements = cast<DICompositeType>(subType)->getElements();
for (unsigned i = 0, N = Elements.size(); i < N; ++i) {
auto *DT = cast<DIDerivedTypeBase>(Elements[i]);
if (getName() == DT->getName())
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp?rev=243134&r1=243133&r2=243134&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp Fri Jul 24 13:17:17 2015
@@ -452,7 +452,7 @@ void DwarfUnit::addBlockByrefAddress(con
// Find the __forwarding field and the variable field in the __Block_byref
// struct.
- DINodeArray Fields = cast<DICompositeTypeBase>(TmpTy)->getElements();
+ DINodeArray Fields = cast<DICompositeType>(TmpTy)->getElements();
const DIDerivedType *varField = nullptr;
const DIDerivedType *forwardingField = nullptr;
More information about the llvm-commits
mailing list