diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-08-12 05:46:01 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-08-12 05:46:01 +0000 |
commit | 3ea7269b54aefd674424cd89be5f17ea8e18d222 (patch) | |
tree | 7c12465cfda3fd11deb868868016a61f9b0d6baf /clang/lib/Serialization/ASTReader.cpp | |
parent | 1ec8114eb82162e8dc25eb3ff020bf0f3bf8b88b (diff) | |
download | bcm5719-llvm-3ea7269b54aefd674424cd89be5f17ea8e18d222.tar.gz bcm5719-llvm-3ea7269b54aefd674424cd89be5f17ea8e18d222.zip |
Move the creation of the predefined typedef for Objective-C's 'id'
type over into the AST context, then make that declaration a
predefined declaration in the AST format. This ensures that different
AST files will at least agree on the (global) declaration ID for 'id',
and eliminates one of the "special" types in the AST file format.
llvm-svn: 137429
Diffstat (limited to 'clang/lib/Serialization/ASTReader.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTReader.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index 43435b6754e..2e9e1bee684 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -2987,11 +2987,6 @@ void ASTReader::InitializeContext(ASTContext &Ctx) { GetType(SpecialTypes[SPECIAL_TYPE_BUILTIN_VA_LIST])); } - if (unsigned Id = SpecialTypes[SPECIAL_TYPE_OBJC_ID]) { - if (Context->ObjCIdTypedefType.isNull()) - Context->ObjCIdTypedefType = GetType(Id); - } - if (unsigned Sel = SpecialTypes[SPECIAL_TYPE_OBJC_SELECTOR]) { if (Context->ObjCSelTypedefType.isNull()) Context->ObjCSelTypedefType = GetType(Sel); @@ -4225,6 +4220,10 @@ Decl *ASTReader::GetDecl(DeclID ID) { case PREDEF_DECL_TRANSLATION_UNIT_ID: assert(Context && "No context available?"); return Context->getTranslationUnitDecl(); + + case PREDEF_DECL_OBJC_ID_ID: + assert(Context && "No context available?"); + return Context->getObjCIdDecl(); } return 0; |