]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Tue, 6 Nov 2012 09:49:23 +0000 (10:49 +0100)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 6 Nov 2012 09:49:23 +0000 (10:49 +0100)
2012-11-06  Robert Dewar  <dewar@adacore.com>

* exp_prag.adb, impunit.adb, exp_ch9.adb, par-ch4.adb,
s-tarest.adb: Minor reformatting.

2012-11-06  Tristan Gingold  <gingold@adacore.com>

* s-tposen.ads: Minor comment update.

2012-11-06  Arnaud Charlet  <charlet@adacore.com>

* sysdep.c: Rename sig* wrappers to use unique names.

2012-11-06  Yannick Moy  <moy@adacore.com>

* exp_dbug.adb (Qualify_Entity_Name): Mark entity as having a qualified
name after being treated, in formal verification mode.

2012-11-06  Fedor Rybin  <frybin@adacore.com>

* gnat_ugn.texi: Updating gnattest section to reflect changes
in default behaviour of the tool.

From-SVN: r193215

gcc/ada/ChangeLog
gcc/ada/exp_ch9.adb
gcc/ada/exp_dbug.adb
gcc/ada/exp_prag.adb
gcc/ada/gnat_ugn.texi
gcc/ada/impunit.adb
gcc/ada/par-ch4.adb
gcc/ada/s-tarest.adb
gcc/ada/s-tposen.ads
gcc/ada/sysdep.c

index 3d1ba27bc49451801d11fb5d356521261bbcf951..e2b1c7e6d1b4012c61dfe7828cdf891e5b095d87 100644 (file)
@@ -1,3 +1,26 @@
+2012-11-06  Robert Dewar  <dewar@adacore.com>
+
+       * exp_prag.adb, impunit.adb, exp_ch9.adb, par-ch4.adb,
+       s-tarest.adb: Minor reformatting.
+
+2012-11-06  Tristan Gingold  <gingold@adacore.com>
+
+       * s-tposen.ads: Minor comment update.
+
+2012-11-06  Arnaud Charlet  <charlet@adacore.com>
+
+       * sysdep.c: Rename sig* wrappers to use unique names.
+
+2012-11-06  Yannick Moy  <moy@adacore.com>
+
+       * exp_dbug.adb (Qualify_Entity_Name): Mark entity as having a qualified
+       name after being treated, in formal verification mode.
+
+2012-11-06  Fedor Rybin  <frybin@adacore.com>
+
+       * gnat_ugn.texi: Updating gnattest section to reflect changes
+       in default behaviour of the tool.
+
 2012-11-06  Thomas Quinot  <quinot@adacore.com>
 
        * s-oscons-tmplt.c: Interfaces.C now needs to be WITH'd even
index f148e814cbb8ac20b8a1fd67b46dc79291bfcaf0..781de8695dc1341616efd16bcd87aba4762a2a7e 100644 (file)
@@ -14021,6 +14021,7 @@ package body Exp_Ch9 is
 
       declare
          Create_RE : RE_Id;
+
       begin
          if Restricted_Profile then
             if Partition_Elaboration_Policy = 'S' then
@@ -14031,6 +14032,7 @@ package body Exp_Ch9 is
          else
             Create_RE := RE_Create_Task;
          end if;
+
          Name := New_Reference_To (RTE (Create_RE), Loc);
       end;
 
index 9267982f85f280e081eed2e2788000d03851a63f..c034fe5cf6b2b95d6373fe47fda6d079577b7bbf 100644 (file)
@@ -1307,12 +1307,13 @@ package body Exp_Dbug is
       if Has_Qualified_Name (Ent) then
          return;
 
-      --  In formal verification mode, simply append a suffix for homonyms, but
-      --  do not mark the name as being qualified. We used to qualify entity
-      --  names as full expansion does, but this was removed as this prevents
-      --  the verification back-end from using a short name for debugging and
-      --  user interaction. The verification back-end already takes care of
-      --  qualifying names when needed.
+      --  In formal verification mode, simply append a suffix for homonyms.
+      --  We used to qualify entity names as full expansion does, but this was
+      --  removed as this prevents the verification back-end from using a short
+      --  name for debugging and user interaction. The verification back-end
+      --  already takes care of qualifying names when needed. Still mark the
+      --  name as being qualified, as Qualify_Entity_Name may be called more
+      --  than once on the same entity.
 
       elsif Alfa_Mode then
          if Has_Homonym (Ent) then
