From 86a8812beb9b122c37e474810dbf43567d727cac Mon Sep 17 00:00:00 2001
From: Roberto Raggi <roberto.raggi@nokia.com>
Date: Tue, 10 Nov 2009 12:49:49 +0100
Subject: [PATCH] Removed ObjCSynthesizedPropertyAST Done with Erik Verbruggen

---
 src/shared/cplusplus/AST.cpp      | 19 -------------------
 src/shared/cplusplus/AST.h        | 16 ----------------
 src/shared/cplusplus/ASTVisit.cpp |  8 --------
 src/shared/cplusplus/ASTfwd.h     |  2 +-
 src/shared/cplusplus/Parser.cpp   | 16 ++++++++--------
 5 files changed, 9 insertions(+), 52 deletions(-)

diff --git a/src/shared/cplusplus/AST.cpp b/src/shared/cplusplus/AST.cpp
index ccab8122b6f..0ef6f91f4a3 100644
--- a/src/shared/cplusplus/AST.cpp
+++ b/src/shared/cplusplus/AST.cpp
@@ -2207,25 +2207,6 @@ unsigned ObjCSynthesizedPropertyAST::lastToken() const
         return property_identifier + 1;
 }
 
-unsigned ObjCSynthesizedPropertyListAST::firstToken() const
-{
-    if (synthesized_property)
-        return synthesized_property->firstToken();
-    // ### assert?
-    return 0;
-}
-
-unsigned ObjCSynthesizedPropertyListAST::lastToken() const
-{
-    for (const ObjCSynthesizedPropertyListAST *it = this; it; it = it->next) {
-        if (! it->next && it->synthesized_property) {
-            return it->synthesized_property->lastToken();
-        }
-    }
-    // ### assert?
-    return 0;
-}
-
 unsigned ObjCSynthesizedPropertiesDeclarationAST::firstToken() const
 {
     return synthesized_token;
diff --git a/src/shared/cplusplus/AST.h b/src/shared/cplusplus/AST.h
index fc884741db9..da2c9d1fae6 100644
--- a/src/shared/cplusplus/AST.h
+++ b/src/shared/cplusplus/AST.h
@@ -2502,22 +2502,6 @@ protected:
     virtual void accept0(ASTVisitor *visitor);
 };
 
-class CPLUSPLUS_EXPORT ObjCSynthesizedPropertyListAST: public AST
-{
-public:
-    ObjCSynthesizedPropertyAST *synthesized_property;
-    ObjCSynthesizedPropertyListAST *next;
-
-public:
-    virtual ObjCSynthesizedPropertyListAST *asObjCSynthesizedPropertyList() { return this; }
-
-    virtual unsigned firstToken() const;
-    virtual unsigned lastToken() const;
-
-protected:
-    virtual void accept0(ASTVisitor *visitor);
-};
-
 class CPLUSPLUS_EXPORT ObjCSynthesizedPropertiesDeclarationAST: public DeclarationAST
 {
 public:
diff --git a/src/shared/cplusplus/ASTVisit.cpp b/src/shared/cplusplus/ASTVisit.cpp
index b6d18151973..aea713c4c75 100644
--- a/src/shared/cplusplus/ASTVisit.cpp
+++ b/src/shared/cplusplus/ASTVisit.cpp
@@ -1098,14 +1098,6 @@ void ObjCSynthesizedPropertyAST::accept0(ASTVisitor *visitor)
     visitor->endVisit(this);
 }
 
-void ObjCSynthesizedPropertyListAST::accept0(ASTVisitor *visitor)
-{
-    if (visitor->visit(this)) {
-        accept(synthesized_property, visitor);
-    }
-    visitor->endVisit(this);
-}
-
 void ObjCSynthesizedPropertiesDeclarationAST::accept0(ASTVisitor *visitor)
 {
     if (visitor->visit(this)) {
diff --git a/src/shared/cplusplus/ASTfwd.h b/src/shared/cplusplus/ASTfwd.h
index 7db518e87df..d38aafc128c 100644
--- a/src/shared/cplusplus/ASTfwd.h
+++ b/src/shared/cplusplus/ASTfwd.h
@@ -148,7 +148,6 @@ class ObjCSelectorWithoutArgumentsAST;
 class ObjCSynchronizedStatementAST;
 class ObjCSynthesizedPropertiesDeclarationAST;
 class ObjCSynthesizedPropertyAST;
-class ObjCSynthesizedPropertyListAST;
 class ObjCTypeNameAST;
 class ObjCVisibilityDeclarationAST;
 class OperatorAST;
@@ -201,6 +200,7 @@ typedef List<ObjCMessageArgumentAST *> ObjCMessageArgumentListAST;
 typedef List<ObjCSelectorArgumentAST *> ObjCSelectorArgumentListAST;
 typedef List<ObjCPropertyAttributeAST *> ObjCPropertyAttributeListAST;
 typedef List<ObjCMessageArgumentDeclarationAST *> ObjCMessageArgumentDeclarationListAST;
+typedef List<ObjCSynthesizedPropertyAST *> ObjCSynthesizedPropertyListAST;
 
 typedef ExpressionListAST TemplateArgumentListAST;
 
diff --git a/src/shared/cplusplus/Parser.cpp b/src/shared/cplusplus/Parser.cpp
index cec6388eeef..40581cc9e91 100644
--- a/src/shared/cplusplus/Parser.cpp
+++ b/src/shared/cplusplus/Parser.cpp
@@ -4577,13 +4577,13 @@ bool Parser::parseObjCMethodDefinitionList(DeclarationListAST *&node)
             ast->synthesized_token = consumeToken();
             ObjCSynthesizedPropertyListAST *last = new (_pool) ObjCSynthesizedPropertyListAST;
             ast->property_identifiers = last;
-            last->synthesized_property = new (_pool) ObjCSynthesizedPropertyAST;
-            match(T_IDENTIFIER, &(last->synthesized_property->property_identifier));
+            last->value = new (_pool) ObjCSynthesizedPropertyAST;
+            match(T_IDENTIFIER, &(last->value->property_identifier));
 
             if (LA() == T_EQUAL) {
-                last->synthesized_property->equals_token = consumeToken();
+                last->value->equals_token = consumeToken();
 
-                match(T_IDENTIFIER, &(last->synthesized_property->property_alias_identifier));
+                match(T_IDENTIFIER, &(last->value->property_alias_identifier));
             }
 
             while (LA() == T_COMMA) {
@@ -4592,13 +4592,13 @@ bool Parser::parseObjCMethodDefinitionList(DeclarationListAST *&node)
                 last->next = new (_pool) ObjCSynthesizedPropertyListAST;
                 last = last->next;
 
-                last->synthesized_property = new (_pool) ObjCSynthesizedPropertyAST;
-                match(T_IDENTIFIER, &(last->synthesized_property->property_identifier));
+                last->value = new (_pool) ObjCSynthesizedPropertyAST;
+                match(T_IDENTIFIER, &(last->value->property_identifier));
 
                 if (LA() == T_EQUAL) {
-                    last->synthesized_property->equals_token = consumeToken();
+                    last->value->equals_token = consumeToken();
 
-                    match(T_IDENTIFIER, &(last->synthesized_property->property_alias_identifier));
+                    match(T_IDENTIFIER, &(last->value->property_alias_identifier));
                 }
             }
 
-- 
GitLab