Commit 5fdfa03e by Patrick Palka

Avoid code duplication in cp_tree_[operand|code]_length

gcc/cp/ChangeLog:

	* tree.c (cp_tree_operand_length): Define in terms of
	cp_tree_code_length.

From-SVN: r231735
parent a2f325f9
2015-12-16 Patrick Palka <ppalka@gcc.gnu.org>
* tree.c (cp_tree_operand_length): Define in terms of
cp_tree_code_length.
2015-12-16 Martin Sebor <msebor@redhat.com> 2015-12-16 Martin Sebor <msebor@redhat.com>
PR objc++/68932 PR objc++/68932
......
...@@ -4427,23 +4427,10 @@ cp_tree_operand_length (const_tree t) ...@@ -4427,23 +4427,10 @@ cp_tree_operand_length (const_tree t)
{ {
enum tree_code code = TREE_CODE (t); enum tree_code code = TREE_CODE (t);
switch (code) if (TREE_CODE_CLASS (code) == tcc_vl_exp)
{ return VL_EXP_OPERAND_LENGTH (t);
case PREINCREMENT_EXPR:
case PREDECREMENT_EXPR:
case POSTINCREMENT_EXPR:
case POSTDECREMENT_EXPR:
return 1;
case ARRAY_REF: return cp_tree_code_length (code);
return 2;
case EXPR_PACK_EXPANSION:
return 1;
default:
return TREE_OPERAND_LENGTH (t);
}
} }
/* Like cp_tree_operand_length, but takes a tree_code CODE. */ /* Like cp_tree_operand_length, but takes a tree_code CODE. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment