aboutsummaryrefslogtreecommitdiff
path: root/Sema/Sema.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Sema/Sema.cpp')
-rw-r--r--Sema/Sema.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Sema/Sema.cpp b/Sema/Sema.cpp
index 9487ed01ac..330d9dce74 100644
--- a/Sema/Sema.cpp
+++ b/Sema/Sema.cpp
@@ -31,17 +31,18 @@ void Sema::ActOnTranslationUnitScope(SourceLocation Loc, Scope *S) {
/// For now, we will *not* install id as a built-in. FIXME: reconsider this.
QualType Sema::GetObjcIdType(SourceLocation Loc) {
assert(TUScope && "GetObjcIdType(): Top-level scope is null");
- if (!ObjcIdTypedef) {
+ if (Context.getObjcIdType().isNull()) {
IdentifierInfo *IdIdent = &Context.Idents.get("id");
ScopedDecl *IdDecl = LookupScopedDecl(IdIdent, Decl::IDNS_Ordinary,
SourceLocation(), TUScope);
- ObjcIdTypedef = dyn_cast_or_null<TypedefDecl>(IdDecl);
+ TypedefDecl *ObjcIdTypedef = dyn_cast_or_null<TypedefDecl>(IdDecl);
if (!ObjcIdTypedef) {
Diag(Loc, diag::err_missing_id_definition);
return QualType();
}
+ Context.setObjcIdType(ObjcIdTypedef);
}
- return Context.getTypedefType(ObjcIdTypedef);
+ return Context.getObjcIdType();
}
@@ -64,7 +65,6 @@ Sema::Sema(Preprocessor &pp, ASTContext &ctxt, std::vector<Decl*> &prevInGroup)
KnownFunctionIDs[ id_vprintf ] = &IT.get("vprintf");
TUScope = 0;
- ObjcIdTypedef = 0;
}
void Sema::DeleteExpr(ExprTy *E) {