changeset 28256:3241ede9806c stable

delete obsolete and unused tree_return_list class (bug #58279) * pt-misc.h, pt-misc.cc (tree_return_list): Delete class. * pt-walk.h, pt-walk.cc (tree_walker::visit_return_list): Delete unused function from base tree_walker class (no tree_return_list objects are created by the parser so this function can never be called). * cdef-class.cc, pt-bp.cc, pt-bp.h, pt-eval.cc, pt-eval.h, pt-jit.cc, pt-jit.h,pt-pr-code.cc, pt-pr-code.h: Delete all visit_return_list functions in classes derived from tree_walker.
author John W. Eaton <jwe@octave.org>
date Thu, 30 Apr 2020 23:51:30 -0400
parents 3d6c5eb54515
children ae94e3fad6d4
files libinterp/octave-value/cdef-class.cc libinterp/parse-tree/pt-bp.cc libinterp/parse-tree/pt-bp.h libinterp/parse-tree/pt-eval.cc libinterp/parse-tree/pt-eval.h libinterp/parse-tree/pt-jit.cc libinterp/parse-tree/pt-jit.h libinterp/parse-tree/pt-misc.cc libinterp/parse-tree/pt-misc.h libinterp/parse-tree/pt-pr-code.cc libinterp/parse-tree/pt-pr-code.h libinterp/parse-tree/pt-walk.cc libinterp/parse-tree/pt-walk.h
diffstat 13 files changed, 0 insertions(+), 100 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/octave-value/cdef-class.cc	Wed Apr 29 22:08:43 2020 +0200
+++ b/libinterp/octave-value/cdef-class.cc	Thu Apr 30 23:51:30 2020 -0400
@@ -198,7 +198,6 @@
     void visit_postfix_expression (tree_postfix_expression&) { }
     void visit_prefix_expression (tree_prefix_expression&) { }
     void visit_return_command (tree_return_command&) { }
-    void visit_return_list (tree_return_list&) { }
     void visit_try_catch_command (tree_try_catch_command&) { }
     void visit_unwind_protect_command (tree_unwind_protect_command&) { }
     void visit_while_command (tree_while_command&) { }
--- a/libinterp/parse-tree/pt-bp.cc	Wed Apr 29 22:08:43 2020 +0200
+++ b/libinterp/parse-tree/pt-bp.cc	Thu Apr 30 23:51:30 2020 -0400
@@ -267,12 +267,6 @@
   }
 
   void
-  tree_breakpoint::visit_return_list (tree_return_list&)
-  {
-    panic_impossible ();
-  }
-
-  void
   tree_breakpoint::visit_simple_assignment (tree_simple_assignment&)
   {
     panic_impossible ();
--- a/libinterp/parse-tree/pt-bp.h	Wed Apr 29 22:08:43 2020 +0200
+++ b/libinterp/parse-tree/pt-bp.h	Thu Apr 30 23:51:30 2020 -0400
@@ -119,8 +119,6 @@
 
     void visit_return_command (tree_return_command&);
 
-    void visit_return_list (tree_return_list&);
-
     void visit_simple_assignment (tree_simple_assignment&);
 
     void visit_statement (tree_statement&);
--- a/libinterp/parse-tree/pt-eval.cc	Wed Apr 29 22:08:43 2020 +0200
+++ b/libinterp/parse-tree/pt-eval.cc	Thu Apr 30 23:51:30 2020 -0400
@@ -2709,12 +2709,6 @@
   }
 
   void
-  tree_evaluator::visit_return_list (tree_return_list&)
-  {
-    panic_impossible ();
-  }
-
-  void
   tree_evaluator::visit_simple_assignment (tree_simple_assignment&)
   {
     panic_impossible ();
--- a/libinterp/parse-tree/pt-eval.h	Wed Apr 29 22:08:43 2020 +0200
+++ b/libinterp/parse-tree/pt-eval.h	Thu Apr 30 23:51:30 2020 -0400
@@ -250,8 +250,6 @@
 
     void visit_return_command (tree_return_command&);
 
-    void visit_return_list (tree_return_list&);
-
     void visit_simple_assignment (tree_simple_assignment&);
 
     void visit_statement (tree_statement&);
--- a/libinterp/parse-tree/pt-jit.cc	Wed Apr 29 22:08:43 2020 +0200
+++ b/libinterp/parse-tree/pt-jit.cc	Thu Apr 30 23:51:30 2020 -0400
@@ -776,12 +776,6 @@
   }
 
   void
