[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

(patch) remove-spark-part2 from gprbuild-2011



Hi! I take the Debian part of gprbuild and libxmlada4.1 from monotone ( Ada-France) and the source from Ada-Core :-)
The gprbuild is working now. Many Thanks!
Ah! I modified the sources for remove the adicional Spark code and made a patch attached in this email.

I use Debian Sid in Amd64 plataform :-)

UEBA!! Thaaannks!

--
"There are many plans in the Human heart, But
 is the Lord's Purpose that prevails"

"Existem Muitos planos e desejos no coração Humano, MAS
são os Propósitos do Senhor que prevalecem"

  []'s Dani:-)
--- gprbuild-2011-orig/gnat/restrict.ads	2011-04-19 07:05:48.000000000 -0300
+++ gprbuild-2011/gnat/restrict.ads	2011-08-27 06:15:08.944411317 -0300
@@ -174,34 +174,7 @@
      Table_Increment      => 200,
      Table_Name           => "Name_No_Dependence");
 
-   -------------------------------
-   -- SPARK Restriction Control --
-   -------------------------------
-
-   --  SPARK HIDE directives allow the effect of the SPARK restriction to be
-   --  turned off for a specified region of code, and the following tables are
-   --  the data structures used to keep track of these regions.
-
-   --  The table contains pairs of source locations, the first being the start
-   --  location for hidden region, and the second being the end location.
-
-   --  Note that the start location is included in the hidden region, while
-   --  the end location is excluded from it. (It typically corresponds to the
-   --  next token during scanning.)
-
-   type SPARK_Hide_Entry is record
-      Start : Source_Ptr;
-      Stop  : Source_Ptr;
-   end record;
-
-   package SPARK_Hides is new Table.Table (
-     Table_Component_Type => SPARK_Hide_Entry,
-     Table_Index_Type     => Natural,
-     Table_Low_Bound      => 1,
-     Table_Initial        => 100,
-     Table_Increment      => 200,
-     Table_Name           => "SPARK Hides");
-
+   
    -----------------
    -- Subprograms --
    -----------------
@@ -261,19 +234,7 @@
    --  elaboration routine. If elaboration code is not allowed, an error
    --  message is posted on the node given as argument.
 
-   procedure Check_SPARK_Restriction
-     (Msg   : String;
-      N     : Node_Id;
-      Force : Boolean := False);
-   --  Node N represents a construct not allowed in formal mode. If this is a
-   --  source node, or if the restriction is forced (Force = True), and the
-   --  SPARK restriction is set, then an error is issued on N. Msg is appended
-   --  to the restriction failure message.
-
-   procedure Check_SPARK_Restriction (Msg1, Msg2 : String; N : Node_Id);
-   --  Same as Check_SPARK_Restriction except there is a continuation message
-   --  Msg2 following the initial message Msg1.
-
+  
    procedure Check_Implicit_Dynamic_Code_Allowed (N : Node_Id);
    --  Tests to see if dynamic code generation (dynamically generated
    --  trampolines, in particular) is allowed by the current restrictions
@@ -322,10 +283,7 @@
    --  identifier, and if so returns the corresponding Restriction_Id value,
    --  otherwise returns Not_A_Restriction_Id.
 
-   function Is_In_Hidden_Part_In_SPARK (Loc : Source_Ptr) return Boolean;
-   --  Determine if given location is covered by a hidden region range in the
-   --  SPARK hides table.
-
+  
    function No_Exception_Handlers_Set return Boolean;
    --  Test to see if current restrictions settings specify that no exception
    --  handlers are present. This function is called by Gigi when it needs to
@@ -371,9 +329,7 @@
    --  individual Restrictions pragmas). Returns True only if all the required
    --  restrictions are set.
 
