]> gcc.gnu.org Git - gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Thu, 13 Oct 2016 12:54:42 +0000 (14:54 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Thu, 13 Oct 2016 12:54:42 +0000 (14:54 +0200)
2016-10-13  Hristian Kirtchev  <kirtchev@adacore.com>

* sem_ch10.adb (Entity_Needs_Body): A generic
subprogram renaming needs a body if the renamed unit is declared
outside the current compilation unit.

2016-10-13  Hristian Kirtchev  <kirtchev@adacore.com>

* sinfo.ads, sem_ch12.adb, sem.adb, expander.adb, sem_res.ads,
sem_ch4.adb, sem_ch8.adb, s-memory.adb: Minor reformatting.

2016-10-13  Vincent Celier  <celier@adacore.com>

* gnatcmd.adb: Delete all temporary files when invoked as gnat
list -V -P ...

2016-10-13  Ed Falis  <falis@adacore.com>

* impunit.adb: add i-vxinco.ads.
* s-interr-vxworks.adb: add hook for user interrupt connection routine.

From-SVN: r241112

13 files changed:
gcc/ada/ChangeLog
gcc/ada/expander.adb
gcc/ada/gnatcmd.adb
gcc/ada/impunit.adb
gcc/ada/s-interr-vxworks.adb
gcc/ada/s-memory.adb
gcc/ada/sem.adb
gcc/ada/sem_ch10.adb
gcc/ada/sem_ch12.adb
gcc/ada/sem_ch4.adb
gcc/ada/sem_ch8.adb
gcc/ada/sem_res.ads
gcc/ada/sinfo.ads

index 7dfa42d4f24e32178dc4b89045ee1a37fb319e76..2b70994eb387243f3d040577de4bef699af72fc6 100644 (file)
@@ -1,3 +1,24 @@
+2016-10-13  Hristian Kirtchev  <kirtchev@adacore.com>
+
+       * sem_ch10.adb (Entity_Needs_Body): A generic
+       subprogram renaming needs a body if the renamed unit is declared
+       outside the current compilation unit.
+
+2016-10-13  Hristian Kirtchev  <kirtchev@adacore.com>
+
+       * sinfo.ads, sem_ch12.adb, sem.adb, expander.adb, sem_res.ads,
+       sem_ch4.adb, sem_ch8.adb, s-memory.adb: Minor reformatting.
+
+2016-10-13  Vincent Celier  <celier@adacore.com>
+
+       * gnatcmd.adb: Delete all temporary files when invoked as gnat
+       list -V -P ...
+
+2016-10-13  Ed Falis  <falis@adacore.com>
+
+       * impunit.adb: add i-vxinco.ads.
+       * s-interr-vxworks.adb: add hook for user interrupt connection routine.
+
 2016-10-13  Ed Falis  <falis@adacore.com>
 
        * s-interr-hwint.adb, s-interr-vxworks.adb: Rename s-interr-hwint.adb
index 4aa20d6f41b6e810d9e7d7b83a6abca5b5538a92..84d64226772d0b6cb0178eef011f1ba14f55186e 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2015, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2016, Free Software Foundation, Inc.         --
 --                                                                          --
 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -151,7 +151,6 @@ package body Expander is
             --  corresponding expand routines.
 
             case Nkind (N) is
-
                when N_Abort_Statement =>
                   Expand_N_Abort_Statement (N);
 
index ce880ca4cc68a23d08e3252822c98a21a2b832ed..9a04e78abecd3531f143f9f75f76e47b591540f1 100644 (file)
@@ -356,6 +356,7 @@ procedure GNATCmd is
 
       if Add_Sources then
          Tempdir.Create_Temp_File (FD, Temp_File_Name);
+         Record_Temp_File (Project_Tree.Shared, Temp_File_Name);
          Last_Switches.Increment_Last;
          Last_Switches.Table (Last_Switches.Last) :=
            new String'("-files=" & Get_Name_String (Temp_File_Name));
@@ -1214,6 +1215,11 @@ begin
          end if;
 
          My_Exit_Status := Exit_Status (Spawn (Exec_Path.all, The_Args));
+
+         if not Keep_Temporary_Files then
+            Delete_All_Temp_Files (Project_Tree.Shared);
+         end if;
+
          Set_Exit_Status (My_Exit_Status);
       end;
    end;
index 45b937944b30d847756b8efee3e49531fb0831a9..e1cce657420c45b7c8b5bd588e36e87936a3a17a 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---           Copyright (C) 2000-2015, Free Software Foundation, Inc.        --
+--           Copyright (C) 2000-2016, Free Software Foundation, Inc.        --
 --                                                                          --
 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -351,6 +351,7 @@ package body Impunit is
     ("i-java  ", F),  -- Interfaces.Java
     ("i-javjni", F),  -- Interfaces.Java.JNI
     ("i-pacdec", F),  -- Interfaces.Packed_Decimal
+    ("i-vxinco", F),  -- Interfaces.VxWorks.Int_Connection
     ("i-vxwoio", F),  -- Interfaces.VxWorks.IO
     ("i-vxwork", F),  -- Interfaces.VxWorks
 
index b8705969d0cf87d9c253a304c4a22f0bc17bf4c9..32fba6008afb3112d4588853bdc42acb4097ddcc 100644 (file)
@@ -196,6 +196,22 @@ package body System.Interrupts is
    --  be connected but disconnection is not possible on VxWorks. Therefore
    --  we ensure Notify_Installed is connected at most once.
 
+   type Interrupt_Connector is access function
+     (Vector    : Interrupt_Vector;
+      Handler   : Interrupt_Handler;
+      Parameter : System.Address := System.Null_Address) return int;
+   --  Profile must match VxWorks intConnect()
+
+   Interrupt_Connect : Interrupt_Connector :=
+     System.OS_Interface.Interrupt_Connect'Access;
+   pragma Export (C, Interrupt_Connect, "__gnat_user_int_connect");
+   --  Allow user alternatives to the OS implementation of
+   --  System.OS_Interface.Interrupt_Connect. This allows the user to
+   --  associate a handler with an interrupt source when an alternate routine
+   --  is needed to do so. The association is performed in
+   --  Interfaces.VxWorks.Interrupt_Connections. Defaults to the standard OS
+   --  connection routine.
+
    -----------------------
    -- Local Subprograms --
    -----------------------
@@ -505,11 +521,12 @@ package body System.Interrupts is
       --  Only install umbrella handler when no Ada handler has already been
       --  installed. Note that the interrupt number is passed as a parameter
       --  when an interrupt occurs, so the umbrella handler has a different
-      --  wrapper generated by intConnect for each interrupt number.
+      --  wrapper generated by the connector routine for each interrupt
+      --  number.
 
       if not Handler_Installed (Interrupt) then
          Status :=
-            Interrupt_Connect (Vec, Handler, System.Address (Interrupt));
+           Interrupt_Connect.all (Vec, Handler, System.Address (Interrupt));
          pragma Assert (Status = 0);
 
          Handler_Installed (Interrupt) := True;
index 4c437669042ea81815ea8525b682d0773651ce38..f419b4716eec648afa3087c454e32466523562e7 100644 (file)
@@ -52,7 +52,7 @@ package body System.Memory is
    use System.Soft_Links;
 
    function c_malloc (Size : System.CRTL.size_t) return System.Address
-    renames System.CRTL.malloc;
+     renames System.CRTL.malloc;
 
    procedure c_free (Ptr : System.Address)
      renames System.CRTL.free;
index f904a506c01b6aea831e00b7098c92a725081837..a9700f64b43523129b5a5e9fb8e37a9131e7f422 100644 (file)
@@ -1341,7 +1341,7 @@ package body Sem is
          --  unconditionally, and has no restore mechanism, because it is
          --  intended as a lowest-level Pure package.
 
-         Save_Max_Line   : constant Int := Style_Max_Line_Length;
+         Save_Max_Line : constant Int := Style_Max_Line_Length;
 
          List : Elist_Id;
 
@@ -1367,7 +1367,7 @@ package body Sem is
          --  Check for scope mismatch on exit from compilation
 
          pragma Assert (Current_Scope = Standard_Standard
-                          or else Comp_Unit = Cunit (Main_Unit));
+                         or else Comp_Unit = Cunit (Main_Unit));
 
          --  Then pop entry for Standard, and pop implicit types
 
