From: Eric Botcazou Date: Tue, 1 Aug 2017 20:50:00 +0000 (+0000) Subject: c-ada-spec.c (print_generic_ada_decl): Pass correctly-typed constant. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f4bcd9eb2ec8343dbcd8b1bb58ca483340ef492c;p=gcc.git c-ada-spec.c (print_generic_ada_decl): Pass correctly-typed constant. * c-ada-spec.c (print_generic_ada_decl): Pass correctly-typed constant. (dump_ada_function_declaration): Likewise. (dump_generic_ada_node): Likewise. (print_ada_declaration): Add support for const-qualified variables. From-SVN: r250797 --- diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 1b6d7cfb903..54c7d82c968 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,10 @@ +2017-08-01 Eric Botcazou + + * c-ada-spec.c (print_generic_ada_decl): Pass correctly-typed constant. + (dump_ada_function_declaration): Likewise. + (dump_generic_ada_node): Likewise. + (print_ada_declaration): Add support for const-qualified variables. + 2017-07-31 Martin Liska PR sanitize/81530 diff --git a/gcc/c-family/c-ada-spec.c b/gcc/c-family/c-ada-spec.c index de549501440..1f1c7e2f5d0 100644 --- a/gcc/c-family/c-ada-spec.c +++ b/gcc/c-family/c-ada-spec.c @@ -858,7 +858,7 @@ print_generic_ada_decl (pretty_printer *pp, tree decl, const char *source_file) { source_file_base = source_file; - if (print_ada_declaration (pp, decl, 0, INDENT_INCR)) + if (print_ada_declaration (pp, decl, NULL_TREE, INDENT_INCR)) { pp_newline (pp); pp_newline (pp); @@ -1655,7 +1655,8 @@ dump_ada_function_declaration (pretty_printer *buffer, tree func, if (DECL_NAME (arg)) { check_name (buffer, arg); - pp_ada_tree_identifier (buffer, DECL_NAME (arg), 0, false); + pp_ada_tree_identifier (buffer, DECL_NAME (arg), NULL_TREE, + false); pp_string (buffer, " : "); } else @@ -2096,7 +2097,7 @@ dump_generic_ada_node (pretty_printer *buffer, tree node, tree type, int spc, { if (DECL_NAME (node)) pp_ada_tree_identifier - (buffer, DECL_NAME (node), 0, limited_access); + (buffer, DECL_NAME (node), NULL_TREE, limited_access); else pp_string (buffer, ""); } @@ -3097,6 +3098,9 @@ print_ada_declaration (pretty_printer *buffer, tree t, tree type, int spc) { pp_string (buffer, "aliased "); + if (TREE_READONLY (t)) + pp_string (buffer, "constant "); + if (TYPE_NAME (TREE_TYPE (t))) dump_generic_ada_node (buffer, TREE_TYPE (t), t, spc, false, true); @@ -3110,6 +3114,9 @@ print_ada_declaration (pretty_printer *buffer, tree t, tree type, int spc) || TREE_CODE (TREE_TYPE (t)) != INTEGER_TYPE)) pp_string (buffer, "aliased "); + if (TREE_READONLY (t)) + pp_string (buffer, "constant "); + dump_generic_ada_node (buffer, TREE_TYPE (t), TREE_TYPE (t), spc, false, true); }