Have parser reset the innermost block tracker
[binutils-gdb.git] / gdb / parser-defs.h
index 195264f48a6aa9b6a21defa14f86e20272555116..26e0a836c11fb5b409fee3ec906e6192dfa9f4cd 100644 (file)
@@ -23,7 +23,7 @@
 #if !defined (PARSER_DEFS_H)
 #define PARSER_DEFS_H 1
 
-#include "vec.h"
+#include "common/vec.h"
 #include "expression.h"
 
 struct block;
@@ -48,7 +48,7 @@ struct parser_state
 
   /* Resize the allocated expression to the correct size, and return
      it as an expression_up -- passing ownership to the caller.  */
-  expression_up release ();
+  ATTRIBUTE_UNUSED_RESULT expression_up release ();
 
   /* The size of the expression above.  */
 
@@ -75,24 +75,6 @@ extern const struct block *expression_context_block;
    then look up the macro definitions active at that point.  */
 extern CORE_ADDR expression_context_pc;
 
-/* While parsing expressions we need to track the innermost lexical block
-   that we encounter.  In some situations we need to track the innermost
-   block just for symbols, and in other situations we want to track the
-   innermost block for symbols and registers.  These flags are used by the
-   innermost block tracker to control which blocks we consider for the
-   innermost block.  These flags can be combined together as needed.  */
-
-enum innermost_block_tracker_type
-{
-  /* Track the innermost block for symbols within an expression.  */
-  INNERMOST_BLOCK_FOR_SYMBOLS = (1 << 0),
-
-  /* Track the innermost block for registers within an expression.  */
-  INNERMOST_BLOCK_FOR_REGISTERS = (1 << 1)
-};
-DEF_ENUM_FLAGS_TYPE (enum innermost_block_tracker_type,
-                    innermost_block_tracker_types);
-
 /* When parsing expressions we track the innermost block that was
    referenced.  */
 
@@ -146,8 +128,9 @@ private:
 };
 
 /* The innermost context required by the stack and register variables
-   we've encountered so far.  This should be cleared before parsing an
-   expression, and queried once the parse is complete.  */
+   we've encountered so far.  This is cleared by the expression
+   parsing functions before parsing an expression, and can queried
+   once the parse is complete.  */
 extern innermost_block_tracker innermost_block;
 
 /* Number of arguments seen so far in innermost function call.  */
@@ -200,9 +183,6 @@ struct objc_class_str
     int theclass;
   };
 
-typedef struct type *type_ptr;
-DEF_VEC_P (type_ptr);
-
 /* For parsing of complicated types.
    An array should be preceded in the list by the size of the array.  */
 enum type_pieces
@@ -217,7 +197,8 @@ enum type_pieces
     tp_const, 
     tp_volatile, 
     tp_space_identifier,
-    tp_type_stack
+    tp_type_stack,
+    tp_kind
   };
 /* The stack can contain either an enum type_pieces or an int.  */
 union type_stack_elt
@@ -225,7 +206,7 @@ union type_stack_elt
     enum type_pieces piece;
     int int_val;
     struct type_stack *stack_val;
-    VEC (type_ptr) *typelist_val;
+    std::vector<struct type *> *typelist_val;
   };
 
 /* The type stack is an instance of this structure.  */
@@ -303,9 +284,7 @@ extern struct type_stack *append_type_stack (struct type_stack *to,
 
 extern void push_type_stack (struct type_stack *stack);
 
-extern void type_stack_cleanup (void *arg);
-
-extern void push_typelist (VEC (type_ptr) *typelist);
+extern void push_typelist (std::vector<struct type *> *typelist);
 
 extern int dump_subexp (struct expression *, struct ui_file *, int);