Minor simplification for r161534.

llvm-svn: 161544
This commit is contained in:
Eli Friedman 2012-08-08 23:53:27 +00:00
parent 990ab1d213
commit 934dbbfa11
3 changed files with 6 additions and 9 deletions

View File

@ -1560,7 +1560,7 @@ private:
Decl *TagDecl);
struct FieldCallback {
virtual Decl *invoke(ParsingFieldDeclarator &Field) = 0;
virtual void invoke(ParsingFieldDeclarator &Field) = 0;
virtual ~FieldCallback() {}
private:

View File

@ -2891,14 +2891,13 @@ void Parser::ParseStructUnionBody(SourceLocation RecordLoc,
SmallVectorImpl<Decl *> &FieldDecls) :
P(P), TagDecl(TagDecl), FieldDecls(FieldDecls) {}
virtual Decl *invoke(ParsingFieldDeclarator &FD) {
void invoke(ParsingFieldDeclarator &FD) {
// Install the declarator into the current TagDecl.
Decl *Field = P.Actions.ActOnField(P.getCurScope(), TagDecl,
FD.D.getDeclSpec().getSourceRange().getBegin(),
FD.D, FD.BitfieldSize);
FieldDecls.push_back(Field);
FD.complete(Field);
return Field;
}
} Callback(*this, TagDecl, FieldDecls);

View File

@ -308,16 +308,16 @@ public:
MethodImplKind(MethodImplKind) {
}
Decl *invoke(ParsingFieldDeclarator &FD) {
void invoke(ParsingFieldDeclarator &FD) {
if (FD.D.getIdentifier() == 0) {
P.Diag(AtLoc, diag::err_objc_property_requires_field_name)
<< FD.D.getSourceRange();
return 0;
return;
}
if (FD.BitfieldSize) {
P.Diag(AtLoc, diag::err_objc_property_bitfield)
<< FD.D.getSourceRange();
return 0;
return;
}
// Install the property declarator into interfaceDecl.
@ -345,7 +345,6 @@ public:
Props.push_back(Property);
FD.complete(Property);
return Property;
}
};
@ -1307,7 +1306,7 @@ void Parser::ParseObjCClassInstanceVariables(Decl *interfaceDecl,
P(P), IDecl(IDecl), visibility(V), AllIvarDecls(AllIvarDecls) {
}
Decl *invoke(ParsingFieldDeclarator &FD) {
void invoke(ParsingFieldDeclarator &FD) {
P.Actions.ActOnObjCContainerStartDefinition(IDecl);
// Install the declarator into the interface decl.
Decl *Field
@ -1318,7 +1317,6 @@ void Parser::ParseObjCClassInstanceVariables(Decl *interfaceDecl,
if (Field)
AllIvarDecls.push_back(Field);
FD.complete(Field);
return Field;
}
} Callback(*this, interfaceDecl, visibility, AllIvarDecls);