diff options
Diffstat (limited to 'lib/CodeGen/CGExprScalar.cpp')
-rw-r--r-- | lib/CodeGen/CGExprScalar.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index 3b9db6a4bb..d6cc16c10a 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/lib/CodeGen/CGExprScalar.cpp @@ -688,11 +688,9 @@ ScalarExprEmitter::VisitSizeOfAlignOfExpr(const SizeOfAlignOfExpr *E) { } if (TypeToSize->isObjCInterfaceType()) { ObjCInterfaceDecl *OI = TypeToSize->getAsObjCInterfaceType()->getDecl(); - const RecordDecl *RD = CGF.getContext().addRecordToClass(OI); - const Type *Key = - CGF.getContext().getTagDeclType( - const_cast<TagDecl*>(dyn_cast<TagDecl>(RD))).getTypePtr(); - TypeToSize = QualType(Key->getAsRecordType(), 0); + RecordDecl *RD = const_cast<RecordDecl*>( + CGF.getContext().addRecordToClass(OI)); + TypeToSize = CGF.getContext().getTagDeclType(static_cast<TagDecl*>(RD)); } std::pair<uint64_t, unsigned> Info = CGF.getContext().getTypeInfo(TypeToSize); |