QualType Ty = CGM.getContext().getEnumType(ED);
void *TyPtr = Ty.getAsOpaquePtr();
auto I = TypeCache.find(TyPtr);
- if (I == TypeCache.end() ||
- !llvm::DIType(cast<llvm::MDType>(I->second)).isForwardDecl())
+ if (I == TypeCache.end() || !cast<llvm::MDType>(I->second)->isForwardDecl())
return;
llvm::DIType Res = CreateTypeDefinition(Ty->castAs<EnumType>());
- assert(!Res.isForwardDecl());
+ assert(!Res->isForwardDecl());
TypeCache[TyPtr].reset(Res);
}
QualType Ty = CGM.getContext().getRecordType(RD);
llvm::DIType T = getTypeOrNull(Ty);
- if (T && T.isForwardDecl())
+ if (T && T->isForwardDecl())
completeClassData(RD);
}
QualType Ty = CGM.getContext().getRecordType(RD);
void *TyPtr = Ty.getAsOpaquePtr();
auto I = TypeCache.find(TyPtr);
- if (I != TypeCache.end() &&
- !llvm::DIType(cast<llvm::MDType>(I->second)).isForwardDecl())
+ if (I != TypeCache.end() && !cast<llvm::MDType>(I->second)->isForwardDecl())
return;
llvm::DIType Res = CreateTypeDefinition(Ty->castAs<RecordType>());
- assert(!Res.isForwardDecl());
+ assert(!Res->isForwardDecl());
TypeCache[TyPtr].reset(Res);
}
if (FwdDecl->isTemporary())
FwdDecl = llvm::MDNode::replaceWithPermanent(
- llvm::TempMDCompositeTypeBase(FwdDecl.get()));
+ llvm::TempMDCompositeTypeBase(FwdDecl));
RegionMap[Ty->getDecl()].reset(FwdDecl);
return FwdDecl;
llvm::DIFile Unit) {
QualType QTy(Ty, 0);
- llvm::DICompositeType T =
- cast_or_null<llvm::MDCompositeTypeBase>(getTypeOrNull(QTy));
+ auto *T = cast_or_null<llvm::MDCompositeTypeBase>(getTypeOrNull(QTy));
// We may have cached a forward decl when we could have created
// a non-forward decl. Go ahead and create a non-forward decl
// now.
- if (T && !T.isForwardDecl())
+ if (T && !T->isForwardDecl())
return T;
// Otherwise create the type.
// Propagate members from the declaration to the definition
// CreateType(const RecordType*) will overwrite this with the members in the
// correct order if the full type is needed.
- DBuilder.replaceArrays(Res, T ? T.getElements() : llvm::DIArray());
+ DBuilder.replaceArrays(Res, T ? T->getElements() : llvm::DIArray());
// And update the type cache.
TypeCache[QTy.getAsOpaquePtr()].reset(Res);
// If we ended up creating the type during the context chain construction,
// just return that.
- llvm::DICompositeType T = cast_or_null<llvm::MDCompositeTypeBase>(
+ auto *T = cast_or_null<llvm::MDCompositeTypeBase>(
getTypeOrNull(CGM.getContext().getRecordType(RD)));
- if (T && (!T.isForwardDecl() || !RD->getDefinition()))
+ if (T && (!T->isForwardDecl() || !RD->getDefinition()))
return T;
// If this is just a forward or incomplete declaration, construct an
Ty = getOrCreateType(QualType(ED->getTypeForDecl(), 0), Unit);
}
// Do not use DIGlobalVariable for enums.
- if (Ty.getTag() == llvm::dwarf::DW_TAG_enumeration_type)
+ if (Ty->getTag() == llvm::dwarf::DW_TAG_enumeration_type)
return;
// Do not emit separate definitions for function local const/statics.
if (isa<FunctionDecl>(VD->getDeclContext()))
for (auto p : ReplaceMap) {
assert(p.second);
- llvm::DIType Ty = cast<llvm::MDType>(p.second);
- assert(Ty.isForwardDecl());
+ auto *Ty = cast<llvm::MDType>(p.second);
+ assert(Ty->isForwardDecl());
auto it = TypeCache.find(p.first);
assert(it != TypeCache.end());