From: Patrick Palka Date: Thu, 17 Dec 2015 03:46:27 +0000 (+0000) Subject: Avoid code duplication in cp_tree_[operand|code]_length X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5fdfa03e795034058a66f641eb9d1f4499052639;p=gcc.git 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 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1ffa6eb0e76..91bc456399f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2015-12-16 Patrick Palka + + * tree.c (cp_tree_operand_length): Define in terms of + cp_tree_code_length. + 2015-12-16 Martin Sebor PR objc++/68932 diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 0c0987df0f6..ae176d00f6d 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -4427,23 +4427,10 @@ cp_tree_operand_length (const_tree t) { enum tree_code code = TREE_CODE (t); - switch (code) - { - case PREINCREMENT_EXPR: - case PREDECREMENT_EXPR: - case POSTINCREMENT_EXPR: - case POSTDECREMENT_EXPR: - return 1; + if (TREE_CODE_CLASS (code) == tcc_vl_exp) + return VL_EXP_OPERAND_LENGTH (t); - case ARRAY_REF: - return 2; - - case EXPR_PACK_EXPANSION: - return 1; - - default: - return TREE_OPERAND_LENGTH (t); - } + return cp_tree_code_length (code); } /* Like cp_tree_operand_length, but takes a tree_code CODE. */