aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2012-10-29 10:00:24 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2012-10-29 11:00:24 +0100
commit415450ea8e5025bbf8c8506aada92f7a69dd97fa (patch)
tree0384df09cfc290e6e6b08a0b00739612064c6b19
parent37ae92c459ceb0fa65ff4041403f918d286ece25 (diff)
downloadgcc-415450ea8e5025bbf8c8506aada92f7a69dd97fa.zip
gcc-415450ea8e5025bbf8c8506aada92f7a69dd97fa.tar.gz
gcc-415450ea8e5025bbf8c8506aada92f7a69dd97fa.tar.bz2
sem_ch13.adb (Replace_Type_Reference): Use correct sloc for the new node.
2012-10-29 Bob Duff <duff@adacore.com> * sem_ch13.adb (Replace_Type_Reference): Use correct sloc for the new node. From-SVN: r192916
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/sem_ch13.adb17
2 files changed, 15 insertions, 7 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 73abf15..ef0c320 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2012-10-29 Bob Duff <duff@adacore.com>
+
+ * sem_ch13.adb (Replace_Type_Reference): Use correct sloc for
+ the new node.
+
2012-10-29 Thomas Quinot <quinot@adacore.com>
* sem_elab.adb: Minor reformatting and code reorganization.
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index 521eb80..94fd6a6 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -5018,17 +5018,18 @@ package body Sem_Ch13 is
----------------------------
procedure Replace_Type_Reference (N : Node_Id) is
+ -- Use the Sloc of the usage name below, not the defining name
begin
-- Invariant'Class, replace with T'Class (obj)
if Class_Present (Ritem) then
Rewrite (N,
- Make_Type_Conversion (Loc,
+ Make_Type_Conversion (Sloc (N),
Subtype_Mark =>
- Make_Attribute_Reference (Loc,
- Prefix => New_Occurrence_Of (T, Loc),
+ Make_Attribute_Reference (Sloc (N),
+ Prefix => New_Occurrence_Of (T, Sloc (N)),
Attribute_Name => Name_Class),
- Expression => Make_Identifier (Loc, Object_Name)));
+ Expression => Make_Identifier (Sloc (N), Object_Name)));
Set_Entity (Expression (N), Object_Entity);
Set_Etype (Expression (N), Typ);
@@ -5036,7 +5037,7 @@ package body Sem_Ch13 is
-- Invariant, replace with obj
else
- Rewrite (N, Make_Identifier (Loc, Object_Name));
+ Rewrite (N, Make_Identifier (Sloc (N), Object_Name));
Set_Entity (N, Object_Entity);
Set_Etype (N, Typ);
end if;
@@ -5422,7 +5423,9 @@ package body Sem_Ch13 is
procedure Replace_Type_Reference (N : Node_Id) is
begin
- Rewrite (N, Make_Identifier (Loc, Object_Name));
+ Rewrite (N, Make_Identifier (Sloc (N), Object_Name));
+ -- Use the Sloc of the usage name, not the defining name
+
Set_Entity (N, Object_Entity);
Set_Etype (N, Typ);
end Replace_Type_Reference;
@@ -6622,7 +6625,7 @@ package body Sem_Ch13 is
-- containing that copy, but Expression (Ident) is a preanalyzed copy
-- of the expression, preanalyzed just after the freeze point.
- -- Make a copy of the expression to be preanalyed
+ -- Make a copy of the expression to be preanalyzed
Set_Expression (ASN, New_Copy_Tree (Entity (Ident)));