]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Thu, 31 Jul 2014 09:38:40 +0000 (11:38 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Thu, 31 Jul 2014 09:38:40 +0000 (11:38 +0200)
2014-07-31  Ed Schonberg  <schonberg@adacore.com>

* exp_ch3.adb (Expand_Freeze_Record_Type): Do not build an
invariant procedure for an internally generated subtype that is
created for an object of a class-wide type.

2014-07-31  Vincent Celier  <celier@adacore.com>

* prj-nmsc.adb, errutil.adb: Make code similar to Errout.

2014-07-31  Gary Dismukes  <dismukes@adacore.com>

* gnat_rm.texi, sem_aux.ads, einfo.ads, sem_util.ads, sem_ch6.adb,
exp_disp.adb: Minor reformatting.

From-SVN: r213326

gcc/ada/ChangeLog
gcc/ada/einfo.ads
gcc/ada/errutil.adb
gcc/ada/exp_ch3.adb
gcc/ada/exp_disp.adb
gcc/ada/gnat_rm.texi
gcc/ada/prj-nmsc.adb
gcc/ada/sem_aux.ads
gcc/ada/sem_ch6.adb
gcc/ada/sem_util.ads

index b6377b38efcdc2b16fba6d723e77de0540d55e36..91dd3cd81aa54aa77d2ea8a7cf9680c1d4be278d 100644 (file)
@@ -1,3 +1,18 @@
+2014-07-31  Ed Schonberg  <schonberg@adacore.com>
+
+       * exp_ch3.adb (Expand_Freeze_Record_Type): Do not build an
+       invariant procedure for an internally generated subtype that is
+       created for an object of a class-wide type.
+
+2014-07-31  Vincent Celier  <celier@adacore.com>
+
+       * prj-nmsc.adb, errutil.adb: Make code similar to Errout.
+
+2014-07-31  Gary Dismukes  <dismukes@adacore.com>
+
+       * gnat_rm.texi, sem_aux.ads, einfo.ads, sem_util.ads, sem_ch6.adb,
+       exp_disp.adb: Minor reformatting.
+
 2014-07-31  Robert Dewar  <dewar@adacore.com>
 
        * exp_ch5.adb, sem_ch3.adb, exp_ch7.adb, exp_util.adb, exp_ch9.adb,
index ba96f0414c3abff2de791e478ac09e4964ec02d5..9fd46cb7a81069bc3985da4ebcdf1d90e95d6206 100644 (file)
@@ -352,7 +352,7 @@ package Einfo is
 --       defined primitives, and 6) secondary dispatch table with predefined
 --       primitives. The last entity of this list is an access type declaration
 --       used to expand dispatching calls through the primary dispatch table.
---       For a non-tagged record, contains No_Elist.
+--       For an untagged record, contains No_Elist.
 
 --    Actual_Subtype (Node17)
 --       Defined in variables, constants, and formal parameters. This is the
@@ -584,7 +584,7 @@ package Einfo is
 --    Class_Wide_Type (Node9)
 --       Defined in all type entities. For a tagged type or subtype, returns
 --       the corresponding implicitly declared class-wide type. For a
---       class-wide type, returns itself. Set to Empty for non-tagged types.
+--       class-wide type, returns itself. Set to Empty for untagged types.
 
 --    Cloned_Subtype (Node16)
 --       Defined in E_Record_Subtype and E_Class_Wide_Subtype entities.
@@ -937,7 +937,7 @@ package Einfo is
 --       Defined in E_Record_Type and E_Record_Subtype entities. Set in library
 --       level tagged type entities if we are generating statically allocated
 --       dispatch tables. Points to the list of dispatch table wrappers
---       associated with the tagged type. For a non-tagged record, contains
+--       associated with the tagged type. For an untagged record, contains
 --       No_Elist.
 
 --    DTC_Entity (Node16)
@@ -2795,7 +2795,7 @@ package Einfo is
 --    Is_Primitive (Flag218)
 --       Defined in overloadable entities and in generic subprograms. Set to
 --       indicate that this is a primitive operation of some type, which may
