OSDN Git Service

2009-04-16 Jerome Lambourg <lambourg@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 16 Apr 2009 10:52:29 +0000 (10:52 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 16 Apr 2009 10:52:29 +0000 (10:52 +0000)
* sem_prag.adb (Process_Import_Or_Interface): With .NET,
Access_Subprogram types can also be imported.
(Check_Form_Of_Interface_Name): Accept '/' character in entity CIL
names.

2009-04-16  Ed Schonberg  <schonberg@adacore.com>

* exp_ch6.adb (Make_Build_In_Place_Call_In_Object_Declaration):
preserve homonym chain when the declaration is rewritten into a
renaming declaration, in order to preserve visibility structure.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146169 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/exp_ch6.adb
gcc/ada/sem_prag.adb

index b9474b8..b981087 100644 (file)
@@ -1,5 +1,18 @@
 2009-04-16  Jerome Lambourg  <lambourg@adacore.com>
 
+       * sem_prag.adb (Process_Import_Or_Interface): With .NET,
+       Access_Subprogram types can also be imported.
+       (Check_Form_Of_Interface_Name): Accept '/' character in entity CIL
+       names.
+
+2009-04-16  Ed Schonberg  <schonberg@adacore.com>
+
+       * exp_ch6.adb (Make_Build_In_Place_Call_In_Object_Declaration):
+       preserve homonym chain when the declaration is rewritten into a
+       renaming declaration, in order to preserve visibility structure.
+
+2009-04-16  Jerome Lambourg  <lambourg@adacore.com>
+
        * sem_prag.adb (Analyze_Pragma): Make sure that pragma pack is not
        taken into account for VM targets.
 
index 2544560..bae10b7 100644 (file)
@@ -5588,7 +5588,7 @@ package body Exp_Ch6 is
          --  in current scope). The Next_Entity links of the two entities also
          --  have to be swapped since the entities are part of the return
          --  scope's entity list and the list structure would otherwise be
-         --  corrupted.
+         --  corrupted. Finally, the homonym chain must be preserved as well.
 
          declare
             Renaming_Def_Id  : constant Entity_Id :=
@@ -5602,6 +5602,7 @@ package body Exp_Ch6 is
 
             Set_Next_Entity (Renaming_Def_Id, Next_Entity (Obj_Def_Id));
             Set_Next_Entity (Obj_Def_Id, Next_Entity_Temp);
+            Set_Homonym     (Renaming_Def_Id, Homonym (Obj_Def_Id));
 
             Exchange_Entities (Renaming_Def_Id, Obj_Def_Id);
          end;
index c3b0f34..cdbd9e3 100644 (file)
@@ -3531,13 +3531,14 @@ package body Sem_Prag is
             end loop;
 
          --  When the convention is Java or CIL, we also allow Import to be
-         --  given for packages, generic packages, exceptions, and record
-         --  components.
+         --  given for packages, generic packages, exceptions, record
+         --  components, and access to subprograms.
 
          elsif (C = Convention_Java or else C = Convention_CIL)
            and then
              (Is_Package_Or_Generic_Package (Def_Id)
                or else Ekind (Def_Id) = E_Exception
+               or else Ekind (Def_Id) = E_Access_Subprogram_Type
                or else Nkind (Parent (Def_Id)) = N_Component_Declaration)
          then
             Set_Imported (Def_Id);
@@ -3931,16 +3932,17 @@ package body Sem_Prag is
                   --  For all cases except external names on CLI target,
                   --  commas, spaces and slashes are dubious (in CLI, we use
                   --  spaces and commas in external names to specify assembly
-                  --  version and public key).
+                  --  version and public key, while slashes can be used in
+                  --  names to mark nested classes).
 
                   or else ((not Ext_Name_Case or else VM_Target /= CLI_Target)
                              and then (Get_Character (C) = ' '
                                          or else
                                        Get_Character (C) = ','
                                          or else
-                                       Get_Character (C) = '/'
-                                         or else
                                        Get_Character (C) = '\'))
+                 or else (VM_Target /= CLI_Target
+                           and then Get_Character (C) = '/')
                then
                   Error_Msg
                     ("?interface name contains illegal character",