aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2015-06-01 08:22:14 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2015-06-01 08:22:14 +0000
commit2b50232a5df3dd82d389c4dbcd48940e308605e4 (patch)
tree43969e14401b2e0465a07f94e200d7df6e120dce /gcc/ada
parentb2fbb27f6c403a5fab85d0b17c17666c0a36548b (diff)
downloadgcc-2b50232a5df3dd82d389c4dbcd48940e308605e4.zip
gcc-2b50232a5df3dd82d389c4dbcd48940e308605e4.tar.gz
gcc-2b50232a5df3dd82d389c4dbcd48940e308605e4.tar.bz2
winnt.c (i386_pe_encode_section_info): Remove obsolete kludge.
* config/i386/winnt.c (i386_pe_encode_section_info) <FUNCTION_DECL>: Remove obsolete kludge. ada/ * gcc-interface/utils.c (create_var_decl_1): If an assembler name is specified, let the target mangle it before settting. (create_subprog_decl): Likewise and move this treatment last. From-SVN: r223918
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/gcc-interface/utils.c22
2 files changed, 22 insertions, 6 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 357f001..a618372 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,11 @@
2015-06-01 Eric Botcazou <ebotcazou@adacore.com>
+ * gcc-interface/utils.c (create_var_decl_1): If an assembler name is
+ specified, let the target mangle it before settting.
+ (create_subprog_decl): Likewise and move this treatment last.
+
+2015-06-01 Eric Botcazou <ebotcazou@adacore.com>
+
* gcc-interface/lang-specs.h (TARGET_VXWORKS_RTP): Move substitution to
before first -gnatez switch. Simplify and add trailing space.
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index 31bb3d2..7ec0974 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -2428,7 +2428,13 @@ create_var_decl_1 (tree var_name, tree asm_name, tree type, tree var_init,
if (TREE_CODE (var_decl) == VAR_DECL)
{
if (asm_name)
- SET_DECL_ASSEMBLER_NAME (var_decl, asm_name);
+ {
+ /* Let the target mangle the name if this isn't a verbatim asm. */
+ if (*IDENTIFIER_POINTER (asm_name) != '*')
+ asm_name = targetm.mangle_decl_assembler_name (var_decl, asm_name);
+
+ SET_DECL_ASSEMBLER_NAME (var_decl, asm_name);
+ }
if (global_bindings_p ())
rest_of_decl_compilation (var_decl, true, 0);
@@ -3047,8 +3053,17 @@ create_subprog_decl (tree subprog_name, tree asm_name, tree subprog_type,
DECL_BY_REFERENCE (result_decl) = TREE_ADDRESSABLE (subprog_type);
DECL_RESULT (subprog_decl) = result_decl;
+ process_attributes (&subprog_decl, &attr_list, true, gnat_node);
+
+ /* Add this decl to the current binding level. */
+ gnat_pushdecl (subprog_decl, gnat_node);
+
if (asm_name)
{
+ /* Let the target mangle the name if this isn't a verbatim asm. */
+ if (*IDENTIFIER_POINTER (asm_name) != '*')
+ asm_name = targetm.mangle_decl_assembler_name (subprog_decl, asm_name);
+
SET_DECL_ASSEMBLER_NAME (subprog_decl, asm_name);
/* The expand_main_function circuitry expects "main_identifier_node" to
@@ -3061,11 +3076,6 @@ create_subprog_decl (tree subprog_name, tree asm_name, tree subprog_type,
DECL_NAME (subprog_decl) = main_identifier_node;
}
- process_attributes (&subprog_decl, &attr_list, true, gnat_node);
-
- /* Add this decl to the current binding level. */
- gnat_pushdecl (subprog_decl, gnat_node);
-
/* Output the assembler code and/or RTL for the declaration. */
rest_of_decl_compilation (subprog_decl, global_bindings_p (), 0);