+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>
PR sanitize/81530
{
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);
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
{
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, "<unnamed type decl>");
}
{
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);
|| 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);
}