-   procedure Set_Hidden_Part_In_SPARK (Loc1, Loc2 : Source_Ptr);
-   --  Insert a new hidden region range in the SPARK hides table
-
+   
    procedure Set_Profile_Restrictions
      (P    : Profile_Name;
       N    : Node_Id;
--- gprbuild-2011-orig/gnat/restrict.adb	2011-04-19 07:05:48.000000000 -0300
+++ gprbuild-2011/gnat/restrict.adb	2011-08-27 06:15:11.817744652 -0300
@@ -105,69 +105,6 @@
       Check_Restriction (No_Elaboration_Code, N);
    end Check_Elaboration_Code_Allowed;
 
-   -----------------------------
-   -- Check_SPARK_Restriction --
-   -----------------------------
-
-   procedure Check_SPARK_Restriction
-     (Msg   : String;
-      N     : Node_Id;
-      Force : Boolean := False)
-   is
-      Msg_Issued          : Boolean;
-      Save_Error_Msg_Sloc : Source_Ptr;
-   begin
-      if Force or else Comes_From_Source (N) then
-
-         if Restriction_Check_Required (SPARK)
-           and then Is_In_Hidden_Part_In_SPARK (Sloc (N))
-         then
-            return;
-         end if;
-
-         --  Since the call to Restriction_Msg from Check_Restriction may set
-         --  Error_Msg_Sloc to the location of the pragma restriction, save and
-         --  restore the previous value of the global variable around the call.
-
-         Save_Error_Msg_Sloc := Error_Msg_Sloc;
-         Check_Restriction (Msg_Issued, SPARK, First_Node (N));
-         Error_Msg_Sloc := Save_Error_Msg_Sloc;
-
-         if Msg_Issued then
-            Error_Msg_F ("\\| " & Msg, N);
-         end if;
-      end if;
-   end Check_SPARK_Restriction;
-
-   procedure Check_SPARK_Restriction (Msg1, Msg2 : String; N : Node_Id) is
-      Msg_Issued          : Boolean;
-      Save_Error_Msg_Sloc : Source_Ptr;
-   begin
-      pragma Assert (Msg2'Length /= 0 and then Msg2 (Msg2'First) = '\');
-
-      if Comes_From_Source (N) then
-
-         if Restriction_Check_Required (SPARK)
-           and then Is_In_Hidden_Part_In_SPARK (Sloc (N))
-         then
-            return;
-         end if;
-
-         --  Since the call to Restriction_Msg from Check_Restriction may set
-         --  Error_Msg_Sloc to the location of the pragma restriction, save and
-         --  restore the previous value of the global variable around the call.
-
-         Save_Error_Msg_Sloc := Error_Msg_Sloc;
-         Check_Restriction (Msg_Issued, SPARK, First_Node (N));
-         Error_Msg_Sloc := Save_Error_Msg_Sloc;
-
-         if Msg_Issued then
-            Error_Msg_F ("\\| " & Msg1, N);
-            Error_Msg_F (Msg2, N);
-         end if;
-      end if;
-   end Check_SPARK_Restriction;
-
    -----------------------------------------
    -- Check_Implicit_Dynamic_Code_Allowed --
    -----------------------------------------
@@ -384,14 +321,7 @@
          return;
       end if;
 
-      --  In SPARK mode, issue an error for any use of class-wide, even if the
-      --  No_Dispatch restriction is not set.
-
-      if R = No_Dispatch then
-         Check_SPARK_Restriction ("class-wide is not allowed", N);
-      end if;
-
-      if UI_Is_In_Int_Range (V) then
+     if UI_Is_In_Int_Range (V) then
          VV := Integer (UI_To_Int (V));
       else
          VV := -1;
@@ -561,25 +491,6 @@
       return Not_A_Restriction_Id;
    end Get_Restriction_Id;
 
-   --------------------------------
-   -- Is_In_Hidden_Part_In_SPARK --
-   --------------------------------
-
-   function Is_In_Hidden_Part_In_SPARK (Loc : Source_Ptr) return Boolean is
-   begin
-      --  Loop through table of hidden ranges
-
-      for J in SPARK_Hides.First .. SPARK_Hides.Last loop
-         if SPARK_Hides.Table (J).Start <= Loc
-           and then Loc < SPARK_Hides.Table (J).Stop
-         then
-            return True;
-         end if;
-      end loop;
-
-      return False;
-   end Is_In_Hidden_Part_In_SPARK;
-
    -------------------------------
    -- No_Exception_Handlers_Set --
    -------------------------------
@@ -750,11 +661,7 @@
          Name_Buffer (1 .. S'Last) := S;
          Name_Len := S'Length;
 
-         if R = SPARK then
-            Set_All_Upper_Case;
-         else
-            Set_Casing (Identifier_Casing (Get_Source_File_Index (Sloc (N))));
-         end if;
+		 Set_Casing (Identifier_Casing (Get_Source_File_Index (Sloc (N))));
 
          Error_Msg_Strlen := Name_Len;
          Error_Msg_String (1 .. Name_Len) := Name_Buffer (1 .. Name_Len);
@@ -880,17 +787,6 @@
    end Same_Unit;
 
    ------------------------------
-   -- Set_Hidden_Part_In_SPARK --
-   ------------------------------
-
-   procedure Set_Hidden_Part_In_SPARK (Loc1, Loc2 : Source_Ptr) is
-   begin
-      SPARK_Hides.Increment_Last;
-      SPARK_Hides.Table (SPARK_Hides.Last).Start := Loc1;
-      SPARK_Hides.Table (SPARK_Hides.Last).Stop  := Loc2;
-   end Set_Hidden_Part_In_SPARK;
-
-   ------------------------------
    -- Set_Profile_Restrictions --
    ------------------------------
 

Reply to: