Commit f4bcd9eb by Eric Botcazou Committed by Eric Botcazou

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
parent a2e28a97
2017-08-01 Eric Botcazou <ebotcazou@adacore.com>
* 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 <mliska@suse.cz> 2017-07-31 Martin Liska <mliska@suse.cz>
PR sanitize/81530 PR sanitize/81530
......
...@@ -858,7 +858,7 @@ print_generic_ada_decl (pretty_printer *pp, tree decl, const char *source_file) ...@@ -858,7 +858,7 @@ print_generic_ada_decl (pretty_printer *pp, tree decl, const char *source_file)
{ {
source_file_base = 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);
pp_newline (pp); pp_newline (pp);
...@@ -1655,7 +1655,8 @@ dump_ada_function_declaration (pretty_printer *buffer, tree func, ...@@ -1655,7 +1655,8 @@ dump_ada_function_declaration (pretty_printer *buffer, tree func,
if (DECL_NAME (arg)) if (DECL_NAME (arg))
{ {
check_name (buffer, 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, " : "); pp_string (buffer, " : ");
} }
else else
...@@ -2096,7 +2097,7 @@ dump_generic_ada_node (pretty_printer *buffer, tree node, tree type, int spc, ...@@ -2096,7 +2097,7 @@ dump_generic_ada_node (pretty_printer *buffer, tree node, tree type, int spc,
{ {
if (DECL_NAME (node)) if (DECL_NAME (node))
pp_ada_tree_identifier pp_ada_tree_identifier
(buffer, DECL_NAME (node), 0, limited_access); (buffer, DECL_NAME (node), NULL_TREE, limited_access);
else else
pp_string (buffer, "<unnamed type decl>"); pp_string (buffer, "<unnamed type decl>");
} }
...@@ -3097,6 +3098,9 @@ print_ada_declaration (pretty_printer *buffer, tree t, tree type, int spc) ...@@ -3097,6 +3098,9 @@ print_ada_declaration (pretty_printer *buffer, tree t, tree type, int spc)
{ {
pp_string (buffer, "aliased "); pp_string (buffer, "aliased ");
if (TREE_READONLY (t))
pp_string (buffer, "constant ");
if (TYPE_NAME (TREE_TYPE (t))) if (TYPE_NAME (TREE_TYPE (t)))
dump_generic_ada_node dump_generic_ada_node
(buffer, TREE_TYPE (t), t, spc, false, true); (buffer, TREE_TYPE (t), t, spc, false, true);
...@@ -3110,6 +3114,9 @@ print_ada_declaration (pretty_printer *buffer, tree t, tree type, int spc) ...@@ -3110,6 +3114,9 @@ print_ada_declaration (pretty_printer *buffer, tree t, tree type, int spc)
|| TREE_CODE (TREE_TYPE (t)) != INTEGER_TYPE)) || TREE_CODE (TREE_TYPE (t)) != INTEGER_TYPE))
pp_string (buffer, "aliased "); pp_string (buffer, "aliased ");
if (TREE_READONLY (t))
pp_string (buffer, "constant ");
dump_generic_ada_node dump_generic_ada_node
(buffer, TREE_TYPE (t), TREE_TYPE (t), spc, false, true); (buffer, TREE_TYPE (t), TREE_TYPE (t), spc, false, true);
} }
......
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