@@ -1322,6 +1323,7 @@ package body Exp_Dbug is
             Set_Chars (Ent, Name_Enter);
          end if;
 
+         Set_Has_Qualified_Name (Ent);
          return;
 
       --  If the entity is a variable encoding the debug name for an object
index ae743c39e84a9b620eae95f1f66decc8218c8e21..5ce2aa1b9855c9ef0eb48f64cc032e05694d8834 100644 (file)
@@ -819,20 +819,20 @@ package body Exp_Prag is
    --     Old_1  : <type of Incr_Expr>;
    --     Old_2  : <type of Decr_Expr>;
    --     Flag   : Boolean := False;
-   --
+
    --     for | while ... loop
    --        <preceding source statements>
-   --
+
    --        pragma Assert (<Invar_Expr>);
-   --
+
    --        if Flag then
    --           Old_1 := Curr_1;
    --           Old_2 := Curr_2;
    --        end if;
-   --
+
    --        Curr_1 := <Incr_Expr>;
    --        Curr_2 := <Decr_Expr>;
-   --
+
    --        if Flag then
    --           if Curr_1 /= Old_1 then
    --              pragma Assert (Curr_1 > Old_1);
@@ -842,7 +842,7 @@ package body Exp_Prag is
    --        else
    --           Flag := True;
    --        end if;
-   --
+
    --        <succeeding source statements>
    --     end loop;
 
@@ -886,7 +886,8 @@ package body Exp_Prag is
                  Make_Op_Gt (Loc,
                    Left_Opnd  => Curr_Val,
                    Right_Opnd => Old_Val);
-            else
+
+            else pragma Assert (Chars (Arg) = Name_Decreases);
                return
                  Make_Op_Lt (Loc,
                    Left_Opnd  => Curr_Val,
@@ -956,13 +957,11 @@ package body Exp_Prag is
              Object_Definition   =>
                New_Reference_To (Etype (Expr), Loop_Loc)));
 
-         --  Restore the original scope after all temporaries have been
-         --  analyzed.
+         --  Restore original scope after all temporaries have been analyzed
 
          Pop_Scope;
 
-         --  Step 3: Store the value of the expression from the previous
-         --  iteration.
+         --  Step 3: Store value of the expression from the previous iteration
 
          if No (Old_Assign) then
             Old_Assign := New_List;
@@ -990,8 +989,7 @@ package body Exp_Prag is
              Name       => New_Reference_To (Curr_Id, Loc),
              Expression => Relocate_Node (Expr)));
 
-         --  Step 5: Create the corresponding assertion to verify the change of
-         --  value.
+         --  Step 5: Create corresponding assertion to verify change of value
 
          --  Generate:
          --    pragma Assert (Curr <|> Old);
@@ -1137,6 +1135,8 @@ package body Exp_Prag is
                  Expression => New_Reference_To (Standard_True, Loc)))));
       end if;
 
+      --  Need a comment on this final rewrite ???
+
       Rewrite (N, Make_Null_Statement (Loc));
       Analyze (N);
    end Expand_Pragma_Loop_Assertion;
index 2455b880a7b7fbb4b69acb6b7cba232ea6af6cc0..330b818a6f4352750c23f087c6c659f129e50f85 100644 (file)
@@ -18348,6 +18348,22 @@ specifies the directory that will hold the harness packages and project file
 for the test driver. If the @var{dirname} is a relative path, it is considered
 relative to the object directory of the project file.
 
