summaryrefslogtreecommitdiff
path: root/gcc/ada/prj-proc.adb
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-12-02 07:31:39 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-12-02 07:31:39 +0000
commit47c16a8cec2c48947e6d85683f5f916777ccc169 (patch)
tree3a8bf827ae1df7e637a2a4ede4dba5f0421ac0d2 /gcc/ada/prj-proc.adb
parentb27941d363b11d115e30a9676e61c8536a12adf7 (diff)
downloadgcc-47c16a8cec2c48947e6d85683f5f916777ccc169.tar.gz
2009-12-02 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 154895 {after more plugin events from ICI folks} git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@154896 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/prj-proc.adb')
-rw-r--r--gcc/ada/prj-proc.adb50
1 files changed, 30 insertions, 20 deletions
diff --git a/gcc/ada/prj-proc.adb b/gcc/ada/prj-proc.adb
index 0cd20c8f19d..49841522dc9 100644
--- a/gcc/ada/prj-proc.adb
+++ b/gcc/ada/prj-proc.adb
@@ -1869,9 +1869,16 @@ package body Prj.Proc is
else
declare
Index_Name : Name_Id :=
- Associative_Array_Index_Of
- (Current_Item, From_Project_Node_Tree);
- The_Array : Array_Id;
+ Associative_Array_Index_Of
+ (Current_Item,
+ From_Project_Node_Tree);
+
+ Source_Index : constant Int :=
+ Source_Index_Of
+ (Current_Item,
+ From_Project_Node_Tree);
+
+ The_Array : Array_Id;
The_Array_Element : Array_Element_Id :=
No_Array_Element;
@@ -1889,9 +1896,9 @@ package body Prj.Proc is
if Pkg /= No_Package then
The_Array :=
In_Tree.Packages.Table (Pkg).Decl.Arrays;
-
else
- The_Array := Project.Decl.Arrays;
+ The_Array :=
+ Project.Decl.Arrays;
end if;
while
@@ -1900,8 +1907,8 @@ package body Prj.Proc is
In_Tree.Arrays.Table (The_Array).Name /=
Current_Item_Name
loop
- The_Array := In_Tree.Arrays.Table
- (The_Array).Next;
+ The_Array :=
+ In_Tree.Arrays.Table (The_Array).Next;
end loop;
-- If the array cannot be found, create a new entry
@@ -1943,12 +1950,15 @@ package body Prj.Proc is
end if;
-- Look in the list, if any, to find an element
- -- with the same index.
+ -- with the same index and same source index.
while The_Array_Element /= No_Array_Element
and then
- In_Tree.Array_Elements.Table
+ (In_Tree.Array_Elements.Table
(The_Array_Element).Index /= Index_Name
+ or else
+ In_Tree.Array_Elements.Table
+ (The_Array_Element).Src_Index /= Source_Index)
loop
The_Array_Element :=
In_Tree.Array_Elements.Table
@@ -1962,23 +1972,23 @@ package body Prj.Proc is
if The_Array_Element = No_Array_Element then
Array_Element_Table.Increment_Last
(In_Tree.Array_Elements);
- The_Array_Element := Array_Element_Table.Last
- (In_Tree.Array_Elements);
+ The_Array_Element :=
+ Array_Element_Table.Last
+ (In_Tree.Array_Elements);
In_Tree.Array_Elements.Table
(The_Array_Element) :=
- (Index => Index_Name,
- Src_Index =>
- Source_Index_Of
- (Current_Item, From_Project_Node_Tree),
+ (Index => Index_Name,
+ Src_Index => Source_Index,
Index_Case_Sensitive =>
not Case_Insensitive
(Current_Item, From_Project_Node_Tree),
- Value => New_Value,
- Next => In_Tree.Arrays.Table
- (The_Array).Value);
- In_Tree.Arrays.Table
- (The_Array).Value := The_Array_Element;
+ Value => New_Value,
+ Next =>
+ In_Tree.Arrays.Table (The_Array).Value);
+
+ In_Tree.Arrays.Table (The_Array).Value :=
+ The_Array_Element;
-- An element with the same index already exists,
-- just replace its value with the new one.