index 115b2dd1e7765b2f66ee806dd793af61a34a26d7..bc842e449cbe2327a551fb5f2d2e9a764ded92e0 100644 (file)
@@ -6145,15 +6145,14 @@ package body Sem_Ch10 is
    -------------------------------
 
    procedure Check_Body_Needed_For_SAL (Unit_Name : Entity_Id) is
-
       function Entity_Needs_Body (E : Entity_Id) return Boolean;
       --  Determine whether use of entity E might require the presence of its
       --  body. For a package this requires a recursive traversal of all nested
       --  declarations.
 
-      ---------------------------
-      -- Entity_Needed_For_SAL --
-      ---------------------------
+      -----------------------
+      -- Entity_Needs_Body --
+      -----------------------
 
       function Entity_Needs_Body (E : Entity_Id) return Boolean is
          Ent : Entity_Id;
@@ -6163,7 +6162,18 @@ package body Sem_Ch10 is
             return True;
 
          elsif Ekind_In (E, E_Generic_Function, E_Generic_Procedure) then
-            return True;
+
+            --  A generic subprogram always requires the presence of its
+            --  body because an instantiation needs both templates. The only
+            --  exceptions is a generic subprogram renaming. In this case the
+            --  body is needed only when the template is declared outside the
+            --  compilation unit being checked.
+
+            if Present (Renamed_Entity (E)) then
+               return not Within_Scope (E, Unit_Name);
+            else
+               return True;
+            end if;
 
          elsif Ekind (E) = E_Generic_Package
            and then
