Changeset 2634

Show
Ignore:
Timestamp:
02/25/08 17:55:16 (11 months ago)
Author:
ogorod
Message:

implemented Elaboration_Order

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tendra/src/producers/ada/asis/asis-compilation_units-relations.adb

    r2630 r2634  
    4747         return Boolean; 
    4848 
     49      function Append 
     50        (List : in Compilation_Unit_List_Access; 
     51         Unit : in Compilation_Unit) 
     52         return Compilation_Unit_List_Access; 
     53 
     54      function Append 
     55        (List  : in Compilation_Unit_List_Access; 
     56         Units : in Compilation_Unit_List) 
     57         return Compilation_Unit_List_Access; 
     58 
     59      procedure Remove_From_List 
     60        (List : in out Compilation_Unit_List_Access; 
     61         Unit : in     Compilation_Unit); 
     62 
    4963      procedure Remove_From_List 
    5064        (List : in out Compilation_Unit_List; 
    5165         From : in     List_Index; 
    5266         Unit : in     Compilation_Unit); 
    53  
    54       function Append 
    55         (List : in Compilation_Unit_List_Access; 
    56          Unit : in Compilation_Unit) 
    57          return Compilation_Unit_List_Access; 
    58  
    59       function Append 
    60         (List  : in Compilation_Unit_List_Access; 
    61          Units : in Compilation_Unit_List) 
    62          return Compilation_Unit_List_Access; 
    6367 
    6468      -- Tree -- 
     
    238242         Body_Elaborated : Boolean := False; 
    239243 
    240          Internal_Pure : Extended_Boolean := Unknown; 
     244         Internal_Pure           : Extended_Boolean := Unknown; 
     245         Internal_Preelaborate   : Extended_Boolean := Unknown; 
     246         Internal_Spec_With_Body : Extended_Boolean := Unknown; 
    241247      end record; 
    242248 
     
    247253        (This : in Tree_Node_Access) 
    248254         return Boolean; 
     255 
     256      function Is_Preelaborate 
     257        (This : in Tree_Node_Access) 
     258         return Boolean; 
     259 
     260      function Is_Elaborate_Body 
     261        (This : in Tree_Node_Access) 
     262         return Boolean; 
     263 
     264      procedure Retrive_Pragmas 
     265        (This : in Tree_Node_Access); 
    249266 
    250267      -- Root_Tree -- 
     
    467484 
    468485   ------------------------- 
    469    --  Elaboration_Order  -- * 
     486   --  Elaboration_Order  -- 
    470487   ------------------------- 
    471488 
     
    25162533         Unit : in Compilation_Unit) 
    25172534      is 
    2518          New_Node : Tree_Node_Access := new Tree_Node; 
    2519       begin 
    2520          New_Node.Unit := Unit; 
    2521  
    2522          if This.Last_Node = null then 
    2523             This.Next := Add_Node (This.Next, New_Node.Self); 
    2524          else 
    2525             This.Last_Node.Next := Add_Node 
    2526                (This.Last_Node.Next, New_Node.Self); 
    2527  
    2528             New_Node.Prevs := Add_Node 
    2529                (New_Node.Prevs, This.Last_Node.Self); 
    2530          end if; 
    2531  
    2532          This.Last_Node := New_Node; 
     2535      begin 
     2536         if Find (This, Unit) /= null then 
     2537            Asis.Implementation.Set_Status 
     2538              (Asis.Errors.Internal_Error, 
     2539               "Elaboration order dublicate unit: " & Unit_Full_Name (Unit)); 
     2540 
     2541            raise Asis.Exceptions.ASIS_Failed; 
     2542         end if; 
     2543 
     2544         declare 
     2545            New_Node : Tree_Node_Access := new Tree_Node; 
     2546         begin 
     2547            New_Node.Unit := Unit; 
     2548 
     2549            if This.Last_Node = null then 
     2550               This.Next := Add_Node (This.Next, New_Node.Self); 
     2551            else 
     2552               This.Last_Node.Next := Add_Node 
     2553                  (This.Last_Node.Next, New_Node.Self); 
     2554 
     2555               New_Node.Prevs := Add_Node 
     2556                  (New_Node.Prevs, This.Last_Node.Self); 
     2557            end if; 
     2558 
     2559            This.Last_Node := New_Node; 
     2560            This.Units := Add_Node_Ordered (This.Units, New_Node.Self); 
     2561         end; 
    25332562      end Append; 
    25342563 
     
    25762605            if Prev_Node = To_Node then 
    25772606               if Circular /= null then 
     2607 
    25782608                  for Index in reverse Circular.all'Range loop 
    25792609                     Node.Circular := Append (Node.Circular, Circular (Index)); 
     
    25812611 
    25822612                  Node.Circular := Append (Node.Circular, Node.Unit); 
     2613                  Node.Circular := Append (Node.Circular, Circular (Circular.all'Last)); 
    25832614 
    25842615                  Deallocate (Circular); 
     
    25862617                  --  2 pair (self and parent) 
    25872618                  Node.Circular := Append 
    2588                     (Node.Circular, (Prev_Node.Unit, Node.Unit)); 
     2619                    (Node.Circular, (Prev_Node.Unit, Node.Unit, Prev_Node.Unit)); 
    25892620               end if; 
    25902621 
     
    31723203               Node.Circular_Added := True; 
    31733204 
    3174                for Index in Node.Circular.all'Range loop 
     3205               for Index in 
     3206                  Node.Circular.all'First .. Node.Circular.all'Last - 1 
     3207               loop 
    31753208                  Circular_List := Append 
    3176                     (Circular_List, Node.Circular.all (Index)); 
    3177  
    3178                   if Index < Node.Circular.all'Last then 
    3179                      Circular_List := Append 
    3180                        (Circular_List, Node.Circular.all (Index + 1)); 
    3181                   else 
    3182                      Circular_List := Append 
    3183                        (Circular_List, Node.Circular.all (1)); 
    3184                   end if; 
     3209                    (Circular_List, (Node.Circular.all (Index), 
     3210                                     Node.Circular.all (Index + 1)) 
     3211                    ); 
    31853212               end loop; 
    31863213            end if; 
     
    33583385      ----------------------------- 
    33593386 
    3360 --      An_Elaborate_Pragma,              --  10.2.1(20) 
    3361 --      An_Elaborate_All_Pragma,          --  10.2.1(21) 
    3362 --      An_Elaborate_Body_Pragma,         --  10.2.1(22) 
    33633387--      A_Partition_Elaboration_Policy_Pragma,   --  H.6 (3) 
    33643388--      A_Preelaborable_Initialization_Pragma,   --  7.6 (5) 
    3365 --      A_Preelaborate_Pragma,            --  10.2.1(3) 
    3366 --      A_Pure_Pragma,                    --  10.2.1(14) 
    33673389 
    33683390      function Create_Elaboration_Tree 
     
    33713393         return Root_Tree_Access 
    33723394      is 
    3373          procedure Process_Pure 
     3395         procedure Process_Pure_Spec 
     3396           (Node : in Tree_Node_Access); 
     3397 
     3398         procedure Process_Pure_Body 
    33743399            (Node : in Tree_Node_Access); 
     3400 
     3401         procedure Process_Preelaborate_Spec 
     3402           (Node : in Tree_Node_Access); 
     3403 
     3404         procedure Process_Preelaborate_Body 
     3405           (Node : in Tree_Node_Access); 
     3406 
     3407         procedure Process_Spec 
     3408           (Node : in Tree_Node_Access); 
     3409 
     3410         procedure Process_Body 
     3411            (Node : in Tree_Node_Access); 
     3412 
     3413         procedure Elab_Spec 
     3414           (Node : in Tree_Node_Access); 
     3415 
     3416         procedure Elab_Body 
     3417           (Node      : in Tree_Node_Access; 
     3418            All_Bodys : in Boolean := False); 
     3419 
     3420         procedure Elab_Subunits 
     3421           (Node : in Tree_Node_Access); 
     3422 
     3423         procedure Elab_Pragmed_Bodys 
     3424           (Node : in Tree_Node_Access; 
     3425            Unit : in Compilation_Unit); 
    33753426 
    33763427         Result : Root_Tree_Access := new Root_Tree; 
     
    33813432            Library_Unit_Declaration ("Standard", The_Context); 
    33823433 
    3383          -- Process_Pure -- 
    3384          procedure Process_Pure 
     3434         -- for circular elaboration order 
     3435         Elaboration_Line : Compilation_Unit_List_Access := null; 
     3436 
     3437         procedure Elab_Spec 
    33853438            (Node : in Tree_Node_Access) 
    33863439         is 
    3387             -- A_Pure_Pragma 
     3440         begin 
     3441            if not Node.Elaborated 
     3442              and then Node.Consistent 
     3443              and then not Is_Nil (Node.Unit) 
     3444              and then Unit_Kind (Node.Unit) in 
     3445                A_Procedure .. A_Generic_Package_Renaming 
     3446            then 
     3447               if Elaboration_Line /= null then 
     3448                  -- test circular -- 
     3449                  if In_List 
     3450                     (Elaboration_Line, Elaboration_Line.all'Last, Node.Unit) 
     3451                  then 
     3452                     Node.Circular :=  Append 
     3453                        (Node.Circular, Elaboration_Line.all); 
     3454                     return; 
     3455                  end if; 
     3456               end if; 
     3457 
     3458               Elaboration_Line := Append 
     3459                  (Elaboration_Line, Node.Unit); 
     3460 
     3461               if Node.Next /= null then 
     3462                  for Index in Node.Next.all'Range loop 
     3463                     Elab_Spec (Node.Next (Index)); 
     3464                  end loop; 
     3465               end if; 
     3466 
     3467               Elab_Pragmed_Bodys (Node, Node.Unit); 
     3468 
     3469               Append (Result, Node.Unit); 
     3470               Node.Elaborated := True; 
     3471               Remove_From_List (Elaboration_Line, Node.Unit); 
     3472            end if; 
     3473 
     3474            if Is_Elaborate_Body (Node) then 
     3475               --  An_Elaborate_Body_Pragma --  10.2.1(22) 
     3476               Elab_Body (Node); 
     3477            end if; 
     3478         end Elab_Spec; 
     3479 
     3480         -- Elab_Body -- 
     3481         procedure Elab_Body 
     3482           (Node      : in Tree_Node_Access; 
     3483            All_Bodys : in Boolean := False) 
     3484         is 
     3485            Unit : Compilation_Unit := Nil_Compilation_Unit; 
     3486         begin 
     3487            if not Node.Body_Elaborated 
     3488            then 
     3489               if not Is_Nil (Node.Unit_Body) 
     3490                 and then Node.Body_Consistent 
     3491               then 
     3492                  Unit := Node.Unit_Body; 
     3493 
     3494               elsif not Is_Nil (Node.Unit) 
     3495                 and then Node.Consistent 
     3496               then 
     3497                  Unit := Node.Unit; 
     3498               end if; 
     3499 
     3500               if Unit_Kind (Unit) in 
     3501                 A_Procedure_Body .. A_Protected_Body_Subunit 
     3502               then 
     3503                  if Elaboration_Line /= null then 
     3504                     -- test circular -- 
     3505                     if In_List 
     3506                        (Elaboration_Line, Elaboration_Line.all'Last, Unit) 
     3507                     then 
     3508                        Node.Circular :=  Append 
     3509                           (Node.Circular, Elaboration_Line.all); 
     3510                        return; 
     3511                     end if; 
     3512                  end if; 
     3513 
     3514                  Elaboration_Line := Append (Elaboration_Line, Unit); 
     3515 
     3516                  if Node.Body_Dependences /= null then 
     3517                     for Index in Node.Body_Dependences.all'Range loop 
     3518                        Elab_Spec (Node.Body_Dependences (Index)); 
     3519                     end loop; 
     3520                  end if; 
     3521 
     3522                  Elab_Pragmed_Bodys (Node, Unit); 
     3523 
     3524                  if All_Bodys then 
     3525                     if Node.Body_Dependences /= null then 
     3526                        for Index in Node.Body_Dependences.all'Range loop 
     3527                           Elab_Body (Node.Body_Dependences (Index), True); 
     3528                        end loop; 
     3529                     end if; 
     3530                  end if; 
     3531 
     3532                  Append (Result, Unit); 
     3533 
     3534                  if Is_Identical (Unit, Node.Unit_Body) then 
     3535                     Node.Body_Elaborated := True; 
     3536                  else 
     3537                     Node.Elaborated := True; 
     3538                  end if; 
     3539 
     3540                  Remove_From_List (Elaboration_Line, Unit); 
     3541               end if; 
     3542            end if; 
     3543 
     3544            Elab_Subunits (Node); 
     3545         end Elab_Body; 
     3546 
     3547         -- Elab_Subunits -- 
     3548         procedure Elab_Subunits 
     3549           (Node : in Tree_Node_Access) 
     3550         is 
     3551            Next_Node : Tree_Node_Access; 
     3552         begin 
     3553            if not Node.Body_Elaborated then 
     3554               return; 
     3555            end if; 
     3556 
     3557            if Node.Prevs /= null then 
     3558               for Index in Node.Prevs.all'Range loop 
     3559                  Next_Node := Node.Prevs (Index); 
     3560 
     3561                  if Unit_Kind (Next_Node.Unit) in 
     3562                    A_Procedure_Body_Subunit .. A_Protected_Body_Subunit 
     3563                  then 
     3564                     Elab_Body (Next_Node); 
     3565                  end if; 
     3566               end loop; 
     3567            end if; 
     3568         end Elab_Subunits; 
     3569 
     3570         -- Elab_Pragmed_Bodys -- 
     3571         procedure Elab_Pragmed_Bodys 
     3572           (Node : in Tree_Node_Access; 
     3573            Unit : in Compilation_Unit) 
     3574         is 
     3575            --  An_Elaborate_Pragma     --  10.2.1(20) 
     3576            --  An_Elaborate_All_Pragma --  10.2.1(21) 
     3577 
     3578            use Asis.Elements; 
     3579            With_List : constant Asis.Context_Clause_List := 
     3580               Context_Clause_Elements (Unit, True); 
     3581 
     3582            El : Element; 
     3583            Internal_Unit : Compilation_Unit; 
     3584         begin 
     3585            for Index in With_List'Range loop 
     3586               El := With_List (Index); 
     3587 
     3588               if Element_Kind (El) = A_Pragma then 
     3589                  if Pragma_Kind (El) = An_Elaborate_Pragma then 
     3590                     Internal_Unit := Get_Compilation_Unit 
     3591                        (Unit, With_List (Index), Index, The_Context); 
     3592 
     3593                     Elab_Body (Find (Result, Internal_Unit)); 
     3594 
     3595                  elsif Pragma_Kind (El) = An_Elaborate_All_Pragma then 
     3596                     Internal_Unit := Get_Compilation_Unit 
     3597                        (Unit, With_List (Index), Index, The_Context); 
     3598 
     3599                     Elab_Body (Find (Result, Internal_Unit), True); 
     3600                  end if; 
     3601               end if; 
     3602            end loop; 
     3603         end Elab_Pragmed_Bodys; 
     3604 
     3605         -- Process_Pure_Spec -- 
     3606         procedure Process_Pure_Spec 
     3607            (Node : in Tree_Node_Access) 
     3608         is 
     3609            -- A_Pure_Pragma --  10.2.1(14) 
    33883610         begin 
    33893611            if not Node.Elaborated 
     
    33913613            then 
    33923614               if Is_Pure (Node) then 
    3393                   Append (Result, Node.Unit); 
    3394                   Node.Elaborated := True; 
     3615                  Elab_Spec (Node); 
    33953616               end if; 
    33963617            end if; 
     
    33983619            if Node.Prevs /= null then 
    33993620               for Index in Node.Prevs.all'Range loop 
    3400                   Process_Pure (Node.Prevs (Index)); 
     3621                  Process_Pure_Spec (Node.Prevs (Index)); 
    34013622               end loop; 
    34023623            end if; 
    3403          end Process_Pure; 
     3624         end Process_Pure_Spec; 
     3625 
     3626         -- Process_Pure_Body -- 
     3627         procedure Process_Pure_Body 
     3628            (Node : in Tree_Node_Access) 
     3629         is 
     3630            -- A_Pure_Pragma --  10.2.1(14) 
     3631         begin 
     3632            if Is_Pure (Node) then 
     3633               Elab_Body (Node); 
     3634            end if; 
     3635 
     3636            if Node.Prevs /= null then 
     3637               for Index in Node.Prevs.all'Range loop 
     3638                  Process_Pure_Body (Node.Prevs (Index)); 
     3639               end loop; 
     3640            end if; 
     3641         end Process_Pure_Body; 
     3642 
     3643         -- Process_Preelaborate_Spec -- 
     3644         procedure Process_Preelaborate_Spec 
     3645           (Node : in Tree_Node_Access) 
     3646         is 
     3647            -- A_Preelaborate_Pragma --  10.2.1(3) 
     3648         begin 
     3649            if not Node.Elaborated 
     3650              and then not Is_Nil (Node.Unit) 
     3651            then 
     3652               if Is_Preelaborate (Node) then 
     3653                  Elab_Spec (Node); 
     3654               end if; 
     3655            end if; 
     3656 
     3657            if Node.Prevs /= null then 
     3658               for Index in Node.Prevs.all'Range loop 
     3659                  Process_Preelaborate_Spec (Node.Prevs (Index)); 
     3660               end loop; 
     3661            end if; 
     3662         end Process_Preelaborate_Spec; 
     3663 
     3664         -- Process_Preelaborate_Body -- 
     3665         procedure Process_Preelaborate_Body 
     3666           (Node : in Tree_Node_Access) 
     3667         is 
     3668            -- A_Preelaborate_Pragma --  10.2.1(3) 
     3669         begin 
     3670            if Is_Preelaborate (Node) then 
     3671               Elab_Body (Node); 
     3672            end if; 
     3673 
     3674            if Node.Prevs /= null then 
     3675               for Index in Node.Prevs.all'Range loop 
     3676                  Process_Preelaborate_Body (Node.Prevs (Index)); 
     3677               end loop; 
     3678            end if; 
     3679         end Process_Preelaborate_Body; 
     3680 
     3681         -- Process_Spec -- 
     3682         procedure Process_Spec 
     3683            (Node : in Tree_Node_Access) 
     3684         is 
     3685         begin 
     3686            if not Node.Elaborated 
     3687              and then not Is_Nil (Node.Unit) 
     3688            then 
     3689               Elab_Spec (Node); 
     3690            end if; 
     3691 
     3692            if Node.Prevs /= null then 
     3693               for Index in Node.Prevs.all'Range loop 
     3694                  Process_Spec (Node.Prevs (Index)); 
     3695               end loop; 
     3696            end if; 
     3697         end Process_Spec; 
     3698 
     3699         -- Process_Body -- 
     3700         procedure Process_Body 
     3701            (Node : in Tree_Node_Access) 
     3702         is 
     3703         begin 
     3704            Elab_Body (Node); 
     3705 
     3706            if Node.Prevs /= null then 
     3707               for Index in Node.Prevs.all'Range loop 
     3708                  Process_Body (Node.Prevs (Index)); 
     3709               end loop; 
     3710            end if; 
     3711         end Process_Body; 
    34043712 
    34053713      begin 
     
    34093717         Append (Result, Std); 
    34103718 
    3411          if Root_Node.Prevs /= null then 
    3412             for Index in Root_Node.Prevs.all'Range loop 
    3413                Process_Pure (Root_Node.Prevs (Index)); 
    3414             end loop; 
    3415          end if; 
     3719         if Root_Node.Prevs = null then 
     3720            return Result; 
     3721         end if; 
     3722 
     3723         for Index in Root_Node.Prevs.all'Range loop 
     3724            Deallocate (Elaboration_Line); 
     3725            Process_Pure_Spec (Root_Node.Prevs (Index)); 
     3726         end loop; 
     3727 
     3728         for Index in Root_Node.Prevs.all'Range loop 
     3729            Deallocate (Elaboration_Line); 
     3730            Process_Pure_Body (Root_Node.Prevs (Index)); 
     3731         end loop; 
     3732 
     3733         for Index in Root_Node.Prevs.all'Range loop 
     3734            Deallocate (Elaboration_Line); 
     3735            Process_Preelaborate_Spec (Root_Node.Prevs (Index)); 
     3736         end loop; 
     3737 
     3738         for Index in Root_Node.Prevs.all'Range loop 
     3739            Deallocate (Elaboration_Line); 
     3740            Process_Preelaborate_Body (Root_Node.Prevs (Index)); 
     3741         end loop; 
     3742 
     3743         for Index in Root_Node.Prevs.all'Range loop 
     3744            Deallocate (Elaboration_Line); 
     3745            Process_Spec (Root_Node.Prevs (Index)); 
     3746         end loop; 
     3747 
     3748         for Index in Root_Node.Prevs.all'Range loop 
     3749            Deallocate (Elaboration_Line); 
     3750            Process_Body (Root_Node.Prevs (Index)); 
     3751         end loop; 
    34163752 
    34173753         return Result; 
     
    34323768      begin 
    34333769         if This.Internal_Pure = Unknown then 
    3434             if not Is_Nil (This.Unit) then 
    3435                declare 
    3436                   Pragma_List : constant Asis.Pragma_Element_List := 
    3437                      Corresponding_Pragmas (This.Unit.all); 
    3438                begin 
    3439                   for Index in Pragma_List'Range loop 
    3440                      if Pragma_Kind (Pragma_List (Index).all) = A_Pure_Pragma 
    3441                      then 
    3442                         This.Internal_Pure := Extended_True; 
    3443                         exit; 
    3444                      else 
    3445                         Ada.Wide_Text_IO.Put_Line 
    3446                            (Pragma_Kinds'Wide_Image (Pragma_Kind (Pragma_List (Index).all))); 
    3447                      end if; 
    3448                   end loop; 
    3449                end; 
    3450             end if; 
    3451  
    3452             if This.Internal_Pure = Unknown then 
    3453                This.Internal_Pure := Extended_False; 
    3454             end if; 
     3770            Retrive_Pragmas (This); 
    34553771         end if; 
    34563772 
     
    34613777         end if; 
    34623778      end Is_Pure; 
     3779 
     3780      --------------------- 
     3781      -- Is_Preelaborate -- 
     3782      --------------------- 
     3783 
     3784      function Is_Preelaborate 
     3785        (This : in Tree_Node_Access) 
     3786         return Boolean 
     3787      is 
     3788      begin 
     3789         if This.Internal_Preelaborate = Unknown then 
     3790            Retrive_Pragmas (This); 
     3791         end if; 
     3792 
     3793         if This.Internal_Preelaborate = Extended_True then 
     3794            return True; 
     3795         else 
     3796            return False; 
     3797         end if; 
     3798      end Is_Preelaborate; 
     3799 
     3800      ----------------------- 
     3801      -- Is_Elaborate_Body -- 
     3802      ----------------------- 
     3803 
     3804      function Is_Elaborate_Body 
     3805        (This : in Tree_Node_Access) 
     3806         return Boolean 
     3807      is 
     3808      begin 
     3809         if This.Internal_Spec_With_Body = Unknown then 
     3810            Retrive_Pragmas (This); 
     3811         end if; 
     3812 
     3813         if This.Internal_Spec_With_Body = Extended_True then 
     3814            return True; 
     3815         else 
     3816            return False; 
     3817         end if; 
     3818      end Is_Elaborate_Body; 
     3819 
     3820      --------------------- 
     3821      -- Retrive_Pragmas -- 
     3822      --------------------- 
     3823 
     3824      procedure Retrive_Pragmas 
     3825        (This : in Tree_Node_Access) 
     3826      is 
     3827      begin 
     3828         if Is_Nil (This.Unit) then 
     3829            return; 
     3830         end if; 
     3831 
     3832         declare 
     3833            Pragma_List : constant Asis.Pragma_Element_List := 
     3834               Asis.Elements.Corresponding_Pragmas 
     3835                  (Asis.Elements.Unit_Declaration (This.Unit)); 
     3836         begin 
     3837            for Index in Pragma_List'Range loop 
     3838               if Pragma_Kind (Pragma_List (Index).all) = A_Pure_Pragma then 
     3839                  This.Internal_Pure := Extended_True; 
     3840               end if; 
     3841 
     3842               if Pragma_Kind (Pragma_List (Index).all) = 
     3843                 A_Preelaborate_Pragma 
     3844               then 
     3845                  This.Internal_Preelaborate := Extended_True; 
     3846               end if; 
     3847 
     3848               if Pragma_Kind (Pragma_List (Index).all) = 
     3849                 An_Elaborate_Body_Pragma 
     3850               then 
     3851                  This.Internal_Spec_With_Body := Extended_True; 
     3852               end if; 
     3853 
     3854            end loop; 
     3855         end; 
     3856 
     3857         if This.Internal_Pure = Unknown then 
     3858            This.Internal_Pure := Extended_False; 
     3859         end if; 
     3860 
     3861         if This.Internal_Preelaborate = Extended_True then 
     3862            This.Internal_Preelaborate := Extended_False; 
     3863         end if; 
     3864 
     3865         if This.Internal_Spec_With_Body = Unknown then 
     3866            This.Internal_Spec_With_Body := Extended_False; 
     3867         end if; 
     3868      end Retrive_Pragmas; 
    34633869 
    34643870      ------------------ 
     
    38424248      ---------------------- 
    38434249 
     4250      procedure Remove_From_List 
     4251        (List : in out Compilation_Unit_List_Access; 
     4252         Unit : in     Compilation_Unit) 
     4253      is 
     4254      begin 
     4255         if List = null then 
     4256            return; 
     4257         end if; 
     4258 
     4259         for Index in List'Range loop 
     4260            if Is_Identical (List (Index), Unit) then 
     4261               if List'Length = 1 then 
     4262                  Deallocate (List); 
     4263               else 
     4264                  declare 
     4265                     Internal : constant Compilation_Unit_List_Access := 
     4266                        new Compilation_Unit_List (1 .. List'Length - 1); 
     4267                  begin 
     4268                     Internal (1 .. Index - 1) := List (1 .. Index - 1); 
     4269                     Internal (Index .. Internal'Last) := List (Index + 1 .. List'Last); 
     4270                     Deallocate (List); 
     4271                     List := Internal; 
     4272                  end; 
     4273               end if; 
     4274 
     4275               exit; 
     4276            end if; 
     4277         end loop; 
     4278      end Remove_From_List; 
     4279 
     4280      -- Remove_From_List -- 
    38444281      procedure Remove_From_List 
    38454282        (List : in out Compilation_Unit_List;