summaryrefslogtreecommitdiff
path: root/src/shared/cplusplus
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/cplusplus')
-rw-r--r--src/shared/cplusplus/AST.cpp22
-rw-r--r--src/shared/cplusplus/AST.h16
-rw-r--r--src/shared/cplusplus/ASTVisit.cpp8
-rw-r--r--src/shared/cplusplus/ASTfwd.h2
-rw-r--r--src/shared/cplusplus/CheckDeclarator.cpp2
-rw-r--r--src/shared/cplusplus/Parser.cpp4
6 files changed, 4 insertions, 50 deletions
diff --git a/src/shared/cplusplus/AST.cpp b/src/shared/cplusplus/AST.cpp
index 4d7deaafd8..ccab8122b6 100644
--- a/src/shared/cplusplus/AST.cpp
+++ b/src/shared/cplusplus/AST.cpp
@@ -2155,28 +2155,6 @@ unsigned ObjCMessageArgumentDeclarationAST::lastToken() const
return 0;
}
-unsigned ObjCMessageArgumentDeclarationListAST::firstToken() const
-{
- if (argument_declaration)
- return argument_declaration->firstToken();
- else if (next)
- return next->firstToken();
- else
- // ### Assert?
- return 0;
-}
-
-unsigned ObjCMessageArgumentDeclarationListAST::lastToken() const
-{
- for (const ObjCMessageArgumentDeclarationListAST *it = this; it; it = it->next) {
- if (! it->next && it->argument_declaration) {
- return it->argument_declaration->lastToken();
- }
- }
- // ### assert?
- return 0;
-}
-
unsigned ObjCMethodPrototypeAST::firstToken() const
{
return method_type_token;
diff --git a/src/shared/cplusplus/AST.h b/src/shared/cplusplus/AST.h
index c46fca5a50..fc884741db 100644
--- a/src/shared/cplusplus/AST.h
+++ b/src/shared/cplusplus/AST.h
@@ -2445,22 +2445,6 @@ protected:
virtual void accept0(ASTVisitor *visitor);
};
-class CPLUSPLUS_EXPORT ObjCMessageArgumentDeclarationListAST: public AST
-{
-public:
- ObjCMessageArgumentDeclarationAST *argument_declaration;
- ObjCMessageArgumentDeclarationListAST *next;
-
-public:
- virtual ObjCMessageArgumentDeclarationListAST *asObjCMessageArgumentDeclarationList() { return this; }
-
- virtual unsigned firstToken() const;
- virtual unsigned lastToken() const;
-
-protected:
- virtual void accept0(ASTVisitor *visitor);
-};
-
class CPLUSPLUS_EXPORT ObjCMethodPrototypeAST: public AST
{
public:
diff --git a/src/shared/cplusplus/ASTVisit.cpp b/src/shared/cplusplus/ASTVisit.cpp
index ff1a76b5cf..b6d1815197 100644
--- a/src/shared/cplusplus/ASTVisit.cpp
+++ b/src/shared/cplusplus/ASTVisit.cpp
@@ -1069,14 +1069,6 @@ void ObjCMessageArgumentDeclarationAST::accept0(ASTVisitor *visitor)
visitor->endVisit(this);
}
-void ObjCMessageArgumentDeclarationListAST::accept0(ASTVisitor *visitor)
-{
- if (visitor->visit(this)) {
- accept(argument_declaration, visitor);
- }
- visitor->endVisit(this);
-}
-
void ObjCMethodPrototypeAST::accept0(ASTVisitor *visitor)
{
if (visitor->visit(this)) {
diff --git a/src/shared/cplusplus/ASTfwd.h b/src/shared/cplusplus/ASTfwd.h
index dc453748be..7db518e87d 100644
--- a/src/shared/cplusplus/ASTfwd.h
+++ b/src/shared/cplusplus/ASTfwd.h
@@ -131,7 +131,6 @@ class ObjCFastEnumerationAST;
class ObjCInstanceVariablesDeclarationAST;
class ObjCMessageArgumentAST;
class ObjCMessageArgumentDeclarationAST;
-class ObjCMessageArgumentDeclarationListAST;
class ObjCMessageExpressionAST;
class ObjCMethodDeclarationAST;
class ObjCMethodPrototypeAST;
@@ -201,6 +200,7 @@ typedef List<NameAST *> ObjCIdentifierListAST;
typedef List<ObjCMessageArgumentAST *> ObjCMessageArgumentListAST;
typedef List<ObjCSelectorArgumentAST *> ObjCSelectorArgumentListAST;
typedef List<ObjCPropertyAttributeAST *> ObjCPropertyAttributeListAST;
+typedef List<ObjCMessageArgumentDeclarationAST *> ObjCMessageArgumentDeclarationListAST;
typedef ExpressionListAST TemplateArgumentListAST;
diff --git a/src/shared/cplusplus/CheckDeclarator.cpp b/src/shared/cplusplus/CheckDeclarator.cpp
index 6fd9245875..f89f796fe4 100644
--- a/src/shared/cplusplus/CheckDeclarator.cpp
+++ b/src/shared/cplusplus/CheckDeclarator.cpp
@@ -267,7 +267,7 @@ bool CheckDeclarator::visit(ObjCMethodPrototypeAST *ast)
if (ast->selector && ast->selector->asObjCSelectorWithArguments()) {
// TODO: add arguments (EV)
for (ObjCMessageArgumentDeclarationListAST *it = ast->arguments; it; it = it->next) {
- ObjCMessageArgumentDeclarationAST *argDecl = it->argument_declaration;
+ ObjCMessageArgumentDeclarationAST *argDecl = it->value;
semantic()->check(argDecl, method->arguments());
}
diff --git a/src/shared/cplusplus/Parser.cpp b/src/shared/cplusplus/Parser.cpp
index 4f31a9e07d..cec6388eee 100644
--- a/src/shared/cplusplus/Parser.cpp
+++ b/src/shared/cplusplus/Parser.cpp
@@ -4899,7 +4899,7 @@ bool Parser::parseObjCMethodPrototype(ObjCMethodPrototypeAST *&node)
sel->selector_arguments->value = argument;
ast->arguments = new (_pool) ObjCMessageArgumentDeclarationListAST;
- ast->arguments->argument_declaration = declaration;
+ ast->arguments->value = declaration;
ObjCMessageArgumentDeclarationListAST *lastArg = ast->arguments;
while (parseObjCKeywordDeclaration(argument, declaration)) {
@@ -4909,7 +4909,7 @@ bool Parser::parseObjCMethodPrototype(ObjCMethodPrototypeAST *&node)
lastArg->next = new (_pool) ObjCMessageArgumentDeclarationListAST;
lastArg = lastArg->next;
- lastArg->argument_declaration = declaration;
+ lastArg->value = declaration;
}
while (LA() == T_COMMA) {