-  jit_convert::visit_return_list (tree_return_list&)
-  {
-    throw jit_fail_exception ("No visit_return_list implementation");
-  }
-
-  void
   jit_convert::visit_simple_assignment (tree_simple_assignment& tsa)
   {
     tree_expression *rhs = tsa.right_hand_side ();
--- a/libinterp/parse-tree/pt-jit.h	Wed Apr 29 22:08:43 2020 +0200
+++ b/libinterp/parse-tree/pt-jit.h	Thu Apr 30 23:51:30 2020 -0400
@@ -142,8 +142,6 @@
 
     void visit_return_command (tree_return_command&);
 
-    void visit_return_list (tree_return_list&);
-
     void visit_simple_assignment (tree_simple_assignment&);
 
     void visit_statement (tree_statement&);
--- a/libinterp/parse-tree/pt-misc.cc	Wed Apr 29 22:08:43 2020 +0200
+++ b/libinterp/parse-tree/pt-misc.cc	Thu Apr 30 23:51:30 2020 -0400
@@ -74,16 +74,4 @@
 
     return new_list;
   }
-
-  // Return lists.
-
-  tree_return_list::~tree_return_list (void)
-  {
-    while (! empty ())
-      {
-        auto p = begin ();
-        delete *p;
-        erase (p);
-      }
-  }
 }
--- a/libinterp/parse-tree/pt-misc.h	Wed Apr 29 22:08:43 2020 +0200
+++ b/libinterp/parse-tree/pt-misc.h	Thu Apr 30 23:51:30 2020 -0400
@@ -92,37 +92,11 @@
 
     int m_marked_for_varargs;
   };
-
-  // Return lists.  Used to hold the right hand sides of multiple
-  // assignment expressions.
-
-  class tree_return_list : public base_list<tree_index_expression *>
-  {
-  public:
-
-    tree_return_list (void) { }
-
-    tree_return_list (tree_index_expression *t) { append (t); }
-
-    // No copying!
-
-    tree_return_list (const tree_return_list&) = delete;
-
-    tree_return_list& operator = (const tree_return_list&) = delete;
-
-    ~tree_return_list (void);
-
-    void accept (tree_walker& tw)
-    {
-      tw.visit_return_list (*this);
-    }
-  };
 }
 
 #if defined (OCTAVE_USE_DEPRECATED_FUNCTIONS)
 
 // tree_parameter_list is derived from a template.
-// tree_return_list is derived from a template.
 
 #endif
 
--- a/libinterp/parse-tree/pt-pr-code.cc	Wed Apr 29 22:08:43 2020 +0200
+++ b/libinterp/parse-tree/pt-pr-code.cc	Thu Apr 30 23:51:30 2020 -0400
@@ -799,25 +799,6 @@
   }
 
   void
-  tree_print_code::visit_return_list (tree_return_list& lst)
-  {
-    auto p = lst.begin ();
-
-    while (p != lst.end ())
-      {
-        tree_index_expression *elt = *p++;
-
-        if (elt)
-          {
-            elt->accept (*this);
-
-            if (p != lst.end ())
-              m_os << ", ";
-          }
-      }
-  }
-
-  void
   tree_print_code::visit_simple_assignment (tree_simple_assignment& expr)
   {
     indent ();
--- a/libinterp/parse-tree/pt-pr-code.h	Wed Apr 29 22:08:43 2020 +0200
+++ b/libinterp/parse-tree/pt-pr-code.h	Thu Apr 30 23:51:30 2020 -0400
@@ -128,8 +128,6 @@
 
     void visit_return_command (tree_return_command&);
 
-    void visit_return_list (tree_return_list&);
-
     void visit_simple_assignment (tree_simple_assignment&);
 
     void visit_statement (tree_statement&);
--- a/libinterp/parse-tree/pt-walk.cc	Wed Apr 29 22:08:43 2020 +0200
+++ b/libinterp/parse-tree/pt-walk.cc	Thu Apr 30 23:51:30 2020 -0400
@@ -386,19 +386,6 @@
     // Nothing to do.
   }
 
-  void tree_walker::visit_return_list (tree_return_list& lst)
-  {
-    auto p = lst.begin ();
-
-    while (p != lst.end ())
-      {
-        tree_index_expression *elt = *p++;
-
-        if (elt)
-          elt->accept (*this);
-      }
-  }
-
   void tree_walker::visit_simple_assignment (tree_simple_assignment& expr)
   {
     tree_expression *lhs = expr.left_hand_side ();
--- a/libinterp/parse-tree/pt-walk.h	Wed Apr 29 22:08:43 2020 +0200
+++ b/libinterp/parse-tree/pt-walk.h	Thu Apr 30 23:51:30 2020 -0400
@@ -72,7 +72,6 @@
   class tree_postfix_expression;
   class tree_prefix_expression;
   class tree_return_command;
-  class tree_return_list;
   class tree_simple_assignment;
   class tree_statement;
   class tree_statement_list;
@@ -185,8 +184,6 @@
 
     virtual void visit_return_command (tree_return_command&);
 
-    virtual void visit_return_list (tree_return_list&);
-
     virtual void visit_simple_assignment (tree_simple_assignment&);
 
     virtual void visit_statement (tree_statement&);