aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/decl.c
diff options
context:
space:
mode:
authorPierre-Marie de Rodat <derodat@adacore.com>2014-07-30 14:52:44 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2014-07-30 14:52:44 +0200
commite8fa3dcdd50c6c532d9dab2da73b3dd23f5c27cb (patch)
treed4f362f89896e39a21c794408b00edd00f0dbd44 /gcc/ada/gcc-interface/decl.c
parent7b2888e62cee3ff8fa44e316b8d9d21a4611dbca (diff)
downloadgcc-e8fa3dcdd50c6c532d9dab2da73b3dd23f5c27cb.zip
gcc-e8fa3dcdd50c6c532d9dab2da73b3dd23f5c27cb.tar.gz
gcc-e8fa3dcdd50c6c532d9dab2da73b3dd23f5c27cb.tar.bz2
decl.c (gnat_to_gnu_entity): Create a mere scalar constant instead of a reference for a renaming of scalar...
2014-07-30 Pierre-Marie Derodat <derodat@adacore.com> * gcc-interface/decl.c (gnat_to_gnu_entity) <object>: Create a mere scalar constant instead of a reference for a renaming of scalar literal. * gcc-interface/utils.c (renaming_from_generic_instantiation_p): New. * gcc-interface/gigi.h (renaming_from_generic_instantiation_p): New. From-SVN: r213258
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r--gcc/ada/gcc-interface/decl.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 6ece8d8..10eb6cc 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -349,9 +349,12 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
|| Is_Public (gnat_entity));
/* Get the name of the entity and set up the line number and filename of
- the original definition for use in any decl we make. */
+ the original definition for use in any decl we make. Make sure we do not
+ inherit another source location. */
gnu_entity_name = get_entity_name (gnat_entity);
- Sloc_to_locus (Sloc (gnat_entity), &input_location);
+ if (Sloc (gnat_entity) != No_Location
+ && !renaming_from_generic_instantiation_p (gnat_entity))
+ Sloc_to_locus (Sloc (gnat_entity), &input_location);
/* For cases when we are not defining (i.e., we are referencing from
another compilation unit) public entities, show we are at global level
@@ -1988,7 +1991,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
maybe_present = true;
break;
- /* Array and String Types and Subtypes
+ /* Array Types and Subtypes
Unconstrained array types are represented by E_Array_Type and
constrained array types are represented by E_Array_Subtype. There
@@ -2001,7 +2004,6 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
Number_Dimensions Number of dimensions (an int).
First_Index Type of first index. */
- case E_String_Type:
case E_Array_Type:
{
const bool convention_fortran_p
@@ -2312,7 +2314,6 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
}
break;
- case E_String_Subtype:
case E_Array_Subtype:
/* This is the actual data type for array variables. Multidimensional