index b0a9ff66cac84254d289ba17cf1386e2eaf62daa..3d940a63e8e87725e509b49106dc62ed7f88ab34 100644 (file)
@@ -14259,7 +14259,6 @@ package body Sem_Ch12 is
             then
                Copy_Dimensions (N2, N);
             end if;
-
          end Set_Global_Type;
 
          ------------------
@@ -14335,7 +14334,7 @@ package body Sem_Ch12 is
                   if Is_Global (Entity (Original_Node (N2))) then
                      N2 := Original_Node (N2);
                      Set_Associated_Node (N, N2);
-                     Set_Global_Type (N, N2);
+                     Set_Global_Type     (N, N2);
 
                   --  Renaming is local, and will be resolved in instance
 
@@ -14377,7 +14376,7 @@ package body Sem_Ch12 is
             if Is_Global (Entity (Parent (N2))) then
                Change_Selected_Component_To_Expanded_Name (Parent (N));
                Set_Associated_Node (Parent (N), Parent (N2));
-               Set_Global_Type (Parent (N), Parent (N2));
+               Set_Global_Type     (Parent (N), Parent (N2));
                Save_Entity_Descendants (N);
 
             --  If this is a reference to the current generic entity, replace
@@ -14436,7 +14435,7 @@ package body Sem_Ch12 is
                if Is_Global (Entity (Name (Parent (N2)))) then
                   Change_Selected_Component_To_Expanded_Name (Parent (N));
                   Set_Associated_Node (Parent (N), Name (Parent (N2)));
-                  Set_Global_Type (Parent (N), Name (Parent (N2)));
+                  Set_Global_Type     (Parent (N), Name (Parent (N2)));
                   Save_Entity_Descendants (N);
 
                else
index 888d6e9edd58f5c63e17df32579d8f7b1f50f08c..9060fb1b7232132c33a0a6a964eca7d8a451185e 100644 (file)
@@ -231,18 +231,17 @@ package body Sem_Ch4 is
       R     : Node_Id;
       Op_Id : Entity_Id;
       T1    : Entity_Id);
-   --  For equality and comparison operators, the result is always boolean,
-   --  and the legality of the operation is determined from the visibility
-   --  of the operand types. If one of the operands has a universal interpre-
-   --  tation,  the legality check uses some compatible non-universal
-   --  interpretation of the other operand. N can be an operator node, or
-   --  a function call whose name is an operator designator. Any_Access, which
-   --  is the initial type of the literal NULL, is a universal type for the
-   --  purpose of this routine.
+   --  For equality and comparison operators, the result is always boolean, and
+   --  the legality of the operation is determined from the visibility of the
+   --  operand types. If one of the operands has a universal interpretation,
+   --  the legality check uses some compatible non-universal interpretation of
+   --  the other operand. N can be an operator node, or a function call whose
+   --  name is an operator designator. Any_Access, which is the initial type of
+   --  the literal NULL, is a universal type for the purpose of this routine.
 
    function Find_Primitive_Operation (N : Node_Id) return Boolean;
