aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/ada/gcc-interface/decl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/ada/gcc-interface/decl.c')
-rw-r--r--gcc-4.9/gcc/ada/gcc-interface/decl.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/gcc-4.9/gcc/ada/gcc-interface/decl.c b/gcc-4.9/gcc/ada/gcc-interface/decl.c
index 4180e59f6..52452ce79 100644
--- a/gcc-4.9/gcc/ada/gcc-interface/decl.c
+++ b/gcc-4.9/gcc/ada/gcc-interface/decl.c
@@ -72,6 +72,8 @@
#define Has_Thiscall_Convention(E) 0
#endif
+#define STDCALL_PREFIX "_imp__"
+
/* Stack realignment is necessary for functions with foreign conventions when
the ABI doesn't mandate as much as what the compiler assumes - that is, up
to PREFERRED_STACK_BOUNDARY.
@@ -2433,8 +2435,10 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
we can just use the high bound of the index type. */
else if ((Nkind (gnat_index) == N_Range
&& cannot_be_superflat_p (gnat_index))
- /* Packed Array Types are never superflat. */
- || Is_Packed_Array_Type (gnat_entity))
+ /* Bit-Packed Array Types are never superflat. */
+ || (Is_Packed_Array_Type (gnat_entity)
+ && Is_Bit_Packed_Array
+ (Original_Array_Type (gnat_entity))))
gnu_high = gnu_max;
/* Otherwise, if the high bound is constant but the low bound is
@@ -8879,16 +8883,12 @@ get_entity_name (Entity_Id gnat_entity)
tree
create_concat_name (Entity_Id gnat_entity, const char *suffix)
{
- Entity_Kind kind = Ekind (gnat_entity);
+ const Entity_Kind kind = Ekind (gnat_entity);
+ const bool has_suffix = (suffix != NULL);
+ String_Template temp = {1, has_suffix ? strlen (suffix) : 0};
+ String_Pointer sp = {suffix, &temp};
- if (suffix)
- {
- String_Template temp = {1, (int) strlen (suffix)};
- Fat_Pointer fp = {suffix, &temp};
- Get_External_Name_With_Suffix (gnat_entity, fp);
- }
- else
- Get_External_Name (gnat_entity, 0);
+ Get_External_Name (gnat_entity, has_suffix, sp);
/* A variable using the Stdcall convention lives in a DLL. We adjust
its name to use the jump table, the _imp__NAME contains the address
@@ -8896,9 +8896,9 @@ create_concat_name (Entity_Id gnat_entity, const char *suffix)
if ((kind == E_Variable || kind == E_Constant)
&& Has_Stdcall_Convention (gnat_entity))
{
- const int len = 6 + Name_Len;
+ const int len = strlen (STDCALL_PREFIX) + Name_Len;
char *new_name = (char *) alloca (len + 1);
- strcpy (new_name, "_imp__");
+ strcpy (new_name, STDCALL_PREFIX);
strcat (new_name, Name_Buffer);
return get_identifier_with_length (new_name, len);
}