[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Thu, 4 Aug 2011 12:22:53 +0000 (14:22 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Thu, 4 Aug 2011 12:22:53 +0000 (14:22 +0200)
2011-08-04  Emmanuel Briot  <briot@adacore.com>

* make.adb: Remove debug trace.

2011-08-04  Vincent Celier  <celier@adacore.com>

* makeutl.adb (Do_Complete): Get the absolute path name of a relative
path in canonical form, to be able to compare path names on platforms
such as Windows or Darwin.

2011-08-04  Thomas Quinot  <quinot@adacore.com>

* par_sco.adb (Traverse_Declarations_Or_Statements.Set_Statement_Entry):
For a pragma (statement with C1 = 'P'), record the sloc of the pragma.
* scos.ads: Update documentation accordingly.
* put_scos.adb (Output_SCO_Line): Omit statement SCOs for disabled
pragmas.

From-SVN: r177369

gcc/ada/ChangeLog
gcc/ada/make.adb
gcc/ada/makeutl.adb
gcc/ada/par_sco.adb
gcc/ada/put_scos.adb
gcc/ada/scos.ads

index f0256d7..1214985 100644 (file)
@@ -1,3 +1,21 @@
+2011-08-04  Emmanuel Briot  <briot@adacore.com>
+
+       * make.adb: Remove debug trace.
+
+2011-08-04  Vincent Celier  <celier@adacore.com>
+
+       * makeutl.adb (Do_Complete): Get the absolute path name of a relative
+       path in canonical form, to be able to compare path names on platforms
+       such as Windows or Darwin.
+
+2011-08-04  Thomas Quinot  <quinot@adacore.com>
+
+       * par_sco.adb (Traverse_Declarations_Or_Statements.Set_Statement_Entry):
+       For a pragma (statement with C1 = 'P'), record the sloc of the pragma.
+       * scos.ads: Update documentation accordingly.
+       * put_scos.adb (Output_SCO_Line): Omit statement SCOs for disabled
+       pragmas.
+
 2011-08-04  Ed Schonberg  <schonberg@adacore.com>
 
        * sem_attr.adb (Bad_Attribute_For_Predicate): flag illegal use of
index 4bbb61a..b987462 100644 (file)
@@ -5695,9 +5695,6 @@ package body Make is
                Info := Mains.Next_Main;
                exit when Info = No_Main_Info;
 
-               Debug_Output ("MANU Got main: ", Name_Id (Info.File));
-               Debug_Output ("MANU    in project: ", Info.Project.Name);
-
                Proj := Ultimate_Extending_Project_Of (Info.Project);
 
                if Real_Main_Project = No_Project then
index f9d4d72..242df5e 100644 (file)
@@ -1452,7 +1452,8 @@ package body Makeutl is
                                            Normalize_Pathname
                                              (Name           => Main,
                                               Directory      => "",
-                                              Resolve_Links  => False);
+                                              Resolve_Links  => False,
+                                              Case_Sensitive => False);
                            begin
                               File.File := Create_Name (Absolute);
                               Main_Id := Create_Name (Base);
index 4e1e433..2feec9c 100644 (file)
@@ -765,7 +765,10 @@ package body Par_SCO is
 
       Index := Condition_Pragma_Hash_Table.Get (Loc);
 
-      --  The test here for zero is to deal with possible previous errors
+      --  The test here for zero is to deal with possible previous errors, and
+      --  for the case of pragma statement SCOs, for which we always set the
+      --  Pragma_Sloc even if the particular pragma cannot be specifically
+      --  disabled.
 
       if Index /= 0 then
          pragma Assert (SCO_Table.Table (Index).C1 = 'P');
@@ -1071,14 +1074,23 @@ package body Par_SCO is
             end if;
 
             declare
-               SCE : SC_Entry renames SC.Table (J);
+               SCE         : SC_Entry renames SC.Table (J);
+               Pragma_Sloc : Source_Ptr := No_Location;
             begin
+               --  For the statement SCO for a pragma, set Pragma_Sloc so that
+               --  the SCO can be omitted if the pragma is disabled.
+
+               if SCE.Typ = 'P' then
+                  Pragma_Sloc := SCE.From;
+               end if;
+
                Set_Table_Entry
-                 (C1   => C1,
-                  C2   => SCE.Typ,
-                  From => SCE.From,
-                  To   => SCE.To,
-                  Last => (J = SC_Last));
+                 (C1          => C1,
+                  C2          => SCE.Typ,
+                  From        => SCE.From,
+                  To          => SCE.To,
+                  Last        => (J = SC_Last),
+                  Pragma_Sloc => Pragma_Sloc);
             end;
          end loop;
 
index b716523..a1ee86e 100644 (file)
@@ -95,7 +95,8 @@ begin
             pragma Assert (Start <= Stop);
 
             Output_SCO_Line : declare
-               T : SCO_Table_Entry renames SCO_Table.Table (Start);
+               T            : SCO_Table_Entry renames SCO_Table.Table (Start);
+               Continuation : Boolean;
 
             begin
                case T.C1 is
@@ -103,11 +104,26 @@ begin
                   --  Statements
 
                   when 'S' =>
-                     Write_Info_Initiate ('C');
-                     Write_Info_Char ('S');
-
                      Ctr := 0;
+                     Continuation := False;
                      loop
+                        if SCO_Table.Table (Start).C2 = 'P'
+                             and then SCO_Pragma_Disabled
+                                        (SCO_Table.Table (Start).Pragma_Sloc)
+                        then
+                           goto Next_Statement;
+                        end if;
+
+                        if Ctr = 0 then
+                           Write_Info_Initiate ('C');
+                           if not Continuation then
+                              Write_Info_Char ('S');
+                              Continuation := True;
+                           else
+                              Write_Info_Char ('s');
+                           end if;
+                        end if;
+
                         Write_Info_Char (' ');
 
                         if SCO_Table.Table (Start).C2 /= ' ' then
@@ -115,22 +131,20 @@ begin
                         end if;
 
                         Output_Range (SCO_Table.Table (Start));
-                        exit when SCO_Table.Table (Start).Last;
 
-                        Start := Start + 1;
-                        pragma Assert (SCO_Table.Table (Start).C1 = 's');
+                        --  Increment entry counter (up to 6 entries per line,
+                        --  continuation lines are marked Cs).
 
                         Ctr := Ctr + 1;
-
-                        --  Up to 6 items on a line, if more than 6 items,
-                        --  continuation lines are marked Cs.
-
                         if Ctr = 6 then
                            Write_Info_Terminate;
-                           Write_Info_Initiate ('C');
-                           Write_Info_Char ('s');
                            Ctr := 0;
                         end if;
+
+                     <<Next_Statement>>
+                        exit when SCO_Table.Table (Start).Last;
+                        Start := Start + 1;
+                        pragma Assert (SCO_Table.Table (Start).C1 = 's');
                      end loop;
 
                      Write_Info_Terminate;
index 4039e4e..8799fbc 100644 (file)
@@ -355,8 +355,9 @@ package SCOs is
       Last : Boolean;
 
       Pragma_Sloc : Source_Ptr := No_Location;
-      --  For a SCO nested with a pragma Debug/Assert/PPC, location of pragma
-      --  (used for control of SCO output, value not recorded in ALI file).
+      --  For the statement SCO for a pragma, or for any expression SCO nested
+      --  in a pragma Debug/Assert/PPC, location of PRAGMA token (used for
+      --  control of SCO output, value not recorded in ALI file).
    end record;
 
    package SCO_Table is new GNAT.Table (