Commit 7934d781 by Eric Botcazou Committed by Eric Botcazou

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
parent 904e4b8d
2008-03-08 Eric Botcazou <ebotcazou@adacore.com> 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 * decl.c (gnat_to_gnu_entity) <E_Signed_Integer_Subtype>: Do not
bother propagating the TYPE_USER_ALIGN flag when creating a JM type. bother propagating the TYPE_USER_ALIGN flag when creating a JM type.
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* * * *
* Specification * * 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 * * 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- * * terms of the GNU General Public License as published by the Free Soft- *
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* * * *
* C Header File * * 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 * * 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- * * terms of the GNU General Public License as published by the Free Soft- *
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#define GCC_ADA_H #define GCC_ADA_H
/* Inlined functions in header are preceded by INLINE, which is normally set /* 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. */ ANSI-C. */
#ifndef INLINE #ifndef INLINE
...@@ -58,10 +58,10 @@ ...@@ -58,10 +58,10 @@
#define CAT(A,B) ECHO(A)B #define CAT(A,B) ECHO(A)B
#endif #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 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 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. */ type, together with two constants defining the end points. */
#define SUBTYPE(SUBTYPE,TYPE,FIRST,LAST) \ #define SUBTYPE(SUBTYPE,TYPE,FIRST,LAST) \
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
CAT (SUBTYPE,__Last) = LAST }; CAT (SUBTYPE,__Last) = LAST };
/* The following definitions provide the equivalent of the Ada IN and NOT IN /* 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. */ SUBTYPE macro defined above. */
#define IN(VALUE,SUBTYPE) \ #define IN(VALUE,SUBTYPE) \
......
...@@ -69,16 +69,16 @@ nostdinc ...@@ -69,16 +69,16 @@ nostdinc
Ada RejectNegative Ada RejectNegative
; Don't look for source files ; Don't look for source files
nostdlib
Ada
; Don't look for object files
feliminate-unused-debug-types feliminate-unused-debug-types
Ada Ada
; Effect documented for C - intercepted for Ada to force the associated flag ; Effect documented for C - intercepted for Ada to force the associated flag
; not to be set by default, as it currently eliminates unreferenced parallel ; not to be set by default, as it currently eliminates unreferenced parallel
; types we need for encoding descriptions to the debugger. ; types we need for encoding descriptions to the debugger.
nostdlib
Ada
; Don't look for object files
fRTS= fRTS=
Ada Joined RejectNegative Ada Joined RejectNegative
; Selects the runtime ; Selects the runtime
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* * * *
* C Implementation File * * 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 * * 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- * * 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); ...@@ -126,7 +126,7 @@ static tree gnat_type_max_size (const_tree);
#undef LANG_HOOKS_PUSHDECL #undef LANG_HOOKS_PUSHDECL
#define LANG_HOOKS_PUSHDECL gnat_return_tree #define LANG_HOOKS_PUSHDECL gnat_return_tree
#undef LANG_HOOKS_WRITE_GLOBALS #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 #undef LANG_HOOKS_FINISH_INCOMPLETE_DECL
#define LANG_HOOKS_FINISH_INCOMPLETE_DECL gnat_finish_incomplete_decl #define LANG_HOOKS_FINISH_INCOMPLETE_DECL gnat_finish_incomplete_decl
#undef LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS #undef LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS
...@@ -303,9 +303,9 @@ gnat_handle_option (size_t scode, const char *arg, int value) ...@@ -303,9 +303,9 @@ gnat_handle_option (size_t scode, const char *arg, int value)
case OPT_feliminate_unused_debug_types: case OPT_feliminate_unused_debug_types:
/* We arrange for post_option to be able to only set the corresponding /* 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 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 default flag value to be either 0 or positive, and expose a positive
-f as a negative value to post_option. */ -f as a negative value to post_option. */
flag_eliminate_unused_debug_types = -value; flag_eliminate_unused_debug_types = -value;
break; break;
...@@ -527,7 +527,6 @@ gnat_init_gcc_eh (void) ...@@ -527,7 +527,6 @@ gnat_init_gcc_eh (void)
marked as "cannot trap" if the flag is not set (see emit_libcall_block). 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 We should not let this be since it is possible for such calls to actually
raise in Ada. */ raise in Ada. */
flag_exceptions = 1; flag_exceptions = 1;
flag_non_call_exceptions = 1; flag_non_call_exceptions = 1;
...@@ -615,6 +614,14 @@ gnat_print_type (FILE *file, tree node, int indent) ...@@ -615,6 +614,14 @@ gnat_print_type (FILE *file, tree node, int indent)
} }
static const char * 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) gnat_printable_name (tree decl, int verbosity)
{ {
const char *coded_name = IDENTIFIER_POINTER (DECL_NAME (decl)); const char *coded_name = IDENTIFIER_POINTER (DECL_NAME (decl));
...@@ -631,14 +638,6 @@ gnat_printable_name (tree decl, int verbosity) ...@@ -631,14 +638,6 @@ gnat_printable_name (tree decl, int verbosity)
return (const char *) ada_name; 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 /* Expands GNAT-specific GCC tree nodes. The only ones we support
here are and NULL_EXPR. */ here are and NULL_EXPR. */
......
...@@ -1527,33 +1527,31 @@ Case_Statement_to_gnu (Node_Id gnat_node) ...@@ -1527,33 +1527,31 @@ Case_Statement_to_gnu (Node_Id gnat_node)
gcc_unreachable (); gcc_unreachable ();
} }
/* If the case value is a subtype that raises Constraint_Error at /* 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 run-time because of a wrong bound, then gnu_low or gnu_high is
is not translated into an INTEGER_CST. In such a case, we need not transtaleted into an INTEGER_CST. In such a case, we need
to ensure that the when statement is not added in the tree, to ensure that the when statement is not added in the tree,
otherwise it will crash the gimplifier. */ otherwise it will crash the gimplifier. */
if ((!gnu_low || TREE_CODE (gnu_low) == INTEGER_CST) if ((!gnu_low || TREE_CODE (gnu_low) == INTEGER_CST)
&& (!gnu_high || TREE_CODE (gnu_high) == INTEGER_CST)) && (!gnu_high || TREE_CODE (gnu_high) == INTEGER_CST))
{ {
add_stmt_with_node (build3 (CASE_LABEL_EXPR, void_type_node,
add_stmt_with_node (build3 (CASE_LABEL_EXPR, void_type_node, gnu_low, gnu_high,
gnu_low, gnu_high, create_artificial_label ()),
create_artificial_label ()), gnat_choice);
gnat_choice); choices_added++;
choices_added++; }
}
} }
/* Push a binding level here in case variables are declared since we want /* Push a binding level here in case variables are declared as we want
them to be local to this set of statements instead of the block them to be local to this set of statements instead of to the block
containing the Case statement. */ containing the Case statement. */
if (choices_added > 0)
if (choices_added > 0) {
{ add_stmt (build_stmt_group (Statements (gnat_when), true));
add_stmt (build_stmt_group (Statements (gnat_when), true)); add_stmt (build1 (GOTO_EXPR, void_type_node,
add_stmt (build1 (GOTO_EXPR, void_type_node, TREE_VALUE (gnu_switch_label_stack)));
TREE_VALUE (gnu_switch_label_stack))); }
}
} }
/* Now emit a definition of the label all the cases branched to. */ /* Now emit a definition of the label all the cases branched to. */
...@@ -4244,7 +4242,7 @@ gnat_to_gnu (Node_Id gnat_node) ...@@ -4244,7 +4242,7 @@ gnat_to_gnu (Node_Id gnat_node)
for (gnat_temp for (gnat_temp
= First_Formal_With_Extras = First_Formal_With_Extras
(Defining_Entity (Specification (gnat_node))); (Defining_Entity (Specification (gnat_node)));
Present (gnat_temp); Present (gnat_temp);
gnat_temp = Next_Formal_With_Extras (gnat_temp)) gnat_temp = Next_Formal_With_Extras (gnat_temp))
if (Is_Itype (Etype (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) ...@@ -6299,7 +6297,7 @@ assoc_to_constructor (Entity_Id gnat_entity, Node_Id gnat_assoc, tree gnu_type)
{ {
tree gnu_field; 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)) for (gnu_field = gnu_list; gnu_field; gnu_field = TREE_CHAIN (gnu_field))
gcc_assert (TREE_ADDRESSABLE (gnu_field)); gcc_assert (TREE_ADDRESSABLE (gnu_field));
} }
......
...@@ -1554,7 +1554,7 @@ aggregate_type_contains_array_p (tree type) ...@@ -1554,7 +1554,7 @@ aggregate_type_contains_array_p (tree type)
case ARRAY_TYPE: case ARRAY_TYPE:
return true; return true;
default: default:
gcc_unreachable (); gcc_unreachable ();
} }
...@@ -1932,18 +1932,18 @@ create_subprog_decl (tree subprog_name, tree asm_name, ...@@ -1932,18 +1932,18 @@ create_subprog_decl (tree subprog_name, tree asm_name,
DECL_ARTIFICIAL (DECL_RESULT (subprog_decl)) = 1; DECL_ARTIFICIAL (DECL_RESULT (subprog_decl)) = 1;
DECL_IGNORED_P (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 /* 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 target by-reference return mechanism. This is not supported all the
way down to RTL expansion with GCC 4, which ICEs on temporary creation 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 attempts with such a type and expects DECL_BY_REFERENCE to be set on
the RESULT_DECL instead - see gnat_genericize for more details. */ the RESULT_DECL instead - see gnat_genericize for more details. */
if (TREE_ADDRESSABLE (TREE_TYPE (DECL_RESULT (subprog_decl)))) if (TREE_ADDRESSABLE (TREE_TYPE (DECL_RESULT (subprog_decl))))
{ {
tree result_decl = DECL_RESULT (subprog_decl); tree result_decl = DECL_RESULT (subprog_decl);
TREE_ADDRESSABLE (TREE_TYPE (result_decl)) = 0; TREE_ADDRESSABLE (TREE_TYPE (result_decl)) = 0;
DECL_BY_REFERENCE (result_decl) = 1; DECL_BY_REFERENCE (result_decl) = 1;
} }
if (inline_flag) if (inline_flag)
DECL_DECLARED_INLINE_P (subprog_decl) = 1; DECL_DECLARED_INLINE_P (subprog_decl) = 1;
......
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