summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTReader.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-01-17 18:09:05 +0000
committerDouglas Gregor <dgregor@apple.com>2012-01-17 18:09:05 +0000
commitd53ae83516a1005f91e111ce309e17bfac540637 (patch)
tree5e89604c271ee44842663eb7947de3a07b2d0a21 /clang/lib/Serialization/ASTReader.cpp
parent41b9ddeb7ab6e4e7166379c2518bd59edb4676ec (diff)
downloadbcm5719-llvm-d53ae83516a1005f91e111ce309e17bfac540637.tar.gz
bcm5719-llvm-d53ae83516a1005f91e111ce309e17bfac540637.zip
Delay the creation of the built-in Objective-C class 'Protocol' by
moving it from a "special type" to a predefined declaration, as we do for id, Class, and SEL. llvm-svn: 148313
Diffstat (limited to 'clang/lib/Serialization/ASTReader.cpp')
-rw-r--r--clang/lib/Serialization/ASTReader.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp
index ab6a2512e30..57cd0212b3c 100644
--- a/clang/lib/Serialization/ASTReader.cpp
+++ b/clang/lib/Serialization/ASTReader.cpp
@@ -2813,17 +2813,12 @@ void ASTReader::InitializeContext() {
// built-in types. Right now, we just ignore the problem.
// Load the special types.
- if (SpecialTypes.size() > NumSpecialTypeIDs) {
+ if (SpecialTypes.size() >= NumSpecialTypeIDs) {
if (Context.getBuiltinVaListType().isNull()) {
Context.setBuiltinVaListType(
GetType(SpecialTypes[SPECIAL_TYPE_BUILTIN_VA_LIST]));
}
- if (unsigned Proto = SpecialTypes[SPECIAL_TYPE_OBJC_PROTOCOL]) {
- if (Context.ObjCProtoType.isNull())
- Context.ObjCProtoType = GetType(Proto);
- }
-
if (unsigned String = SpecialTypes[SPECIAL_TYPE_CF_CONSTANT_STRING]) {
if (!Context.CFConstantStringTypeDecl)
Context.setCFConstantStringType(GetType(String));
@@ -4584,6 +4579,9 @@ Decl *ASTReader::GetDecl(DeclID ID) {
case PREDEF_DECL_OBJC_CLASS_ID:
return Context.getObjCClassDecl();
+ case PREDEF_DECL_OBJC_PROTOCOL_ID:
+ return Context.getObjCProtocolDecl();
+
case PREDEF_DECL_INT_128_ID:
return Context.getInt128Decl();
OpenPOWER on IntegriCloud