-   --  Find candidate interpretations for the name Obj.Proc when it appears
-   --  in a subprogram renaming declaration.
+   --  Find candidate interpretations for the name Obj.Proc when it appears in
+   --  a subprogram renaming declaration.
 
    procedure Find_Unary_Types
      (R     : Node_Id;
index 1f2a985be582d0534b42b4af87ae7398b7d40d42..45159c0e611b3ff36d37b1e6b9daae0afa78a517 100644 (file)
@@ -8197,9 +8197,9 @@ package body Sem_Ch8 is
          --  semantics of pragma Component_Alignment.
 
          if Scope_Stack.Last > Scope_Stack.First then
-            SST.Component_Alignment_Default := Scope_Stack.Table
-                                                 (Scope_Stack.Last - 1).
-                                                   Component_Alignment_Default;
+            SST.Component_Alignment_Default :=
+              Scope_Stack.Table
+                (Scope_Stack.Last - 1).  Component_Alignment_Default;
 
          --  Otherwise, this is the first scope being pushed on the scope
          --  stack. Inherit the component alignment from the configuration
index e94c36bbb1fbaa8b727dc809c8cee6579df63c6d..0fd9f8d1d0228af4bb1851560861824a12f36326 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 1992-2015, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2016, Free Software Foundation, Inc.         --
 --                                                                          --
 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -47,34 +47,12 @@ package Sem_Res is
    --  Resolve routines also complete the semantic analysis, and call the
    --  expander for possible expansion of the completely type resolved node.
 
-   procedure Resolve (N : Node_Id; Typ : Entity_Id);
-   procedure Resolve (N : Node_Id; Typ : Entity_Id; Suppress : Check_Id);
-   --  Top level type-checking procedure, called in a complete context. The
-   --  construct N, which is a subexpression, has already been analyzed, and
-   --  is required to be of type Typ given the analysis of the context (which
-   --  uses the information gathered on the bottom up phase in Analyze). The
-   --  resolve routines do various other processing, e.g. static evaluation.
-   --  If a Suppress argument is present, then the resolution is done with the
-   --  specified check suppressed (can be All_Checks to suppress all checks).
-
-   procedure Resolve (N : Node_Id);
-   --  A version of Resolve where the type to be used for resolution is
-   --  taken from the Etype (N). This is commonly used in cases where the
-   --  context does not add anything and the first pass of analysis found
-   --  the correct expected type.
-
-   procedure Resolve_Discrete_Subtype_Indication
-     (N   : Node_Id;
-      Typ : Entity_Id);
-   --  Resolve subtype indications in choices (case statements and
-   --  aggregates) and in index constraints. Note that the resulting Etype
-   --  of the subtype indication node is set to the Etype of the contained
-   --  range (i.e. an Itype is not constructed for the actual subtype).
-
-   procedure Resolve_Entry (Entry_Name : Node_Id);
-   --  Find name of entry being called, and resolve prefix of name with its
-   --  own type. For now we assume that the prefix cannot be overloaded and
-   --  the name of the entry plays no role in the resolution.
+   procedure Ambiguous_Character (C : Node_Id);
+   --  Give list of candidate interpretations when a character literal cannot
+   --  be resolved, for example in a (useless) comparison such as 'A' = 'B'.
+   --  In Ada 95 the literals in question can be of type Character or Wide_
+   --  Character. In Ada 2005 Wide_Wide_Character is also a candidate. The
+   --  node may also be overloaded with user-defined character types.
 
    procedure Analyze_And_Resolve (N : Node_Id);
    procedure Analyze_And_Resolve (N : Node_Id; Typ : Entity_Id);
@@ -92,36 +70,58 @@ package Sem_Res is
    --  is not present, then the Etype of the expression after the Analyze
    --  call is used for the Resolve.
 
-   procedure Ambiguous_Character (C : Node_Id);
-   --  Give list of candidate interpretations when a character literal cannot
-   --  be resolved, for example in a (useless) comparison such as 'A' = 'B'.
-   --  In Ada 95 the literals in question can be of type Character or Wide_
-   --  Character. In Ada 2005 Wide_Wide_Character is also a candidate. The
-   --  node may also be overloaded with user-defined character types.
-
    procedure Check_Parameterless_Call (N : Node_Id);
-   --  Several forms of names can denote calls to entities without para-
-   --  meters. The context determines whether the name denotes the entity
-   --  or a call to it. When it is a call, the node must be rebuilt
-   --  accordingly and reanalyzed to obtain possible interpretations.
+   --  Several forms of names can denote calls to entities without parameters.
+   --  The context determines whether the name denotes the entity or a call to
+   --  it. When it is a call, the node must be rebuilt accordingly and
+   --  reanalyzed to obtain possible interpretations.
    --
    --  The name may be that of an overloadable construct, or it can be an
    --  explicit dereference of a prefix that denotes an access to subprogram.
    --  In that case, we want to convert the name into a call only if the
-   --  context requires the return type of the subprogram.  Finally, a
+   --  context requires the return type of the subprogram. Finally, a
    --  parameterless protected subprogram appears as a selected component.
    --
    --  The parameter T is the Typ for the corresponding resolve call.
 
    procedure Preanalyze_And_Resolve (N : Node_Id; T : Entity_Id);
-   --  Performs a pre-analysis of expression node N. During pre-analysis,
-   --  N is analyzed and then resolved against type T, but no expansion
-   --  is carried out for N or its children. For more info on pre-analysis
-   --  read the spec of Sem.
+   --  Performs a pre-analysis of expression node N. During pre-analysis, N is
+   --  analyzed and then resolved against type T, but no expansion is carried
+   --  out for N or its children. For more info on pre-analysis read the spec
+   --  of Sem.
 
    procedure Preanalyze_And_Resolve (N : Node_Id);
    --  Same, but use type of node because context does not impose a single type
 
+   procedure Resolve (N : Node_Id; Typ : Entity_Id);
+   procedure Resolve (N : Node_Id; Typ : Entity_Id; Suppress : Check_Id);
+   --  Top-level type-checking procedure, called in a complete context. The
+   --  construct N, which is a subexpression, has already been analyzed, and
+   --  is required to be of type Typ given the analysis of the context (which
+   --  uses the information gathered on the bottom-up phase in Analyze). The
+   --  resolve routines do various other processing, e.g. static evaluation.
+   --  If a Suppress argument is present, then the resolution is done with the
+   --  specified check suppressed (can be All_Checks to suppress all checks).
+
+   procedure Resolve (N : Node_Id);
+   --  A version of Resolve where the type to be used for resolution is taken
+   --  from the Etype (N). This is commonly used in cases where the context
+   --  does not add anything and the first pass of analysis found the correct
+   --  expected type.
+
+   procedure Resolve_Discrete_Subtype_Indication
+     (N   : Node_Id;
+      Typ : Entity_Id);
+   --  Resolve subtype indications in choices (case statements and aggregates)
+   --  and in index constraints. Note that the resulting Etype of the subtype_
+   --  indication node is set to the Etype of the contained range (i.e. an
+   --  Itype is not constructed for the actual subtype).
+
+   procedure Resolve_Entry (Entry_Name : Node_Id);
+   --  Find name of entry being called, and resolve prefix of name with its
+   --  own type. For now we assume that the prefix cannot be overloaded and
+   --  the name of the entry plays no role in the resolution.
+
    function Valid_Conversion
      (N           : Node_Id;
       Target      : Entity_Id;
@@ -137,7 +137,7 @@ package Sem_Res is
 private
    procedure Resolve_Implicit_Type (N : Node_Id) renames Resolve;
    pragma Inline (Resolve_Implicit_Type);
-   --  We use this renaming to make the application of Inline very explicit
-   --  to this version, since other versions of Resolve are not inlined.
+   --  We use this renaming to make the application of Inline very explicit to
+   --  this version, since other versions of Resolve are not inlined.
 
 end Sem_Res;
index 01d9be531d3684da7fac85d992b930d76ffb0b44..659e989d0a49bb8950f71f0fe71e995678d6e22e 100644 (file)
@@ -5232,13 +5232,13 @@ package Sinfo is
       --  Acts_As_Spec (Flag4-Sem)
       --  Bad_Is_Detected (Flag15) used only by parser
       --  Do_Storage_Check (Flag17-Sem)
+      --  Has_Relative_Deadline_Pragma (Flag9-Sem)
       --  Is_Entry_Barrier_Function (Flag8-Sem)
       --  Is_Protected_Subprogram_Body (Flag7-Sem)
       --  Is_Task_Body_Procedure (Flag1-Sem)
       --  Is_Task_Master (Flag5-Sem)
-      --  Was_Originally_Stub (Flag13-Sem)
-      --  Has_Relative_Deadline_Pragma (Flag9-Sem)
       --  Was_Expression_Function (Flag18-Sem)
+      --  Was_Originally_Stub (Flag13-Sem)
 
       -------------------------
       -- Expression Function --
This page took 0.123481 seconds and 5 git commands to generate.