aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2005-01-03 16:41:04 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2005-01-03 16:41:04 +0100
commit416cd96afe0f7c597b89448a0f8481050eb30675 (patch)
treeed29d62c20d45ff28b42facea335372a941e9e86 /gcc/ada
parent4bb6d5fd42cfe938b58575002a79ac332be552ab (diff)
downloadgcc-416cd96afe0f7c597b89448a0f8481050eb30675.zip
gcc-416cd96afe0f7c597b89448a0f8481050eb30675.tar.gz
gcc-416cd96afe0f7c597b89448a0f8481050eb30675.tar.bz2
sem_ch12.adb (Analyze_Package_Instantiation): Create a separate node to use as the defining identifier for a formal package.
* sem_ch12.adb (Analyze_Package_Instantiation): Create a separate node to use as the defining identifier for a formal package. (Remove_Parent): If the instance takes place within (an instance of) a sibling, preserve private declarations of common parent. From-SVN: r92848
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/sem_ch12.adb15
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index b1779e1..588ce99 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -2849,6 +2849,17 @@ package body Sem_Ch12 is
Inline_Instance_Body (N, Gen_Unit, Act_Decl);
end if;
+ -- The following is a tree patch for ASIS: ASIS needs separate nodes
+ -- to be used as defining identifiers for a formal package and for the
+ -- corresponding expanded package
+
+ if Nkind (N) = N_Formal_Package_Declaration then
+ Act_Decl_Id := New_Copy (Defining_Entity (N));
+ Set_Comes_From_Source (Act_Decl_Id, True);
+ Set_Is_Generic_Instance (Act_Decl_Id, False);
+ Set_Defining_Identifier (N, Act_Decl_Id);
+ end if;
+
exception
when Instantiation_Error =>
if Parent_Installed then
@@ -8904,9 +8915,11 @@ package body Sem_Ch12 is
and then P /= Current_Scope
then
-- We are within an instance of some sibling. Retain
- -- visibility of parent, for proper subsequent cleanup.
+ -- visibility of parent, for proper subsequent cleanup,
+ -- and reinstall private declarations as well.
Set_In_Private_Part (P);
+ Install_Private_Declarations (P);
end if;
-- This looks incomplete: what about compilation units that