From: Jason Merrill Date: Wed, 30 Oct 2019 19:34:20 +0000 (-0400) Subject: * cxx-pretty-print.c (get_fold_operator): Use OVL_OP_INFO. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c766762429d045b575853539e019746fde6ef076;p=gcc.git * cxx-pretty-print.c (get_fold_operator): Use OVL_OP_INFO. From-SVN: r277637 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3a5e4a5e3e7..6808527d0f5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2019-10-30 Jason Merrill + + * cxx-pretty-print.c (get_fold_operator): Use OVL_OP_INFO. + 2019-10-30 Marek Polacek PR c++/92134 - constinit malfunction in static data member. diff --git a/gcc/cp/cxx-pretty-print.c b/gcc/cp/cxx-pretty-print.c index 2a129a3bff7..8ece11d276e 100644 --- a/gcc/cp/cxx-pretty-print.c +++ b/gcc/cp/cxx-pretty-print.c @@ -2551,52 +2551,8 @@ static char const* get_fold_operator (tree t) { int op = int_cst_value (FOLD_EXPR_OP (t)); - if (FOLD_EXPR_MODIFY_P (t)) - { - switch (op) - { - case NOP_EXPR: return "="; - case PLUS_EXPR: return "+="; - case MINUS_EXPR: return "-="; - case MULT_EXPR: return "*="; - case TRUNC_DIV_EXPR: return "/="; - case TRUNC_MOD_EXPR: return "%="; - case BIT_XOR_EXPR: return "^="; - case BIT_AND_EXPR: return "&="; - case BIT_IOR_EXPR: return "|="; - case LSHIFT_EXPR: return "<<="; - case RSHIFT_EXPR: return ">>="; - default: gcc_unreachable (); - } - } - else - { - switch (op) - { - case PLUS_EXPR: return "+"; - case MINUS_EXPR: return "-"; - case MULT_EXPR: return "*"; - case TRUNC_DIV_EXPR: return "/"; - case TRUNC_MOD_EXPR: return "%"; - case BIT_XOR_EXPR: return "^"; - case BIT_AND_EXPR: return "&"; - case BIT_IOR_EXPR: return "|"; - case LSHIFT_EXPR: return "<<"; - case RSHIFT_EXPR: return ">>"; - case EQ_EXPR: return "=="; - case NE_EXPR: return "!="; - case LT_EXPR: return "<"; - case GT_EXPR: return ">"; - case LE_EXPR: return "<="; - case GE_EXPR: return ">="; - case TRUTH_ANDIF_EXPR: return "&&"; - case TRUTH_ORIF_EXPR: return "||"; - case MEMBER_REF: return "->*"; - case DOTSTAR_EXPR: return ".*"; - case OFFSET_REF: return ".*"; - default: return ","; /* FIXME: Not the right default. */ - } - } + ovl_op_info_t *info = OVL_OP_INFO (FOLD_EXPR_MODIFY_P (t), op); + return info->name; } void