forked from OSchip/llvm-project
Don't crash if the AST doesn't have a sensible ObjC id type.
llvm-svn: 130500
This commit is contained in:
parent
6708499b6d
commit
10d2ded910
|
@ -688,11 +688,13 @@ CGObjCGNU::CGObjCGNU(CodeGenModule &cgm, unsigned runtimeABIVersion,
|
|||
PtrTy = PtrToInt8Ty;
|
||||
|
||||
// Object type
|
||||
ASTIdTy = CGM.getContext().getCanonicalType(CGM.getContext().getObjCIdType());
|
||||
if (QualType() == ASTIdTy) {
|
||||
IdTy = PtrToInt8Ty;
|
||||
} else {
|
||||
QualType UnqualIdTy = CGM.getContext().getObjCIdType();
|
||||
ASTIdTy = CanQualType();
|
||||
if (UnqualIdTy != QualType()) {
|
||||
ASTIdTy = CGM.getContext().getCanonicalType(UnqualIdTy);
|
||||
IdTy = cast<llvm::PointerType>(CGM.getTypes().ConvertType(ASTIdTy));
|
||||
} else {
|
||||
IdTy = PtrToInt8Ty;
|
||||
}
|
||||
PtrToIdTy = llvm::PointerType::getUnqual(IdTy);
|
||||
|
||||
|
|
Loading…
Reference in New Issue