->isBlockByrefStruct();
}
-DIType DbgVariable::getType() const {
+const MDType *DbgVariable::getType() const {
MDType *Ty = Var->getType().resolve(DD->getTypeIdentifierMap());
// FIXME: isBlockByrefVariable should be reformulated in terms of complex
// addresses instead.
uint16_t tag = Ty->getTag();
if (tag == dwarf::DW_TAG_pointer_type)
- subType = resolve(DITypeRef(cast<MDDerivedType>(Ty)->getBaseType()));
+ subType = resolve(cast<MDDerivedType>(Ty)->getBaseType());
auto Elements = cast<MDCompositeTypeBase>(subType)->getElements();
for (unsigned i = 0, N = Elements.size(); i < N; ++i) {
auto *DT = cast<MDDerivedTypeBase>(Elements[i]);
if (getName() == DT->getName())
- return resolve(DITypeRef(DT->getBaseType()));
+ return resolve(DT->getBaseType());
}
}
return Ty;
CU.getOrCreateGlobalVariableDIE(GV);
for (auto *SP : CUNode->getSubprograms())
SPMap.insert(std::make_pair(SP, &CU));
- for (DIType Ty : CUNode->getEnumTypes()) {
+ for (auto *Ty : CUNode->getEnumTypes()) {
// The enum types array by design contains pointers to
// MDNodes rather than DIRefs. Unique them here.
- DIType UniqueTy = cast<MDType>(resolve(Ty->getRef()));
- CU.getOrCreateTypeDIE(UniqueTy);
+ CU.getOrCreateTypeDIE(cast<MDType>(resolve(Ty->getRef())));
}
- for (DIType Ty : CUNode->getRetainedTypes()) {
+ for (auto *Ty : CUNode->getRetainedTypes()) {
// The retained types array by design contains pointers to
// MDNodes rather than DIRefs. Unique them here.
- DIType UniqueTy = cast<MDType>(resolve(Ty->getRef()));
- CU.getOrCreateTypeDIE(UniqueTy);
+ CU.getOrCreateTypeDIE(cast<MDType>(resolve(Ty->getRef())));
}
// Emit imported_modules last so that the relevant context is already
// available.
void DwarfDebug::addDwarfTypeUnitType(DwarfCompileUnit &CU,
StringRef Identifier, DIE &RefDie,
- DICompositeType CTy) {
+ const MDCompositeType *CTy) {
// Fast path if we're building some type units and one has already used the
// address pool we know we're going to throw away all this work anyway, so
// don't bother building dependent types.
// This is inefficient because all the dependent types will be rebuilt
// from scratch, including building them in type units, discovering that
// they depend on addresses, throwing them out and rebuilding them.
- CU.constructTypeDIE(RefDie, CTy);
+ CU.constructTypeDIE(RefDie, cast<MDCompositeType>(CTy));
return;
}