This patch instantiates objects for forward protocols and in general handles use of
protocols referenced in @protocol declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42191 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/Decl.cpp b/AST/Decl.cpp
index 4b330ee..bde4b6b 100644
--- a/AST/Decl.cpp
+++ b/AST/Decl.cpp
@@ -29,6 +29,7 @@
static unsigned nClassDecls = 0;
static unsigned nMethodDecls = 0;
static unsigned nProtocolDecls = 0;
+static unsigned nForwardProtocolDecls = 0;
static unsigned nCategoryDecls = 0;
static unsigned nIvarDecls = 0;
@@ -59,6 +60,8 @@
return "ObjcProtoMethod";
case ObjcProtocol:
return "ObjcProtocol";
+ case ObjcForwardProtocol:
+ return "ObjcForwardProtocol";
case Struct:
return "Struct";
case Union:
@@ -122,6 +125,9 @@
fprintf(stderr, " %d protocol decls, %d each (%d bytes)\n",
nProtocolDecls, (int)sizeof(ObjcProtocolDecl),
int(nProtocolDecls*sizeof(ObjcProtocolDecl)));
+ fprintf(stderr, " %d forward protocol decls, %d each (%d bytes)\n",
+ nForwardProtocolDecls, (int)sizeof(ObjcForwardProtocolDecl),
+ int(nForwardProtocolDecls*sizeof(ObjcForwardProtocolDecl)));
fprintf(stderr, " %d category decls, %d each (%d bytes)\n",
nCategoryDecls, (int)sizeof(ObjcCategoryDecl),
int(nCategoryDecls*sizeof(ObjcCategoryDecl)));
@@ -178,6 +184,9 @@
case ObjcProtocol:
nProtocolDecls++;
break;
+ case ObjcForwardProtocol:
+ nForwardProtocolDecls++;
+ break;
case ObjcCategory:
nCategoryDecls++;
break;