diff options
Diffstat (limited to 'AST/ASTContext.cpp')
-rw-r--r-- | AST/ASTContext.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/AST/ASTContext.cpp b/AST/ASTContext.cpp index f26105f55a..93446824b1 100644 --- a/AST/ASTContext.cpp +++ b/AST/ASTContext.cpp @@ -146,6 +146,10 @@ void ASTContext::InitBuiltinTypes() { FloatComplexTy = getComplexType(FloatTy); DoubleComplexTy = getComplexType(DoubleTy); LongDoubleComplexTy = getComplexType(LongDoubleTy); + + BuiltinVaListType = QualType(); + ObjcIdType = QualType(); + IdStructType = 0; } //===----------------------------------------------------------------------===// @@ -837,3 +841,17 @@ void ASTContext::setBuiltinVaListType(QualType T) BuiltinVaListType = T; } +void ASTContext::setObjcIdType(TypedefDecl *TD) +{ + assert(ObjcIdType.isNull() && "'id' type already set!"); + + ObjcIdType = getTypedefType(TD); + + // typedef struct objc_object *id; + const PointerType *ptr = TD->getUnderlyingType()->getAsPointerType(); + assert(ptr && "'id' incorrectly typed"); + const RecordType *rec = ptr->getPointeeType()->getAsStructureType(); + assert(rec && "'id' incorrectly typed"); + IdStructType = rec; +} + |