From 4ee55665cd812c311e90f1dd35e52dbe5ce3bb2e Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Mon, 17 Aug 2015 14:18:04 +0000 Subject: [PATCH] c-pretty-print.c (pp_c_cv_qualifiers): Remove code dealing with whitespaces before qualifier names. * c-pretty-print.c (pp_c_cv_qualifiers): Remove code dealing with whitespaces before qualifier names. From-SVN: r226939 --- gcc/c-family/ChangeLog | 5 +++++ gcc/c-family/c-pretty-print.c | 31 +++++-------------------------- 2 files changed, 10 insertions(+), 26 deletions(-) diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index c67c26ce772..86e421fc732 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,8 @@ +2015-08-17 Marek Polacek + + * c-pretty-print.c (pp_c_cv_qualifiers): Remove code dealing + with whitespaces before qualifier names. + 2015-08-12 Marek Polacek PR c++/55095 diff --git a/gcc/c-family/c-pretty-print.c b/gcc/c-family/c-pretty-print.c index 90f8c3dfd14..e2809cff35b 100644 --- a/gcc/c-family/c-pretty-print.c +++ b/gcc/c-family/c-pretty-print.c @@ -173,7 +173,6 @@ void pp_c_cv_qualifiers (c_pretty_printer *pp, int qualifiers, bool func_type) { const char *p = pp_last_position_in_text (pp); - bool previous = false; if (!qualifiers) return; @@ -185,34 +184,14 @@ pp_c_cv_qualifiers (c_pretty_printer *pp, int qualifiers, bool func_type) pp_c_whitespace (pp); if (qualifiers & TYPE_QUAL_ATOMIC) - { - pp_c_ws_string (pp, "_Atomic"); - previous = true; - } - + pp_c_ws_string (pp, "_Atomic"); if (qualifiers & TYPE_QUAL_CONST) - { - if (previous) - pp_c_whitespace (pp); - pp_c_ws_string (pp, func_type ? "__attribute__((const))" : "const"); - previous = true; - } - + pp_c_ws_string (pp, func_type ? "__attribute__((const))" : "const"); if (qualifiers & TYPE_QUAL_VOLATILE) - { - if (previous) - pp_c_whitespace (pp); - pp_c_ws_string (pp, func_type ? "__attribute__((noreturn))" : "volatile"); - previous = true; - } - + pp_c_ws_string (pp, func_type ? "__attribute__((noreturn))" : "volatile"); if (qualifiers & TYPE_QUAL_RESTRICT) - { - if (previous) - pp_c_whitespace (pp); - pp_c_ws_string (pp, (flag_isoc99 && !c_dialect_cxx () - ? "restrict" : "__restrict__")); - } + pp_c_ws_string (pp, (flag_isoc99 && !c_dialect_cxx () + ? "restrict" : "__restrict__")); } /* Pretty-print T using the type-cast notation '( type-name )'. */ -- 2.30.2