lang.opt (nostdlib): Move around.

* lang.opt (nostdlib): Move around.
	* misc.c (gnat_handle_option): Fix formatting.
	(gnat_dwarf_name): Move around.
	* trans.c (Case_Statement_to_gnu): Fix formatting.
	(gnat_to_gnu): Likewise.
	* utils.c (aggregate_type_contains_array_p): Likewise.
	(create_subprog_decl): Likewise.

From-SVN: r133035
This commit is contained in:
Eric Botcazou 2008-03-08 12:44:51 +00:00 committed by Eric Botcazou
parent 904e4b8d32
commit 7934d78179
7 changed files with 70 additions and 63 deletions

View File

@ -1,3 +1,13 @@
2008-03-08 Eric Botcazou <ebotcazou@adacore.com>
* lang.opt (nostdlib): Move around.
* misc.c (gnat_handle_option): Fix formatting.
(gnat_dwarf_name): Move around.
* trans.c (Case_Statement_to_gnu): Fix formatting.
(gnat_to_gnu): Likewise.
* utils.c (aggregate_type_contains_array_p): Likewise.
(create_subprog_decl): Likewise.
2008-03-08 Eric Botcazou <ebotcazou@adacore.com>
* decl.c (gnat_to_gnu_entity) <E_Signed_Integer_Subtype>: Do not

View File

@ -6,7 +6,7 @@
* *
* Specification *
* *
* Copyright (C) 1992-2004, 2007 Free Software Foundation, Inc. *
* Copyright (C) 1992-2007, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *

View File

@ -6,7 +6,7 @@
* *
* C Header File *
* *
* Copyright (C) 1992-2003 Free Software Foundation, Inc. *
* Copyright (C) 1992-2008, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@ -37,7 +37,7 @@
#define GCC_ADA_H
/* Inlined functions in header are preceded by INLINE, which is normally set
to extern inline for GCC, but may be set to static for use in standard
to extern inline for GCC, but may be set to static for use in standard
ANSI-C. */
#ifndef INLINE
@ -58,10 +58,10 @@
#define CAT(A,B) ECHO(A)B
#endif
/* The following macro definition simulates the effect of a declaration of
/* The following macro definition simulates the effect of a declaration of
a subtype, where the first two parameters give the name of the type and
subtype, and the third and fourth parameters give the subtype range. The
effect is to compile a typedef defining the subtype as a synonym for the
effect is to compile a typedef defining the subtype as a synonym for the
type, together with two constants defining the end points. */
#define SUBTYPE(SUBTYPE,TYPE,FIRST,LAST) \
@ -70,7 +70,7 @@
CAT (SUBTYPE,__Last) = LAST };
/* The following definitions provide the equivalent of the Ada IN and NOT IN
operators, assuming that the subtype involved has been defined using the
operators, assuming that the subtype involved has been defined using the
SUBTYPE macro defined above. */
#define IN(VALUE,SUBTYPE) \

View File

@ -69,16 +69,16 @@ nostdinc
Ada RejectNegative
; Don't look for source files
nostdlib
Ada
; Don't look for object files
feliminate-unused-debug-types
Ada
; Effect documented for C - intercepted for Ada to force the associated flag
; not to be set by default, as it currently eliminates unreferenced parallel
; types we need for encoding descriptions to the debugger.
nostdlib
Ada
; Don't look for object files
fRTS=
Ada Joined RejectNegative
; Selects the runtime

View File

@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
* Copyright (C) 1992-2007, Free Software Foundation, Inc. *
* Copyright (C) 1992-2008, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@ -126,7 +126,7 @@ static tree gnat_type_max_size (const_tree);
#undef LANG_HOOKS_PUSHDECL
#define LANG_HOOKS_PUSHDECL gnat_return_tree
#undef LANG_HOOKS_WRITE_GLOBALS
#define LANG_HOOKS_WRITE_GLOBALS gnat_write_global_declarations
#define LANG_HOOKS_WRITE_GLOBALS gnat_write_global_declarations
#undef LANG_HOOKS_FINISH_INCOMPLETE_DECL
#define LANG_HOOKS_FINISH_INCOMPLETE_DECL gnat_finish_incomplete_decl
#undef LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS
@ -303,9 +303,9 @@ gnat_handle_option (size_t scode, const char *arg, int value)
case OPT_feliminate_unused_debug_types:
/* We arrange for post_option to be able to only set the corresponding
flag to 1 when explicitely requested by the user. We expect the
default flag value to be either 0 or positive, and expose a positive
-f as a negative value to post_option. */
flag to 1 when explicitely requested by the user. We expect the
default flag value to be either 0 or positive, and expose a positive
-f as a negative value to post_option. */
flag_eliminate_unused_debug_types = -value;
break;
@ -527,7 +527,6 @@ gnat_init_gcc_eh (void)
marked as "cannot trap" if the flag is not set (see emit_libcall_block).
We should not let this be since it is possible for such calls to actually
raise in Ada. */
flag_exceptions = 1;
flag_non_call_exceptions = 1;
@ -614,6 +613,14 @@ gnat_print_type (FILE *file, tree node, int indent)
}
}
static const char *
gnat_dwarf_name (tree t, int verbosity ATTRIBUTE_UNUSED)
{
gcc_assert (DECL_P (t));
return (const char *) IDENTIFIER_POINTER (DECL_NAME (t));
}
static const char *
gnat_printable_name (tree decl, int verbosity)
{
@ -631,14 +638,6 @@ gnat_printable_name (tree decl, int verbosity)
return (const char *) ada_name;
}
static const char *
gnat_dwarf_name (tree t, int verbosity ATTRIBUTE_UNUSED)
{
gcc_assert (DECL_P (t));
return (const char *) IDENTIFIER_POINTER (DECL_NAME (t));
}
/* Expands GNAT-specific GCC tree nodes. The only ones we support
here are and NULL_EXPR. */