+@item --separates
+@cindex @option{--separates} (@command{gnattest})
+Bodies of all test routines are generated as separates. This option is
+temporarily provided for compatibility to support the old way of generating test
+skeletons. Its usage is not recommended because at some point the option will be
+abandoned together with this way of generating test packages.
+
+
+@item --transition
+@cindex @option{--transition} (@command{gnattest})
+This allows transition from separate test routines to monolith test packages.
+All matching test routines are overwritten with contents of corresponding
+separates. Note that if separate test routines had any manually added with
+clauses they will be moved to the test package body as is and have to be moved
+by hand.
+
 @end table
 
 @option{--tests_root}, @option{--subdir} and @option{--tests-dir} switches are
@@ -18432,8 +18448,11 @@ is located in:
 For each package containing visible subprograms, a child test package is
 generated. It contains one test routine per tested subprogram. Each
 declaration of a test subprogram has a comment specifying which tested
-subprogram it corresponds to. All of the test routines have separate bodies.
-The test routine located at simple-test_data-tests-test_inc_5eaee3.adb contains
+subprogram it corresponds to. Bodies of test routines are placed in test package
+bodies and are surrounded by special comment sections. Those comment sections
+should not be removed or modified in order for gnattest to be able to regenerate
+test packages and keep already written tests in place.
+The test routine Test_Inc_5eaee3 located at simple-test_data-tests.adb contains
 a single statement: a call to procedure Assert. It has two arguments:
 the Boolean expression we want to check and the diagnosis message to display if
 the condition is false.
@@ -18469,8 +18488,9 @@ values can be set by Set_Up routine and used in test routines afterwards.
 
 Bodies of test routines and test_data packages are never overridden after they
 have been created once. As long as the name of the subprogram, full expanded Ada
-names, and the order of its parameters is the same, the old test routine will
-fit in its place and no test skeleton will be generated for the subprogram.
+names, and the order of its parameters is the same, and comment sections are
+intact the old test routine will fit in its place and no test skeleton will be
+generated for the subprogram.
 
 This can be demonstrated with the previous example. By uncommenting declaration
 and body of function Dec in simple.ads and simple.adb, running
@@ -18487,7 +18507,7 @@ the old test is not replaced with a stub, nor is it lost, but a new test
 skeleton is created for function Dec.
 
 The only way of regenerating tests skeletons is to remove the previously created
-tests.
+tests together with corresponding comment sections.
 
 @node Default Test Behavior
 @section Default Test Behavior
@@ -18615,7 +18635,7 @@ Gnattest has a special option to run overridden parent tests against objects
 of the type which have overriding primitives:
 
 @smallexample
-gnattest --harness-dir=driver --liskov -Ptagged_rec.gpr
+gnattest --harness-dir=driver --validate-type-extensions -Ptagged_rec.gpr
 cd driver
 gprbuild -Ptest_driver
 test_runner
index ad4902a3ab6882527da3668dc926403e981dce70..efeb8960a4e334406e37ddc72748e00e4649ce28 100644 (file)
@@ -663,11 +663,14 @@ package body Impunit is
          return Not_Predefined_Unit;
       end if;
 
-      --  Not predefined if file name does not end in .ads or .adb. This can
-      --  happen when non-standard file names are being used. Calling this
-      --  function on a .adb file is used in GNATprove to detect when a
-      --  construct comes from an instance of a generic defined in a predefined
-      --  unit.
+      --  To be considered predefined, the file name must end in .ads or .adb.
+      --  File names with other extensions (coming from the use of non-standard
+      --  file naming schemes) can never be predefined.
+
+      --  Note that in the context of a compiler, the .adb case will never
+      --  arise. However it can arise for other tools, e.g. gnatprove uses
+      --  this routine to detect when a construct comes from an instance of
+      --  a generic defined in a predefined unit.
 
       if Name_Buffer (Name_Len - 3 .. Name_Len) /= ".ads"
            and then
index c3a7a4a3192e2e5eb193db1730157d29f28a33da..3cb65791a22eaf87b12b9e428196656b8a213fc9 100644 (file)
@@ -2359,11 +2359,14 @@ package body Ch4 is
    --  Error recovery: can raise Error_Resync
 
    function P_Primary return Node_Id is
