summaryrefslogtreecommitdiff
path: root/gdb/c-exp.y
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-07-19 15:33:20 +0000
committerTom Tromey <tromey@redhat.com>2012-07-19 15:33:20 +0000
commit191b2c6423e7d024ac1f8db321ba02da7dfa66fe (patch)
tree418779281446e1037b75cbed5d5b604f9f244595 /gdb/c-exp.y
parent4a92ec72fcee678854bdecf7c449ff47bfe3a1af (diff)
downloadgdb-191b2c6423e7d024ac1f8db321ba02da7dfa66fe.tar.gz
* ax-gdb.c (gen_expr): Handle UNOP_CAST_TYPE, UNOP_MEMVAL_TYPE.
* breakpoint.c (watchpoint_exp_is_const): Handle UNOP_CAST_TYPE, UNOP_REINTERPRET_CAST, UNOP_DYNAMIC_CAST. * c-exp.y (exp): Emit UNOP_MEMVAL_TYPE, UNOP_CAST_TYPE. Update for changes to UNOP_REINTERPRET_CAST, UNOP_DYNAMIC_CAST. Use type_exp production where appropriate. * eval.c (evaluate_subexp_standard) <UNOP_CAST_TYPE>: New case. <UNOP_DYNAMIC_CAST, UNOP_REINTERPRET_CAST>: Update. <UNOP_MEMVAL_TYPE>: New case. (evaluate_subexp_for_address) <UNOP_MEMVAL_TYPE>: New case. (evaluate_subexp_for_sizeof) <UNOP_MEMVAL_TYPE>: New case. * expprint.c (print_subexp_standard) <UNOP_CAST_TYPE>: New case. <UNOP_MEMVAL_TYPE>: New case. (dump_subexp_body_standard) <UNOP_DYNAMIC_CAST, UNOP_REINTERPRET_CAST>: Update. <UNOP_CAST_TYPE, UNOP_MEMVAL_TYPE>: New cases. * parse.c (operator_length_standard) <UNOP_DYNAMIC_CAST, UNOP_REINTERPRET_CAST>: Update. <UNOP_CAST_TYPE, UNOP_MEMVAL_TYPE>: New cases. * stack.c (return_command): Also check for UNOP_CAST_TYPE. * std-operator.def (UNOP_CAST_TYPE, UNOP_MEMVAL_TYPE): New constants.
Diffstat (limited to 'gdb/c-exp.y')
-rw-r--r--gdb/c-exp.y36
1 files changed, 12 insertions, 24 deletions
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index 0613799c27e..e36a0fb9685 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -471,16 +471,12 @@ exp : lcurly arglist rcurly %prec ARROW
write_exp_elt_opcode (OP_ARRAY); }
;
-exp : lcurly type rcurly exp %prec UNARY
- { write_exp_elt_opcode (UNOP_MEMVAL);
- write_exp_elt_type ($2);
- write_exp_elt_opcode (UNOP_MEMVAL); }
+exp : lcurly type_exp rcurly exp %prec UNARY
+ { write_exp_elt_opcode (UNOP_MEMVAL_TYPE); }
;
-exp : '(' type ')' exp %prec UNARY
- { write_exp_elt_opcode (UNOP_CAST);
- write_exp_elt_type ($2);
- write_exp_elt_opcode (UNOP_CAST); }
+exp : '(' type_exp ')' exp %prec UNARY
+ { write_exp_elt_opcode (UNOP_CAST_TYPE); }
;
exp : '(' exp1 ')'
@@ -639,30 +635,22 @@ exp : SIZEOF '(' type ')' %prec UNARY
write_exp_elt_opcode (OP_LONG); }
;
-exp : REINTERPRET_CAST '<' type '>' '(' exp ')' %prec UNARY
- { write_exp_elt_opcode (UNOP_REINTERPRET_CAST);
- write_exp_elt_type ($3);
- write_exp_elt_opcode (UNOP_REINTERPRET_CAST); }
+exp : REINTERPRET_CAST '<' type_exp '>' '(' exp ')' %prec UNARY
+ { write_exp_elt_opcode (UNOP_REINTERPRET_CAST); }
;
-exp : STATIC_CAST '<' type '>' '(' exp ')' %prec UNARY
- { write_exp_elt_opcode (UNOP_CAST);
- write_exp_elt_type ($3);
- write_exp_elt_opcode (UNOP_CAST); }
+exp : STATIC_CAST '<' type_exp '>' '(' exp ')' %prec UNARY
+ { write_exp_elt_opcode (UNOP_CAST_TYPE); }
;
-exp : DYNAMIC_CAST '<' type '>' '(' exp ')' %prec UNARY
- { write_exp_elt_opcode (UNOP_DYNAMIC_CAST);
- write_exp_elt_type ($3);
- write_exp_elt_opcode (UNOP_DYNAMIC_CAST); }
+exp : DYNAMIC_CAST '<' type_exp '>' '(' exp ')' %prec UNARY
+ { write_exp_elt_opcode (UNOP_DYNAMIC_CAST); }
;
-exp : CONST_CAST '<' type '>' '(' exp ')' %prec UNARY
+exp : CONST_CAST '<' type_exp '>' '(' exp ')' %prec UNARY
{ /* We could do more error checking here, but
it doesn't seem worthwhile. */
- write_exp_elt_opcode (UNOP_CAST);
- write_exp_elt_type ($3);
- write_exp_elt_opcode (UNOP_CAST); }
+ write_exp_elt_opcode (UNOP_CAST_TYPE); }
;
string_exp: