Remove Scope argument from ObjC actions that either don't need it or can now use TUScope.
Also improve a recently added comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42826 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Parse/MinimalAction.cpp b/Parse/MinimalAction.cpp
index 05b91da..932f8ff 100644
--- a/Parse/MinimalAction.cpp
+++ b/Parse/MinimalAction.cpp
@@ -68,7 +68,7 @@
}
Action::DeclTy *
-MinimalAction::ActOnStartClassInterface(Scope* S, SourceLocation AtInterafceLoc,
+MinimalAction::ActOnStartClassInterface(SourceLocation AtInterafceLoc,
IdentifierInfo *ClassName, SourceLocation ClassLoc,
IdentifierInfo *SuperName, SourceLocation SuperLoc,
IdentifierInfo **ProtocolNames, unsigned NumProtocols,
@@ -83,7 +83,7 @@
/// ActOnForwardClassDeclaration -
/// Scope will always be top level file scope.
Action::DeclTy *
-MinimalAction::ActOnForwardClassDeclaration(Scope *S, SourceLocation AtClassLoc,
+MinimalAction::ActOnForwardClassDeclaration(SourceLocation AtClassLoc,
IdentifierInfo **IdentList, unsigned NumElts) {
for (unsigned i = 0; i != NumElts; ++i) {
TypeNameInfo *TI =
@@ -92,7 +92,7 @@
IdentList[i]->setFETokenInfo(TI);
// Remember that this needs to be removed when the scope is popped.
- S->AddDecl(IdentList[i]);
+ TUScope->AddDecl(IdentList[i]);
}
return 0;
}
diff --git a/Parse/ParseDecl.cpp b/Parse/ParseDecl.cpp
index dcbbd89..00e441412 100644
--- a/Parse/ParseDecl.cpp
+++ b/Parse/ParseDecl.cpp
@@ -409,8 +409,7 @@
if (Tok.is(tok::less)) {
llvm::SmallVector<IdentifierInfo *, 8> ProtocolRefs;
ParseObjCProtocolReferences(ProtocolRefs);
- Actions.ActOnFindProtocolDeclaration(CurScope,
- Loc,
+ Actions.ActOnFindProtocolDeclaration(Loc,
&ProtocolRefs[0],
ProtocolRefs.size());
}
diff --git a/Parse/ParseObjc.cpp b/Parse/ParseObjc.cpp
index e3c5f72..464fad2 100644
--- a/Parse/ParseObjc.cpp
+++ b/Parse/ParseObjc.cpp
@@ -80,7 +80,7 @@
if (ExpectAndConsume(tok::semi, diag::err_expected_semi_after, "@class"))
return 0;
- return Actions.ActOnForwardClassDeclaration(CurScope, atLoc,
+ return Actions.ActOnForwardClassDeclaration(atLoc,
&ClassNames[0], ClassNames.size());
}
@@ -154,7 +154,7 @@
if (attrList) // categories don't support attributes.
Diag(Tok, diag::err_objc_no_attributes_on_category);
- DeclTy *CategoryType = Actions.ActOnStartCategoryInterface(CurScope, atLoc,
+ DeclTy *CategoryType = Actions.ActOnStartCategoryInterface(atLoc,
nameId, nameLoc, categoryId, categoryLoc,
&ProtocolRefs[0], ProtocolRefs.size());
@@ -187,7 +187,7 @@
if (ParseObjCProtocolReferences(ProtocolRefs))
return 0;
}
- DeclTy *ClsType = Actions.ActOnStartClassInterface(CurScope,
+ DeclTy *ClsType = Actions.ActOnStartClassInterface(
atLoc, nameId, nameLoc,
superClassId, superClassLoc, &ProtocolRefs[0],
ProtocolRefs.size(), attrList);
@@ -799,7 +799,7 @@
return 0;
}
if (ProtocolRefs.size() > 0)
- return Actions.ActOnForwardProtocolDeclaration(CurScope, AtLoc,
+ return Actions.ActOnForwardProtocolDeclaration(AtLoc,
&ProtocolRefs[0],
ProtocolRefs.size());
// Last, and definitely not least, parse a protocol declaration.
@@ -808,7 +808,7 @@
return 0;
}
- DeclTy *ProtoType = Actions.ActOnStartProtocolInterface(CurScope, AtLoc,
+ DeclTy *ProtoType = Actions.ActOnStartProtocolInterface(AtLoc,
protocolName, nameLoc,
&ProtocolRefs[0],
ProtocolRefs.size());
@@ -867,7 +867,7 @@
return 0;
}
rparenLoc = ConsumeParen();
- DeclTy *ImplCatType = Actions.ActOnStartCategoryImplementation(CurScope,
+ DeclTy *ImplCatType = Actions.ActOnStartCategoryImplementation(
atLoc, nameId, nameLoc, categoryId,
categoryLoc);
return ImplCatType;
@@ -885,7 +885,7 @@
superClassId = Tok.getIdentifierInfo();
superClassLoc = ConsumeToken(); // Consume super class name
}
- DeclTy *ImplClsType = Actions.ActOnStartClassImplementation(CurScope,
+ DeclTy *ImplClsType = Actions.ActOnStartClassImplementation(
atLoc, nameId, nameLoc,
superClassId, superClassLoc);