Eliminate the ForwardDecl/InitiallyForwardDecl bits from ObjCProtocolDecl. They are no longer needed
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147419 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/ASTImporter.cpp b/lib/AST/ASTImporter.cpp
index 6ee8ba3..82307e8 100644
--- a/lib/AST/ASTImporter.cpp
+++ b/lib/AST/ASTImporter.cpp
@@ -3123,8 +3123,7 @@
ToProto = ObjCProtocolDecl::Create(Importer.getToContext(), DC,
Name.getAsIdentifierInfo(), Loc,
Importer.Import(D->getAtStartLoc()),
- /*PrevDecl=*/0,
- D->isInitiallyForwardDecl());
+ /*PrevDecl=*/0);
ToProto->setLexicalDeclContext(LexicalDC);
LexicalDC->addDeclInternal(ToProto);
}
diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp
index aabea04..59bfdc6 100644
--- a/lib/AST/DeclObjC.cpp
+++ b/lib/AST/DeclObjC.cpp
@@ -970,12 +970,8 @@
ObjCProtocolDecl::ObjCProtocolDecl(DeclContext *DC, IdentifierInfo *Id,
SourceLocation nameLoc,
SourceLocation atStartLoc,
- ObjCProtocolDecl *PrevDecl,
- bool isForwardDecl)
- : ObjCContainerDecl(ObjCProtocol, DC, Id, nameLoc, atStartLoc),
- Data(0),
- InitiallyForwardDecl(isForwardDecl),
- isForwardProtoDecl(isForwardDecl)
+ ObjCProtocolDecl *PrevDecl)
+ : ObjCContainerDecl(ObjCProtocol, DC, Id, nameLoc, atStartLoc), Data()
{
setPreviousDeclaration(PrevDecl);
if (PrevDecl)
@@ -986,11 +982,9 @@
IdentifierInfo *Id,
SourceLocation nameLoc,
SourceLocation atStartLoc,
- ObjCProtocolDecl *PrevDecl,
- bool isForwardDecl) {
+ ObjCProtocolDecl *PrevDecl) {
ObjCProtocolDecl *Result
- = new (C) ObjCProtocolDecl(DC, Id, nameLoc, atStartLoc, PrevDecl,
- isForwardDecl);
+ = new (C) ObjCProtocolDecl(DC, Id, nameLoc, atStartLoc, PrevDecl);
return Result;
}
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index 51d282a..e769711 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -583,8 +583,7 @@
// FIXME: Can we turn this into an error?
PDecl = ObjCProtocolDecl::Create(Context, CurContext, ProtocolName,
ProtocolLoc, AtProtoInterfaceLoc,
- /*PrevDecl=*/0,
- /*isForwardDecl=*/false);
+ /*PrevDecl=*/0);
PDecl->startDefinition();
} else {
if (PrevDecl) {
@@ -599,8 +598,7 @@
// Create the new declaration.
PDecl = ObjCProtocolDecl::Create(Context, CurContext, ProtocolName,
ProtocolLoc, AtProtoInterfaceLoc,
- /*PrevDecl=*/PrevDecl,
- /*isForwardDecl=*/false);
+ /*PrevDecl=*/PrevDecl);
PushOnScopeChains(PDecl, TUScope);
PDecl->startDefinition();
@@ -707,7 +705,7 @@
ObjCProtocolDecl *PDecl
= ObjCProtocolDecl::Create(Context, CurContext, Ident,
IdentList[i].second, AtProtocolLoc,
- PrevDecl, /*isForwardDecl=*/true);
+ PrevDecl);
PushOnScopeChains(PDecl, TUScope);
CheckObjCDeclScope(PDecl);
diff --git a/lib/Serialization/ASTReaderDecl.cpp b/lib/Serialization/ASTReaderDecl.cpp
index 12436c5..46dcc87 100644
--- a/lib/Serialization/ASTReaderDecl.cpp
+++ b/lib/Serialization/ASTReaderDecl.cpp
@@ -764,8 +764,6 @@
RedeclarableResult Redecl = VisitRedeclarable(PD);
VisitObjCContainerDecl(PD);
- PD->InitiallyForwardDecl = Record[Idx++];
- PD->isForwardProtoDecl = Record[Idx++];
PD->setLocEnd(ReadSourceLocation(Record, Idx));
// Determine whether we need to merge this declaration with another @protocol
@@ -1976,7 +1974,7 @@
break;
case DECL_OBJC_PROTOCOL:
D = ObjCProtocolDecl::Create(Context, 0, 0, SourceLocation(),
- SourceLocation(), 0, false);
+ SourceLocation(), 0);
break;
case DECL_OBJC_AT_DEFS_FIELD:
D = ObjCAtDefsFieldDecl::Create(Context, 0, SourceLocation(),
diff --git a/lib/Serialization/ASTWriterDecl.cpp b/lib/Serialization/ASTWriterDecl.cpp
index b0c54e3..4701b8f 100644
--- a/lib/Serialization/ASTWriterDecl.cpp
+++ b/lib/Serialization/ASTWriterDecl.cpp
@@ -518,8 +518,6 @@
void ASTDeclWriter::VisitObjCProtocolDecl(ObjCProtocolDecl *D) {
VisitRedeclarable(D);
VisitObjCContainerDecl(D);
- Record.push_back(D->isInitiallyForwardDecl());
- Record.push_back(D->isForwardProtoDecl);
Writer.AddSourceLocation(D->getLocEnd(), Record);
ObjCProtocolDecl *Def = D->getDefinition();