diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-05-05 10:09:56 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-05-05 10:09:56 +0000 |
commit | 1bbc983105406a22a22a8fa1aa8fdbcc964d2678 (patch) | |
tree | 79664ddc9b0ba53bcbb38c74d0161e65912f0466 /gcc/ada/prj-makr.adb | |
parent | bc42cc1afb2286e57b4a1e742d5f1251614fc0ee (diff) | |
download | gcc-1bbc983105406a22a22a8fa1aa8fdbcc964d2678.tar.gz |
2004-05-05 Emmanuel Briot <briot@act-europe.fr>
* g-os_lib.ads (Invalid_Time): New constant
* adaint.h, adaint.c (__gnat_file_time_name, __gnat_file_time_fd): Now
return OS_Time instead of time_t to match what is imported by Ada.
Now return -1 if the file doesn't exist, instead of a random value
2004-05-05 Robert Dewar <dewar@gnat.com>
* usage.adb: Add line for -gnatR?s switch
* sem_ch13.adb, exp_ch2.adb: Minor reformatting
* g-regpat.ads, g-regpat.adb: Add documentation on handling of Size
and for Match (Data_First, Data_last)
* lib-writ.adb (Write_With_Lines): Ensure that correct index number is
written when we are dealing with multi-unit files.
2004-05-05 Jerome Guitton <guitton@act-europe.fr>
* Makefile.in: Remove unused targets and variables.
2004-05-05 Vincent Celier <celier@gnat.com>
* switch-m.adb: New gnatmake switch -eI
* vms_data.ads: Add VMS equivalents of new gnatclean swith -innn and
of new gnatmake switch -eInnn.
* makegpr.adb: Take into account new parameters Index and Src_Index in
Prj.Util.
* clean.adb: Implement support for multi-unit sources, including new
switch -i.
* gnatcmd.adb (GNATCmd): Call Prj.Util.Value_Of with new parameter
Src_Index.
* make.ads, make.adb (Insert_Q): New parameter Index, defaulted to 0
(Extract_From_Q): New out parameter Index
(Mark, Is_Marked): Subprograms moved to Makeutl
(Switches_Of): New parameter Source_Index
(Add_Switch): New parameter Index
(Check): New parameter Source_Index
(Collect_Arguments): New parameter Source_Index
(Collect_Arguments_And_Compile): New parameter Source_Index
(Compile): New parameter Source_Index
Put subprograms in alphabetical order
Add support for multi-source sources, including in project files.
* makeutl.ads, makeutl.adb (Unit_Index_Of): New function
(Mark, Is_Marked, Delete_All_Marks): New subprograms, moved from
Make.
* makeusg.adb: New gnatmake switch -eInnn
* mlib-prj.adb (Build_Library): Add new parameter Src_Index to call to
Prj.Util.Value_Of.
* opt.ads (Main_Index): New variable, defaulted to 0.
* osint.ads, osinte.adb (Add_File): New parameter Index
(Current_Source_Index): New function
* prj.adb: Take into account new components Index and Src_Index
* prj.ads (String_Element): New component Index
(Variable_Value): New component Index
(Array_Element): New component Src_Index
* prj-attr.adb: Indicate that optional index may be specified for
attributes Main, Executable, Spec, Body and some of Switches.
* prj-attr.ads (Attribute_Kind): New values for optional indexes
(Attribute_Record): New component Optional_Index
* prj-com.ads (File_Name_Data): New component Index
* prj-dect.adb (Parse_Attribute_Declaration): Process optional index
* prj-env.adb (Put): Output optional index
* prj-makr.adb: Put indexes for multi-unit sources in SFN pragmas and
attributes Spec and Body.
* prj-nmsc.adb: Process optional indexes
* prj-pp.adb: Ouput "at" for optional indexes
* prj-proc.adb: Take into account optional indexes
* prj-strt.ads, prj-strt.adb (Terms): New Boolean parameter
Optional_Index. For string literal,
process optional index when Optional_Index is True.
(Parse_Expresion): New Boolean parameter Optional_Index
* prj-tree.ads, prj-tree.adb (Source_Index_Of): New function
(Set_Source_Index_Of): New procedure
* prj-util.adb (Executable_Of, Value_Of): Take into account optional
index.
* prj-util.ads (Executable_Of): New parameter Index
(Value_Of (Name_Id, Array_Element_Id) returning Variable_Value):
New parameter Src_Index, defaulted to 0.
2004-05-05 Ed Schonberg <schonberg@gnat.com>
PR ada/15257
* sem_ch3.adb (Access_Definition): If this is an access parameter
whose designated type is imported through a limited_with clause, do
not add the enclosing subprogram to the list of private dependents of
the type.
2004-05-05 Ed Schonberg <schonberg@gnat.com>
PR ada/15258
* sem_ch6.adb (Base_Types_Match): True if one type is imported through
a limited_with clause, and the other is its non-limited view.
2004-05-05 Thomas Quinot <quinot@act-europe.fr>
* cstand.adb (Create_Standard): Initialize Stand.Boolean_Literals.
* exp_attr.adb, exp_ch5.adb, exp_ch9.adb, exp_disp.adb,
exp_fixd.adb, sem_attr.adb, sem_dist.adb, sem_util.adb: Use
Stand.Boolean_Literals to produce references to entities
Standard_False and Standard_True from compile-time computed boolean
values.
* stand.ads (Boolean_Literals): New variable, provides the entity
values for False and True, for use by the expander.
2004-05-05 Doug Rupp <rupp@gnat.com>
* 5vinmaop.adb, 5[vx]system.ads: Add Short_Address subtype
5vinmaop.adb: Unchecked convert Short_Address vice Address
* adaint.c, raise.c: Caste CRTL function return value
to avoid gcc error on 32/64 bit IVMS.
* Makefile.in [VMS]: Use iar archiver if host = Alpha/VMS and
target = IA64/VMS.
* init.c[VMS]: Only call Alpha specific __gnat_error_prehandler IN_RTS.
* 5qsystem.ads (Address): Declare as Long_Integer
(Short_Address): Declare as 32 bit subtype of Address
Declare abstract address operations to avoid gratuitous ambiguities.
2004-05-05 Jose Ruiz <ruiz@act-europe.fr>
* gnat_rm.texi: Use the new restriction Simple_Barriers (AI-249)
instead of the old Boolean_Entry_Barriers.
Ditto for No_Task_Attributes_Package instead of No_Task_Attributes.
2004-05-05 GNAT Script <nobody@gnat.com>
* Make-lang.in: Makefile automatically updated
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@81519 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/prj-makr.adb')
-rw-r--r-- | gcc/ada/prj-makr.adb | 211 |
1 files changed, 115 insertions, 96 deletions
diff --git a/gcc/ada/prj-makr.adb b/gcc/ada/prj-makr.adb index 6fdb3bba0e3..b6b66dd5195 100644 --- a/gcc/ada/prj-makr.adb +++ b/gcc/ada/prj-makr.adb @@ -136,9 +136,10 @@ package body Prj.Makr is Args : Argument_List (1 .. Preproc_Switches'Length + 6); type SFN_Pragma is record - Unit : Name_Id; - File : Name_Id; - Spec : Boolean; + Unit : Name_Id; + File : Name_Id; + Index : Int := 0; + Spec : Boolean; end record; package SFN_Pragmas is new Table.Table @@ -254,7 +255,7 @@ package body Prj.Makr is then Output.Write_Str (" Checking """); Output.Write_Str (Str (1 .. Last)); - Output.Write_Str (""": "); + Output.Write_Line (""": "); end if; -- If the file name matches one of the regular expressions, @@ -362,7 +363,7 @@ package body Prj.Makr is if End_Of_File (File) then if Opt.Verbose_Mode then if not Success then - Output.Write_Str ("(process died) "); + Output.Write_Str (" (process died) "); end if; end if; @@ -383,10 +384,11 @@ package body Prj.Makr is Name_Buffer (1 .. Name_Len) := Text_Line (6 .. J - 7); SFN_Prag := - (Unit => Name_Find, - File => File_Name_Id, - Spec => Text_Line (J - 5 .. J) = - "(spec)"); + (Unit => Name_Find, + File => File_Name_Id, + Index => 0, + Spec => Text_Line (J - 5 .. J) = + "(spec)"); SFN_Pragmas.Increment_Last; SFN_Pragmas.Table @@ -400,107 +402,116 @@ package body Prj.Makr is if Save_Last_Pragma_Index = SFN_Pragmas.Last then if Opt.Verbose_Mode then - Output.Write_Line ("not a unit"); - end if; - - elsif SFN_Pragmas.Last > - Save_Last_Pragma_Index + 1 - then - SFN_Pragmas.Set_Last (Save_Last_Pragma_Index); - - if Opt.Verbose_Mode then - Output.Write_Line - ("file contains multiple units"); + Output.Write_Line (" not a unit"); end if; else - SFN_Prag := SFN_Pragmas.Table - (SFN_Pragmas.Last); - - if Opt.Verbose_Mode then - if SFN_Prag.Spec then - Output.Write_Str ("spec of "); - - else - Output.Write_Str ("body of "); - end if; - - Output.Write_Line - (Get_Name_String (SFN_Prag.Unit)); + if SFN_Pragmas.Last > + Save_Last_Pragma_Index + 1 + then + for Index in Save_Last_Pragma_Index + 1 .. + SFN_Pragmas.Last + loop + SFN_Pragmas.Table (Index).Index := + Int (Index - Save_Last_Pragma_Index); + end loop; end if; - if Project_File then - - -- Add the corresponding attribute in the - -- Naming package of the naming project. - - declare - Decl_Item : constant Project_Node_Id := - Default_Project_Node - (Of_Kind => - N_Declarative_Item); - - Attribute : constant Project_Node_Id := - Default_Project_Node - (Of_Kind => - N_Attribute_Declaration); - - Expression : constant Project_Node_Id := - Default_Project_Node - (Of_Kind => N_Expression, - And_Expr_Kind => Single); - - Term : constant Project_Node_Id := - Default_Project_Node - (Of_Kind => N_Term, - And_Expr_Kind => Single); - - Value : constant Project_Node_Id := - Default_Project_Node - (Of_Kind => N_Literal_String, - And_Expr_Kind => Single); - - begin - Set_Next_Declarative_Item - (Decl_Item, - To => First_Declarative_Item_Of - (Naming_Package)); - Set_First_Declarative_Item_Of - (Naming_Package, To => Decl_Item); - Set_Current_Item_Node - (Decl_Item, To => Attribute); - - -- Is it a spec or a body? + for Index in Save_Last_Pragma_Index + 1 .. + SFN_Pragmas.Last + loop + SFN_Prag := SFN_Pragmas.Table (Index); + if Opt.Verbose_Mode then if SFN_Prag.Spec then - Set_Name_Of - (Attribute, To => Name_Spec); + Output.Write_Str (" spec of "); + else - Set_Name_Of - (Attribute, - To => Name_Body); + Output.Write_Str (" body of "); end if; - -- Get the name of the unit + Output.Write_Line + (Get_Name_String (SFN_Prag.Unit)); + end if; + + if Project_File then + + -- Add the corresponding attribute in the + -- Naming package of the naming project. + + declare + Decl_Item : constant Project_Node_Id := + Default_Project_Node + (Of_Kind => + N_Declarative_Item); + + Attribute : constant Project_Node_Id := + Default_Project_Node + (Of_Kind => + N_Attribute_Declaration); + + Expression : constant Project_Node_Id := + Default_Project_Node + (Of_Kind => N_Expression, + And_Expr_Kind => Single); + + Term : constant Project_Node_Id := + Default_Project_Node + (Of_Kind => N_Term, + And_Expr_Kind => Single); + + Value : constant Project_Node_Id := + Default_Project_Node + (Of_Kind => N_Literal_String, + And_Expr_Kind => Single); + + begin + Set_Next_Declarative_Item + (Decl_Item, + To => First_Declarative_Item_Of + (Naming_Package)); + Set_First_Declarative_Item_Of + (Naming_Package, To => Decl_Item); + Set_Current_Item_Node + (Decl_Item, To => Attribute); + + -- Is it a spec or a body? + + if SFN_Prag.Spec then + Set_Name_Of + (Attribute, To => Name_Spec); + else + Set_Name_Of + (Attribute, + To => Name_Body); + end if; - Get_Name_String (SFN_Prag.Unit); - To_Lower (Name_Buffer (1 .. Name_Len)); - Set_Associative_Array_Index_Of - (Attribute, To => Name_Find); + -- Get the name of the unit - Set_Expression_Of - (Attribute, To => Expression); - Set_First_Term - (Expression, To => Term); - Set_Current_Term (Term, To => Value); + Get_Name_String (SFN_Prag.Unit); + To_Lower (Name_Buffer (1 .. Name_Len)); + Set_Associative_Array_Index_Of + (Attribute, To => Name_Find); - -- And set the name of the file + Set_Expression_Of + (Attribute, To => Expression); + Set_First_Term + (Expression, To => Term); + Set_Current_Term (Term, To => Value); - Set_String_Value_Of - (Value, To => File_Name_Id); - end; + -- And set the name of the file - -- Add source file name to source list file + Set_String_Value_Of + (Value, To => File_Name_Id); + Set_Source_Index_Of + (Value, To => SFN_Prag.Index); + end; + end if; + end loop; + + if Project_File then + -- Add source file name to source list + -- file. Last := Last + 1; Str (Last) := ASCII.LF; @@ -1273,7 +1284,15 @@ package body Prj.Makr is Write_A_String (Get_Name_String (SFN_Pragmas.Table (Index).File)); - Write_A_String (""");"); + + Write_A_String (""""); + + if SFN_Pragmas.Table (Index).Index /= 0 then + Write_A_String (", Index =>"); + Write_A_String (SFN_Pragmas.Table (Index).Index'Img); + end if; + + Write_A_String (");"); Write_Eol; end loop; |