View File

@ -1527,33 +1527,31 @@ Case_Statement_to_gnu (Node_Id gnat_node)
gcc_unreachable ();
}
/* If the case value is a subtype that raises Constraint_Error at
run-time because of a wrong bound, then gnu_low or gnu_high
is not translated into an INTEGER_CST. In such a case, we need
to ensure that the when statement is not added in the tree,
otherwise it will crash the gimplifier. */
if ((!gnu_low || TREE_CODE (gnu_low) == INTEGER_CST)
&& (!gnu_high || TREE_CODE (gnu_high) == INTEGER_CST))
{
add_stmt_with_node (build3 (CASE_LABEL_EXPR, void_type_node,
gnu_low, gnu_high,
create_artificial_label ()),
gnat_choice);
choices_added++;
}
/* If the case value is a subtype that raises Constraint_Error at
run-time because of a wrong bound, then gnu_low or gnu_high is
not transtaleted into an INTEGER_CST. In such a case, we need
to ensure that the when statement is not added in the tree,
otherwise it will crash the gimplifier. */
if ((!gnu_low || TREE_CODE (gnu_low) == INTEGER_CST)
&& (!gnu_high || TREE_CODE (gnu_high) == INTEGER_CST))
{
add_stmt_with_node (build3 (CASE_LABEL_EXPR, void_type_node,
gnu_low, gnu_high,
create_artificial_label ()),
gnat_choice);
choices_added++;
}
}
/* Push a binding level here in case variables are declared since we want
them to be local to this set of statements instead of the block
containing the Case statement. */
if (choices_added > 0)
{
add_stmt (build_stmt_group (Statements (gnat_when), true));
add_stmt (build1 (GOTO_EXPR, void_type_node,
TREE_VALUE (gnu_switch_label_stack)));
}
/* Push a binding level here in case variables are declared as we want
them to be local to this set of statements instead of to the block
containing the Case statement. */
if (choices_added > 0)
{
add_stmt (build_stmt_group (Statements (gnat_when), true));
add_stmt (build1 (GOTO_EXPR, void_type_node,
TREE_VALUE (gnu_switch_label_stack)));
}
}
/* Now emit a definition of the label all the cases branched to. */
@ -4244,7 +4242,7 @@ gnat_to_gnu (Node_Id gnat_node)
for (gnat_temp
= First_Formal_With_Extras
(Defining_Entity (Specification (gnat_node)));
(Defining_Entity (Specification (gnat_node)));
Present (gnat_temp);
gnat_temp = Next_Formal_With_Extras (gnat_temp))
if (Is_Itype (Etype (gnat_temp))
@ -6299,7 +6297,7 @@ assoc_to_constructor (Entity_Id gnat_entity, Node_Id gnat_assoc, tree gnu_type)
{
tree gnu_field;
/* Verify every enty in GNU_LIST was used. */
/* Verify every entry in GNU_LIST was used. */
for (gnu_field = gnu_list; gnu_field; gnu_field = TREE_CHAIN (gnu_field))
gcc_assert (TREE_ADDRESSABLE (gnu_field));
}

View File

@ -1554,7 +1554,7 @@ aggregate_type_contains_array_p (tree type)
case ARRAY_TYPE:
return true;
default:
gcc_unreachable ();
}
@ -1932,18 +1932,18 @@ create_subprog_decl (tree subprog_name, tree asm_name,
DECL_ARTIFICIAL (DECL_RESULT (subprog_decl)) = 1;
DECL_IGNORED_P (DECL_RESULT (subprog_decl)) = 1;
/* TREE_ADDRESSABLE is set on the result type to request the use of the
target by-reference return mechanism. This is not supported all the
way down to RTL expansion with GCC 4, which ICEs on temporary creation
attempts with such a type and expects DECL_BY_REFERENCE to be set on
the RESULT_DECL instead - see gnat_genericize for more details. */
if (TREE_ADDRESSABLE (TREE_TYPE (DECL_RESULT (subprog_decl))))
{
tree result_decl = DECL_RESULT (subprog_decl);
/* TREE_ADDRESSABLE is set on the result type to request the use of the
target by-reference return mechanism. This is not supported all the
way down to RTL expansion with GCC 4, which ICEs on temporary creation
attempts with such a type and expects DECL_BY_REFERENCE to be set on
the RESULT_DECL instead - see gnat_genericize for more details. */
if (TREE_ADDRESSABLE (TREE_TYPE (DECL_RESULT (subprog_decl))))
{
tree result_decl = DECL_RESULT (subprog_decl);
TREE_ADDRESSABLE (TREE_TYPE (result_decl)) = 0;
DECL_BY_REFERENCE (result_decl) = 1;
}
TREE_ADDRESSABLE (TREE_TYPE (result_decl)) = 0;
DECL_BY_REFERENCE (result_decl) = 1;
}
if (inline_flag)
DECL_DECLARED_INLINE_P (subprog_decl) = 1;