---       be a tagged type or a non-tagged type. Used to verify overriding
+--       be a tagged type or an untagged type. Used to verify overriding
 --       indicators in bodies.
 
 --    Is_Primitive_Wrapper (Flag195)
@@ -3474,7 +3474,7 @@ package Einfo is
 --
 --            Rec_Ext.Comp -> Rec_Ext.Parent. ... .Parent.Comp
 --
---       In base non-tagged types:
+--       In base untagged types:
 --         Always points to itself except for non-girder discriminants, where
 --         it points to the girder discriminant it renames.
 --
index b6d6b92b015a38659a4e3ddd2372ecd2bcc704e7..e63ebc009cc1326c535100a9d73502c657e49012 100644 (file)
@@ -772,14 +772,8 @@ package body Errutil is
             P := P - 1;
             Set_Msg_Insertion_Reserved_Word (Text, P);
 
-         --  Tilde: just remove '~' and do not modify the message further
-
-         --  This is peculiar, incompatible with errout, and not documented ???
-
          elsif C = '~' then
-            Set_Msg_Str
-              (Text (Text'First .. P - 2) & Text (P .. Text'Last));
-            exit;
+            Set_Msg_Str (Error_Msg_String (1 .. Error_Msg_Strlen));
 
          --  Normal character with no special treatment
 
index ea38e51a1ea8db8d045f8fdae4829f551c57f10d..44bac81bf37367ec6e02816f022b0d82e1162a29 100644 (file)
@@ -7271,8 +7271,20 @@ package body Exp_Ch3 is
       --  Check whether individual components have a defined invariant, and add
       --  the corresponding component invariant checks.
 
-      Insert_Component_Invariant_Checks
-        (N, Def_Id, Build_Record_Invariant_Proc (Def_Id, N));
+      --  Do not create an invariant procedure for some internally generated
+      --  subtypes, in particular those created for objects of a class-wide
+      --  type. Such types may have components to which invariant apply, but
+      --  the corresponding checks will be applied when an object of the parent
+      --  type is constructed.
+
+      --  Such objects will show up in a class-wide postcondition, and the
+      --  invariant will be checked, if necessary, upon return from the
+      --  enclosing subprogram.
+
+      if not Is_Class_Wide_Equivalent_Type (Def_Id) then
+         Insert_Component_Invariant_Checks
+           (N, Def_Id, Build_Record_Invariant_Proc (Def_Id, N));
+      end if;
    end Expand_Freeze_Record_Type;
 
    ------------------------------
index 59c42b007f9e593242202264eef022d9597ffc6c..1b50185fcf821bf59de9fa8e73f4836ada157341 100644 (file)
@@ -3678,7 +3678,7 @@ package body Exp_Disp is
       --  is frozen, enough must be known about it to build the activation
       --  record for it, which requires at least that the size of all
       --  parameters be known. Controlling arguments are by-reference,
-      --  and therefore the rule only applies to non-tagged types. Typical
+      --  and therefore the rule only applies to untagged types. Typical
       --  violation of the rule involves an object declaration that freezes a
       --  tagged type, when one of its primitive operations has a type in its
       --  profile whose full view has not been analyzed yet. More complex cases
index c8d544a337e959ff7f143f584ef38ffd39908927..c0bbfb882293dbd3c99f0d4a618ff1790bc5b2b0 100644 (file)
@@ -5330,7 +5330,7 @@ and whose type is potentially persistent. If no argument is given, then
 the pragma is a configuration pragma, and applies to all library level
 objects with no explicit initialization of potentially persistent types.
 
-A potentially persistent type is a scalar type, or a non-tagged,
+A potentially persistent type is a scalar type, or an untagged,
 non-discriminated record, all of whose components have no explicit
 initialization and are themselves of a potentially persistent type,
 or an array, all of whose constraints are static, and whose component
@@ -11136,7 +11136,7 @@ This restriction can be useful in providing an initial filter for code
 developed using SPARK 2005, or in examining legacy code to see how far
 it is from meeting SPARK restrictions.
 
-The list below summarises the checks that are performed when this
+The list below summarizes the checks that are performed when this
 restriction is in force:
 @itemize @bullet
 @item No block statements