-      Lparen     : constant Boolean := Prev_Token = Tok_Left_Paren;
-
       Scan_State : Saved_Scan_State;
       Node1      : Node_Id;
 
+      Lparen : constant Boolean := Prev_Token = Tok_Left_Paren;
+      --  Remember if previous token is a left parenthesis. This is used to
+      --  deal with checking whether IF/CASE/FOR expressions appearing as
+      --  primaries require extra parenthesization.
+
    begin
       --  The loop runs more than once only if misplaced pragmas are found
       --  or if a misplaced unary minus is skipped.
@@ -2537,7 +2540,6 @@ package body Ch4 is
             --  For [all | some]  indicates a quantified expression
 
             when Tok_For =>
-
                if Token_Is_At_Start_Of_Line then
                   Error_Msg_AP ("misplaced loop");
                   return Error;
@@ -2553,10 +2555,9 @@ package body Ch4 is
 
                   return Node1;
 
-               else
-
                --  Otherwise treat as misused identifier
 
+               else
                   return P_Identifier;
                end if;
 
index ec94313f1868a762d5d9a63b9abe81d6f91cf7b6..e2a75e0c04c6581dc35f49438a907e2e15ca2198 100644 (file)
@@ -618,11 +618,12 @@ package body System.Tasking.Restricted.Stages is
       Elaborated    : Access_Boolean;
       Chain         : in out Activation_Chain;
       Task_Image    : String;
-      Created_Task  : Task_Id) is
+      Created_Task  : Task_Id)
+   is
    begin
-      Create_Restricted_Task (Priority, Stack_Address, Size, Task_Info,
-                              CPU, State, Discriminants, Elaborated,
-                              Task_Image, Created_Task);
+      Create_Restricted_Task
+        (Priority, Stack_Address, Size, Task_Info, CPU, State,
+         Discriminants, Elaborated, Task_Image, Created_Task);
 
       --  Append this task to the activation chain
 
index 8c07cfd3ac9f38d0d0939dc70b3892ac691b18a6..58c6d6d62a5b3b60f3d3c82a3b8a0b2491acb949 100644 (file)
@@ -163,7 +163,6 @@ package System.Tasking.Protected_Objects.Single_Entry is
    --     procedure _clean is
    --     begin
    --        service_entry (_object._object'unchecked_access);
-   --        unlock_entry (_object._object'unchecked_access);
    --        return;
    --     end _clean;
    --  begin
index 62a96ddea55e01708a0d0f964300dd044993d5ba..a2c4d8607bc083c39134d01b1a7076c4e553bd99 100644 (file)
@@ -933,47 +933,35 @@ __gnat_is_file_not_found_error (int errno_val) {
 /* Provide extern symbols for sig* as needed by the tasking run-time, instead
    of static inline functions.  */
 
-#define sigismember android_sigismember
-#define sigaddset android_sigaddset
-#define sigdelset android_sigdelset
-#define sigemptyset android_sigemptyset
-#define sigfillset android_sigfillset
-
 #include <signal.h>
 
-#undef sigismember
-#undef sigaddset
-#undef sigdelset
-#undef sigemptyset
-#undef sigfillset
-
 int
-sigismember (sigset_t *set, int signum)
+_sigismember (sigset_t *set, int signum)
 {
-    return android_sigismember (set, signum);
+    return sigismember (set, signum);
 }
 
 int
-sigaddset (sigset_t *set, int signum)
+_sigaddset (sigset_t *set, int signum)
 {
-   return android_sigaddset (set, signum);
+   return sigaddset (set, signum);
 }
 
 int
-sigdelset (sigset_t *set, int signum)
+_sigdelset (sigset_t *set, int signum)
 {
-   return android_sigdelset (set, signum);
+   return sigdelset (set, signum);
 }
 
 int
-sigemptyset (sigset_t *set)
+_sigemptyset (sigset_t *set)
 {
-    return android_sigemptyset (set);
+    return sigemptyset (set);
 }
 
 int
-sigfillset(sigset_t *set)
+_sigfillset(sigset_t *set)
 {
-    return android_sigfillset (set);
+    return sigfillset (set);
 }
 #endif