DefinitionData *Data;
- bool InitiallyForwardDecl : 1;
- bool isForwardProtoDecl : 1; // declared with @protocol.
-
SourceLocation EndLoc; // marks the '>' or identifier.
DefinitionData &data() const {
ObjCProtocolDecl(DeclContext *DC, IdentifierInfo *Id,
SourceLocation nameLoc, SourceLocation atStartLoc,
- ObjCProtocolDecl *PrevDecl,
- bool isForwardDecl);
+ ObjCProtocolDecl *PrevDecl);
void allocateDefinitionData();
IdentifierInfo *Id,
SourceLocation nameLoc,
SourceLocation atStartLoc,
- ObjCProtocolDecl *PrevDecl,
- bool isForwardDecl);
+ ObjCProtocolDecl *PrevDecl);
const ObjCProtocolList &getReferencedProtocols() const {
assert(hasDefinition() && "No definition available!");
/// \brief Starts the definition of this Objective-C protocol.
void startDefinition();
- /// \brief True if it was initially a forward reference.
- /// Differs with \see isForwardDecl in that \see isForwardDecl will change to
- /// false when we see the definition, but this will remain true.
- bool isInitiallyForwardDecl() const { return InitiallyForwardDecl; }
-
// Location information, modeled after the Stmt API.
SourceLocation getLocStart() const { return getAtStartLoc(); } // '@'protocol
SourceLocation getLocEnd() const { return EndLoc; }
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);
}
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)
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;
}
// 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) {
// Create the new declaration.
PDecl = ObjCProtocolDecl::Create(Context, CurContext, ProtocolName,
ProtocolLoc, AtProtoInterfaceLoc,
- /*PrevDecl=*/PrevDecl,
- /*isForwardDecl=*/false);
+ /*PrevDecl=*/PrevDecl);
PushOnScopeChains(PDecl, TUScope);
PDecl->startDefinition();
ObjCProtocolDecl *PDecl
= ObjCProtocolDecl::Create(Context, CurContext, Ident,
IdentList[i].second, AtProtocolLoc,
- PrevDecl, /*isForwardDecl=*/true);
+ PrevDecl);
PushOnScopeChains(PDecl, TUScope);
CheckObjCDeclScope(PDecl);
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
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(),
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();
ObjCProtocolDeclInfo(const ObjCProtocolDecl *D)
: ObjCContainerDeclInfo(Info_ObjCProtocol,
/*isForwardRef=*/false,
- /*isRedeclaration=*/D->isInitiallyForwardDecl(),
+ /*isRedeclaration=*/D->getPreviousDeclaration(),
/*isImplementation=*/false) { }
static bool classof(const DeclInfo *D) {