@@ -11196,7 +11196,7 @@ restriction is in force:
 @item Modular type modulus must be power of 2
 @item Base not allowed on subtype mark
 @item Unary operators not allowed on modular types (except not)
-@item Non-tagged record cannot be null
+@item Untagged record cannot be null
 @item No class-wide operations
 @item Initialization expressions must respect SPARK restrictions
 @item Non-static ranges not allowed except in iteration schemes
index 9bc7e1dea996f7549e0443b005b0e7c5f47b243a..19c12de053d6663b537a5aa1fb0772a417552a72 100644 (file)
@@ -6212,11 +6212,19 @@ package body Prj.Nmsc is
 
                   exception
                      when Use_Error =>
+
+                        --  Output message with name of directory. Note that we
+                        --  use the ~ insertion method here in case the name
+                        --  has special characters in it.
+
+                        Error_Msg_Strlen := Full_Path_Name'Length;
+                        Error_Msg_String (1 .. Error_Msg_Strlen) :=
+                          Full_Path_Name.all;
                         Error_Msg
                           (Data.Flags,
-                           "~could not create " & Create &
-                           " directory " & Full_Path_Name.all,
-                           Location, Project);
+                           "could not create " & Create & " directory ~",
+                           Location,
+                           Project);
                   end;
                end if;
             end if;
index c40ddaba829276c91078641bd936f439f8d13825..bb539e2e17aa134a9252debadedf47ebc3ffefca 100644 (file)
@@ -131,7 +131,7 @@ package Sem_Aux is
    --  stored discriminants are the same as the actual discriminants of the
    --  type, and hence this function is the same as First_Discriminant.
    --
-   --  For derived non-tagged types that rename discriminants in the root type
+   --  For derived untagged types that rename discriminants in the root type
    --  this is the first of the discriminants that occur in the root type. To
    --  be precise, in this case stored discriminants are entities attached to
    --  the entity chain of the derived type which are a copy of the
index cce2a4803fff19653c0b093fdd097e8b526f228a..51cebd6364127f22071939ac4705e765d0d6b1f3 100644 (file)
@@ -7062,8 +7062,8 @@ package body Sem_Ch6 is
       Obj_Decl : Node_Id;
 
    begin
-      --  This check applies only if we have a subprogram declaration with a
-      --  non-tagged record type.
+      --  This check applies only if we have a subprogram declaration with an
+      --  untagged record type.
 
       if Nkind (Decl) /= N_Subprogram_Declaration
         or else not Is_Record_Type (Typ)
index f659b9859a1e9205f000bccbfb2bbf6f38bc22f3..d088e3eba6a6a8561ec5c7ad3fde9d43cc4f7aa3 100644 (file)
@@ -1236,7 +1236,7 @@ package Sem_Util is
    --  Used to test if AV is an acceptable formal for an OUT or IN OUT formal.
    --  Note that the Is_Variable function is not quite the right test because
    --  this is a case in which conversions whose expression is a variable (in
-   --  the Is_Variable sense) with a non-tagged type target are considered view
+   --  the Is_Variable sense) with an untagged type target are considered view
    --  conversions and hence variables.
 
    function Is_Partially_Initialized_Type
@@ -1260,7 +1260,7 @@ package Sem_Util is
 
    function Is_Potentially_Persistent_Type (T : Entity_Id) return Boolean;
    --  Determines if type T is a potentially persistent type. A potentially
-   --  persistent type is defined (recursively) as a scalar type, a non-tagged
+   --  persistent type is defined (recursively) as a scalar type, an untagged
    --  record whose components are all of a potentially persistent type, or an
    --  array with all static constraints whose component type is potentially
    --  persistent. A private type is potentially persistent if the full type
@@ -1371,7 +1371,7 @@ package Sem_Util is
       Use_Original_Node : Boolean := True) return Boolean;
    --  Determines if the tree referenced by N represents a variable, i.e. can
    --  appear on the left side of an assignment. There is one situation (formal
-   --  parameters) in which non-tagged type conversions are also considered
+   --  parameters) in which untagged type conversions are also considered
    --  variables, but Is_Variable returns False for such cases, since it has
    --  no knowledge of the context. Note that this is the point at which
    --  Assignment_OK is checked, and True is returned for any tree thus marked.