This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Ada] make.adb (1.177) checked in at 2001/11/06 01:38:24
- From: Geert Bosch <bosch at darwin dot gnat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 17 Dec 2001 16:20:05 -0500 (EST)
- Subject: [Ada] make.adb (1.177) checked in at 2001/11/06 01:38:24
2001-12-17 Vincent Celier <celier@gnat.com>
* make.adb:
(Switches_Of): New function
(Test_If_Relative_Path): New procedure
(Add_Switches): Use new function Switches_Of
(Collect_Arguments_And_Compile): Use new function Switches_Of.
When using a project file, test if there are any relative
search path. Fail if there are any.
(Gnatmake): Only add switches for the primary directory when not using
a project file. When using a project file, change directory to the
object directory of the main project file. When using a project file,
test if there are any relative search path. Fail if there are any.
When using a project file, fail if specified executable is relative
path with directory information, and prepend executable, if not
specified as an absolute path, with the exec directory. Make sure
that only one -o switch is transmitted to the linker.
* prj-attr.adb (Initialization_Data): Add project attribute Exec_Dir
* prj-nmsc.adb:
(Ada_Check): Get Spec_Suffix_Loc and Impl_Suffix_Loc,
when using a non standard naming scheme.
(Check_Ada_Naming_Scheme): Make sure that error messages
do not raise exceptions.
(Is_Illegal_Append): Return True if there is no dot in the suffix.
(Language_Independent_Check): Check the exec directory.
* prj.adb (Project_Empty): Add new component Exec_Directory
* prj.ads:
(Default_Ada_Spec_Suffix, Default_Ada_Impl_Suffix): Add defaults.
(Project_Data): Add component Exec_Directory
* snames.adb: Updated to match snames.ads revision 1.215
* snames.ads: Added Exec_Dir
2001-12-17 Robert Dewar <dewar@gnat.com>
* make.adb: Minor reformatting
* prj-nmsc.adb: Minor reformatting
* snames.adb: Updated to match snames.ads
* snames.ads: Alphebetize entries for project file
2001-12-17 Ed Schonberg <schonber@gnat.com>
* trans.c (process_freeze_entity): Do nothing if the entity is a
subprogram that was already elaborated.
2001-12-17 Richard Kenner <kenner@gnat.com>
* decl.c (gnat_to_gnu_entity, object): Do not back-annotate Alignment
and Esize if object is referenced via pointer.
*** make.adb 2001/10/24 22:53:25 1.176
--- make.adb 2001/11/06 01:38:24 1.177
***************
*** 28,33 ****
--- 28,34 ----
with Ada.Exceptions; use Ada.Exceptions;
with Ada.Command_Line; use Ada.Command_Line;
+ with GNAT.Directory_Operations; use GNAT.Directory_Operations;
with GNAT.OS_Lib; use GNAT.OS_Lib;
with ALI; use ALI;
***************
*** 376,381 ****
--- 377,401 ----
-- The caller process ADA_INCLUDE_PATH and ADA_OBJECTS_PATH are
-- not affected.
+ function Switches_Of
+ (Source_File : Name_Id;
+ Source_File_Name : String;
+ Naming : Naming_Data;
+ In_Package : Package_Id;
+ Allow_ALI : Boolean)
+ return Variable_Value;
+ -- Return the switches for the source file in the specified package
+ -- of a project file. If the Source_File ends with a standard GNAT
+ -- extension (".ads" or ".adb"), try first the full name, then the
+ -- name without the extension. If there is no switches for either
+ -- names, try the default switches for Ada. If all failed, return
+ -- No_Variable_Value.
+
+ procedure Test_If_Relative_Path (Switch : String_Access);
+ -- Test if Switch is a relative search path switch.
+ -- Fail if it is. This subprogram is only called
+ -- when using project files.
+
procedure Set_Library_For
(Project : Project_Id;
There_Are_Libraries : in out Boolean);
***************
*** 630,656 ****
Switch_List : String_List_Id;
Element : String_Element;
- Switches_Array : constant Array_Element_Id :=
- Prj.Util.Value_Of
- (Name => Name_Switches,
- In_Arrays => Packages.Table (The_Package).Decl.Arrays);
- Default_Switches_Array : constant Array_Element_Id :=
- Prj.Util.Value_Of
- (Name => Name_Default_Switches,
- In_Arrays => Packages.Table (The_Package).Decl.Arrays);
-
begin
if File_Name'Length > 0 then
Name_Len := File_Name'Length;
Name_Buffer (1 .. Name_Len) := File_Name;
Switches :=
! Prj.Util.Value_Of (Index => Name_Find, In_Array => Switches_Array);
!
! if Switches = Nil_Variable_Value then
! Switches := Prj.Util.Value_Of
! (Index => Name_Ada,
! In_Array => Default_Switches_Array);
! end if;
case Switches.Kind is
when Undefined =>
--- 650,667 ----
Switch_List : String_List_Id;
Element : String_Element;
begin
if File_Name'Length > 0 then
Name_Len := File_Name'Length;
Name_Buffer (1 .. Name_Len) := File_Name;
Switches :=
! Switches_Of
! (Source_File => Name_Find,
! Source_File_Name => File_Name,
! Naming => Projects.Table (Main_Project).Naming,
! In_Package => The_Package,
! Allow_ALI =>
! Program = Binder or else Program = Linker);
case Switches.Kind is
when Undefined =>
***************
*** 1679,1712 ****
-- the specific switches for the current source,
-- or the global switches, if any.
! declare
! Defaults : constant Array_Element_Id :=
! Prj.Util.Value_Of
! (Name => Name_Default_Switches,
! In_Arrays =>
! Packages.Table
! (Compiler_Package) .Decl.Arrays);
!
! Switches_Array : constant Array_Element_Id :=
! Prj.Util.Value_Of
! (Name => Name_Switches,
! In_Arrays =>
! Packages.Table
! (Compiler_Package).
! Decl.Arrays);
- begin
- Switches :=
- Prj.Util.Value_Of
- (Index => Source_File,
- In_Array => Switches_Array);
-
- if Switches = Nil_Variable_Value then
- Switches :=
- Prj.Util.Value_Of
- (Index => Name_Ada, In_Array => Defaults);
- end if;
- end;
end if;
case Switches.Kind is
--- 1690,1703 ----
-- the specific switches for the current source,
-- or the global switches, if any.
! Switches := Switches_Of
! (Source_File => Source_File,
! Source_File_Name => Source_File_Name,
! Naming =>
! Projects.Table (Current_Project).Naming,
! In_Package => Compiler_Package,
! Allow_ALI => False);
end if;
case Switches.Kind is
***************
*** 1739,1744 ****
--- 1730,1736 ----
String_To_Name_Buffer (Element.Value);
New_Args (Index) :=
new String' (Name_Buffer (1 .. Name_Len));
+ Test_If_Relative_Path (New_Args (Index));
Current := Element.Next;
end loop;
***************
*** 1764,1769 ****
--- 1756,1762 ----
(Name_Buffer (1 .. Name_Len)));
begin
+ Test_If_Relative_Path (New_Args (1));
Pid := Compile
(Path_Name,
Lib_File,
***************
*** 2615,2635 ****
if Project_File_Name = null then
Add_Switch ("-I-", Compiler, And_Save => True);
Add_Switch ("-I-", Binder, And_Save => True);
- end if;
! if Opt.Look_In_Primary_Dir then
! Add_Switch
! ("-I" &
! Normalize_Directory_Name
! (Get_Primary_Src_Search_Directory.all).all,
! Compiler, Append_Switch => False,
! And_Save => False);
! Add_Switch ("-aO" & Normalized_CWD,
! Binder,
! Append_Switch => False,
! And_Save => False);
end if;
-- If the user wants a program without a main subprogram, add the
--- 2608,2629 ----
if Project_File_Name = null then
Add_Switch ("-I-", Compiler, And_Save => True);
Add_Switch ("-I-", Binder, And_Save => True);
! if Opt.Look_In_Primary_Dir then
! Add_Switch
! ("-I" &
! Normalize_Directory_Name
! (Get_Primary_Src_Search_Directory.all).all,
! Compiler, Append_Switch => False,
! And_Save => False);
! Add_Switch ("-aO" & Normalized_CWD,
! Binder,
! Append_Switch => False,
! And_Save => False);
! end if;
!
end if;
-- If the user wants a program without a main subprogram, add the
***************
*** 2641,2646 ****
--- 2635,2643 ----
if Main_Project /= No_Project then
+ Change_Dir
+ (Get_Name_String (Projects.Table (Main_Project).Object_Directory));
+
-- Find the file name of the main unit
declare
***************
*** 2859,2870 ****
--- 2856,2881 ----
for J in 1 .. Saved_Gcc_Switches.Last loop
The_Saved_Gcc_Switches (J) := Saved_Gcc_Switches.Table (J);
+ Test_If_Relative_Path (The_Saved_Gcc_Switches (J));
end loop;
-- We never use gnat.adc when a project file is used
The_Saved_Gcc_Switches (The_Saved_Gcc_Switches'Last) :=
No_gnat_adc;
+
+ for J in 1 .. Gcc_Switches.Last loop
+ Test_If_Relative_Path (Gcc_Switches.Table (J));
+ end loop;
+
+ for J in 1 .. Binder_Switches.Last loop
+ Test_If_Relative_Path (Binder_Switches.Table (J));
+ end loop;
+
+ for J in 1 .. Linker_Switches.Last loop
+ Test_If_Relative_Path (Linker_Switches.Table (J));
+ end loop;
+
end if;
-- If there was a --GCC, --GNATBIND or --GNATLINK switch on
***************
*** 2939,2945 ****
-- Look inside the linker switches to see if the name
-- of the final executable program was specified.
! for J in Linker_Switches.First .. Linker_Switches.Last loop
if Linker_Switches.Table (J).all = Output_Flag.all then
pragma Assert (J < Linker_Switches.Last);
--- 2950,2958 ----
-- Look inside the linker switches to see if the name
-- of the final executable program was specified.
! for
! J in reverse Linker_Switches.First .. Linker_Switches.Last
! loop
if Linker_Switches.Table (J).all = Output_Flag.all then
pragma Assert (J < Linker_Switches.Last);
***************
*** 3013,3024 ****
Body_Append
then
-- We have found the body termination. We remove it
! -- add the executable termination (if any) and set
! -- Non_Std_Executable.
Name_Len := Name_Len - Body_Append'Length;
Executable := Executable_Name (Name_Find);
- Non_Std_Executable := True;
elsif Name_Len > Spec_Append'Length
and then
--- 3026,3035 ----
Body_Append
then
-- We have found the body termination. We remove it
! -- add the executable termination, if any.
Name_Len := Name_Len - Body_Append'Length;
Executable := Executable_Name (Name_Find);
elsif Name_Len > Spec_Append'Length
and then
***************
*** 3027,3047 ****
Spec_Append
then
-- We have found the spec termination. We remove
! -- it, add the executable termination (if any),
! -- and set Non_Std_Executable.
Name_Len := Name_Len - Spec_Append'Length;
Executable := Executable_Name (Name_Find);
- Non_Std_Executable := True;
else
Executable :=
Executable_Name (Strip_Suffix (Main_Source_File));
end if;
end;
end if;
end if;
-- Now we invoke Compile_Sources for the current main
Compile_Sources
--- 3038,3094 ----
Spec_Append
then
-- We have found the spec termination. We remove
! -- it, add the executable termination, if any.
Name_Len := Name_Len - Spec_Append'Length;
Executable := Executable_Name (Name_Find);
else
Executable :=
Executable_Name (Strip_Suffix (Main_Source_File));
end if;
+
end;
end if;
end if;
+ if Main_Project /= No_Project then
+ declare
+ Exec_File_Name : constant String :=
+ Get_Name_String (Executable);
+
+ begin
+ if not Is_Absolute_Path (Exec_File_Name) then
+ for Index in Exec_File_Name'Range loop
+ if Exec_File_Name (Index) = Directory_Separator then
+ Fail ("relative executable (""" &
+ Exec_File_Name &
+ """) with directory part not allowed " &
+ "when using project files");
+ end if;
+ end loop;
+
+ Get_Name_String (Projects.Table
+ (Main_Project).Exec_Directory);
+
+ if
+ Name_Buffer (Name_Len) /= Directory_Separator
+ then
+ Name_Len := Name_Len + 1;
+ Name_Buffer (Name_Len) := Directory_Separator;
+ end if;
+
+ Name_Buffer (Name_Len + 1 ..
+ Name_Len + Exec_File_Name'Length) :=
+ Exec_File_Name;
+ Name_Len := Name_Len + Exec_File_Name'Length;
+ Executable := Name_Find;
+ Non_Std_Executable := True;
+ end if;
+ end;
+
+ end if;
+
-- Now we invoke Compile_Sources for the current main
Compile_Sources
***************
*** 3242,3249 ****
Main_ALI_File := Name_Find;
Main_ALI_File := Full_Lib_File_Name (Main_ALI_File);
end if;
- pragma Assert (Main_ALI_File /= No_File);
end Main_ALI_In_Place_Mode_Step;
if Do_Bind_Step then
--- 3289,3299 ----
Main_ALI_File := Name_Find;
Main_ALI_File := Full_Lib_File_Name (Main_ALI_File);
end if;
+
+ if Main_ALI_File = No_File then
+ Fail ("could not find the main ALI file");
+ end if;
end Main_ALI_In_Place_Mode_Step;
if Do_Bind_Step then
***************
*** 3322,3348 ****
declare
Args : Argument_List
! (Linker_Switches.First .. Linker_Switches.Last + 2);
begin
-- Get all the linker switches
for J in Linker_Switches.First .. Linker_Switches.Last loop
! Args (J) := Linker_Switches.Table (J);
end loop;
-- And invoke the linker
if Non_Std_Executable then
! Args (Linker_Switches.Last + 1) := new String'("-o");
! Args (Linker_Switches.Last + 2) :=
new String'(Get_Name_String (Executable));
! Link (Main_ALI_File, Args);
else
Link
(Main_ALI_File,
! Args (Linker_Switches.First .. Linker_Switches.Last));
end if;
end;
--- 3372,3414 ----
declare
Args : Argument_List
! (Linker_Switches.First .. Linker_Switches.Last + 2);
! Last_Arg : Integer := Linker_Switches.First - 1;
! Skip : Boolean := False;
begin
-- Get all the linker switches
for J in Linker_Switches.First .. Linker_Switches.Last loop
! if Skip then
! Skip := False;
!
! elsif Non_Std_Executable
! and then Linker_Switches.Table (J).all = "-o"
! then
! Skip := True;
!
! else
! Last_Arg := Last_Arg + 1;
! Args (Last_Arg) := Linker_Switches.Table (J);
! end if;
!
end loop;
-- And invoke the linker
if Non_Std_Executable then
! Last_Arg := Last_Arg + 1;
! Args (Last_Arg) := new String'("-o");
! Last_Arg := Last_Arg + 1;
! Args (Last_Arg) :=
new String'(Get_Name_String (Executable));
! Link (Main_ALI_File, Args (Args'First .. Last_Arg));
else
Link
(Main_ALI_File,
! Args (Args'First .. Last_Arg));
end if;
end;
***************
*** 4514,4519 ****
--- 4580,4732 ----
end if;
end Set_Library_For;
+
+ -----------------
+ -- Switches_Of --
+ -----------------
+
+ function Switches_Of
+ (Source_File : Name_Id;
+ Source_File_Name : String;
+ Naming : Naming_Data;
+ In_Package : Package_Id;
+ Allow_ALI : Boolean)
+ return Variable_Value
+ is
+ Switches : Variable_Value;
+
+ Defaults : constant Array_Element_Id :=
+ Prj.Util.Value_Of
+ (Name => Name_Default_Switches,
+ In_Arrays =>
+ Packages.Table (In_Package).Decl.Arrays);
+
+ Switches_Array : constant Array_Element_Id :=
+ Prj.Util.Value_Of
+ (Name => Name_Switches,
+ In_Arrays => Packages.Table (In_Package).Decl.Arrays);
+
+ begin
+ Switches :=
+ Prj.Util.Value_Of
+ (Index => Source_File,
+ In_Array => Switches_Array);
+
+ if Switches = Nil_Variable_Value then
+ declare
+ Name : String (1 .. Source_File_Name'Length + 3);
+ Last : Positive := Source_File_Name'Length;
+ Spec_Suffix : constant String :=
+ Get_Name_String (Naming.Current_Spec_Suffix);
+ Impl_Suffix : constant String :=
+ Get_Name_String (Naming.Current_Impl_Suffix);
+ Truncated : Boolean := False;
+ begin
+ Name (1 .. Last) := Source_File_Name;
+
+ if Last > Impl_Suffix'Length
+ and then Name (Last - Impl_Suffix'Length + 1 .. Last) =
+ Impl_Suffix
+ then
+ Truncated := True;
+ Last := Last - Impl_Suffix'Length;
+ end if;
+
+ if not Truncated
+ and then Last > Spec_Suffix'Length
+ and then Name (Last - Spec_Suffix'Length + 1 .. Last) =
+ Spec_Suffix
+ then
+ Truncated := True;
+ Last := Last - Spec_Suffix'Length;
+ end if;
+
+ if Truncated then
+ Name_Len := Last;
+ Name_Buffer (1 .. Name_Len) := Name (1 .. Last);
+ Switches :=
+ Prj.Util.Value_Of
+ (Index => Name_Find,
+ In_Array => Switches_Array);
+
+ if Switches = Nil_Variable_Value then
+ Last := Source_File_Name'Length;
+
+ while Name (Last) /= '.' loop
+ Last := Last - 1;
+ end loop;
+
+ Name (Last + 1 .. Last + 3) := "ali";
+ Name_Len := Last + 3;
+ Name_Buffer (1 .. Name_Len) := Name (1 .. Name_Len);
+ Switches :=
+ Prj.Util.Value_Of
+ (Index => Name_Find,
+ In_Array => Switches_Array);
+ end if;
+ end if;
+ end;
+ end if;
+
+ if Switches = Nil_Variable_Value then
+ Switches := Prj.Util.Value_Of
+ (Index => Name_Ada, In_Array => Defaults);
+ end if;
+
+ return Switches;
+
+ end Switches_Of;
+
+ ---------------------------
+ -- Test_If_Relative_Path --
+ ---------------------------
+
+ procedure Test_If_Relative_Path (Switch : String_Access) is
+ begin
+ if Switch /= null then
+
+ declare
+ Sw : String (1 .. Switch'Length);
+ Start : Positive;
+
+ begin
+ Sw := Switch.all;
+
+ if Sw (1) = '-' then
+ if Sw'Length >= 3
+ and then (Sw (2) = 'A'
+ or else Sw (2) = 'I'
+ or else Sw (2) = 'L')
+ then
+ Start := 3;
+
+ if Sw = "-I-" then
+ return;
+ end if;
+
+ elsif Sw'Length >= 4
+ and then (Sw (2 .. 3) = "aL"
+ or else Sw (2 .. 3) = "aO"
+ or else Sw (2 .. 3) = "aI")
+ then
+ Start := 4;
+
+ else
+ return;
+ end if;
+
+ if not Is_Absolute_Path (Sw (Start .. Sw'Last)) then
+ Fail ("relative search path switches (""" &
+ Sw & """) are not allowed when using project files");
+ end if;
+
+ end if;
+
+ end;
+
+ end if;
+
+ end Test_If_Relative_Path;
------------
-- Unmark --
*** prj-attr.adb 2001/10/31 05:07:57 1.8
--- prj-attr.adb 2001/11/06 01:38:26 1.9
***************
*** 54,59 ****
--- 54,60 ----
-- project attributes
"SVobject_dir#" &
+ "SVexec_dir#" &
"LVsource_dirs#" &
"LVsource_files#" &
"SVsource_list_file#" &
*** prj-nmsc.adb 2001/11/02 21:56:08 1.33
--- prj-nmsc.adb 2001/11/06 01:38:28 1.34
***************
*** 628,641 ****
-- Check Specification_Suffix
declare
! Ada_Spec_Suffix : constant Name_Id :=
Prj.Util.Value_Of
(Index => Name_Ada,
In_Array => Data.Naming.Specification_Suffix);
begin
! if Ada_Spec_Suffix /= No_Name then
! Data.Naming.Current_Spec_Suffix := Ada_Spec_Suffix;
else
Data.Naming.Current_Spec_Suffix := Default_Ada_Spec_Suffix;
--- 628,645 ----
-- Check Specification_Suffix
declare
! Ada_Spec_Suffix : constant Variable_Value :=
Prj.Util.Value_Of
(Index => Name_Ada,
In_Array => Data.Naming.Specification_Suffix);
begin
! if Ada_Spec_Suffix.Kind = Single
! and then String_Length (Ada_Spec_Suffix.Value) /= 0
! then
! String_To_Name_Buffer (Ada_Spec_Suffix.Value);
! Data.Naming.Current_Spec_Suffix := Name_Find;
! Data.Naming.Spec_Suffix_Loc := Ada_Spec_Suffix.Location;
else
Data.Naming.Current_Spec_Suffix := Default_Ada_Spec_Suffix;
***************
*** 652,665 ****
-- Check Implementation_Suffix
declare
! Ada_Impl_Suffix : constant Name_Id :=
Prj.Util.Value_Of
(Index => Name_Ada,
In_Array => Data.Naming.Implementation_Suffix);
begin
! if Ada_Impl_Suffix /= No_Name then
! Data.Naming.Current_Impl_Suffix := Ada_Impl_Suffix;
else
Data.Naming.Current_Impl_Suffix := Default_Ada_Impl_Suffix;
--- 656,673 ----
-- Check Implementation_Suffix
declare
! Ada_Impl_Suffix : constant Variable_Value :=
Prj.Util.Value_Of
(Index => Name_Ada,
In_Array => Data.Naming.Implementation_Suffix);
begin
! if Ada_Impl_Suffix.Kind = Single
! and then String_Length (Ada_Impl_Suffix.Value) /= 0
! then
! String_To_Name_Buffer (Ada_Impl_Suffix.Value);
! Data.Naming.Current_Impl_Suffix := Name_Find;
! Data.Naming.Impl_Suffix_Loc := Ada_Impl_Suffix.Location;
else
Data.Naming.Current_Impl_Suffix := Default_Ada_Impl_Suffix;
***************
*** 920,928 ****
end if;
end Check_Ada_Name;
! -------------------------
! -- Check_Naming_Scheme --
! -------------------------
procedure Check_Ada_Naming_Scheme (Naming : Naming_Data) is
begin
--- 928,936 ----
end if;
end Check_Ada_Name;
! -----------------------------
! -- Check_Ada_Naming_Scheme --
! -----------------------------
procedure Check_Ada_Naming_Scheme (Naming : Naming_Data) is
begin
***************
*** 982,1005 ****
-- - start with an '_' followed by an alphanumeric
if Is_Illegal_Append (Specification_Suffix) then
Error_Msg
! ('"' & Specification_Suffix &
! """ is illegal for Specification_Suffix.",
Naming.Spec_Suffix_Loc);
end if;
if Is_Illegal_Append (Implementation_Suffix) then
Error_Msg
! ('"' & Implementation_Suffix &
! """ is illegal for Implementation_Suffix.",
Naming.Impl_Suffix_Loc);
end if;
if Implementation_Suffix /= Separate_Suffix then
if Is_Illegal_Append (Separate_Suffix) then
Error_Msg
! ('"' & Separate_Suffix &
! """ is illegal for Separate_Append.",
Naming.Sep_Suffix_Loc);
end if;
end if;
--- 990,1013 ----
-- - start with an '_' followed by an alphanumeric
if Is_Illegal_Append (Specification_Suffix) then
+ Error_Msg_Name_1 := Naming.Current_Spec_Suffix;
Error_Msg
! ("{ is illegal for Specification_Suffix",
Naming.Spec_Suffix_Loc);
end if;
if Is_Illegal_Append (Implementation_Suffix) then
+ Error_Msg_Name_1 := Naming.Current_Impl_Suffix;
Error_Msg
! ("% is illegal for Implementation_Suffix",
Naming.Impl_Suffix_Loc);
end if;
if Implementation_Suffix /= Separate_Suffix then
if Is_Illegal_Append (Separate_Suffix) then
+ Error_Msg_Name_1 := Naming.Separate_Suffix;
Error_Msg
! ("{ is illegal for Separate_Append",
Naming.Sep_Suffix_Loc);
end if;
end if;
***************
*** 1039,1044 ****
--- 1047,1053 ----
end if;
end;
end if;
+
end Check_Ada_Naming_Scheme;
---------------
***************
*** 1430,1435 ****
--- 1439,1445 ----
begin
return This'Length = 0
or else Is_Alphanumeric (This (This'First))
+ or else Index (This, ".") = 0
or else (This'Length >= 2
and then This (This'First) = '_'
and then Is_Alphanumeric (This (This'First + 1)));
***************
*** 1701,1707 ****
Write_Line ("Starting to look for directories");
end if;
! -- Let's check the object directory
declare
Object_Dir : Variable_Value :=
--- 1711,1717 ----
Write_Line ("Starting to look for directories");
end if;
! -- Check the object directory
declare
Object_Dir : Variable_Value :=
***************
*** 1753,1758 ****
--- 1763,1824 ----
else
Write_Str ("Object directory: """);
Write_Str (Get_Name_String (Data.Object_Directory));
+ Write_Line ("""");
+ end if;
+ end if;
+
+ -- Check the exec directory
+
+ declare
+ Exec_Dir : Variable_Value :=
+ Util.Value_Of (Name_Exec_Dir, Data.Decl.Attributes);
+
+ begin
+ pragma Assert (Exec_Dir.Kind = Single,
+ "Exec_Dir is not a single string");
+
+ -- We set the object directory to its default
+
+ Data.Exec_Directory := Data.Object_Directory;
+
+ if not String_Equal (Exec_Dir.Value, Empty_String) then
+
+ String_To_Name_Buffer (Exec_Dir.Value);
+
+ if Name_Len = 0 then
+ Error_Msg ("Exec_Dir cannot be empty",
+ Exec_Dir.Location);
+
+ else
+ -- We check that the specified object directory
+ -- does exist.
+
+ Canonical_Case_File_Name (Name_Buffer (1 .. Name_Len));
+
+ declare
+ Dir_Id : constant Name_Id := Name_Find;
+
+ begin
+ Data.Exec_Directory :=
+ Locate_Directory (Dir_Id, Data.Directory);
+
+ if Data.Exec_Directory = No_Name then
+ Error_Msg_Name_1 := Dir_Id;
+ Error_Msg
+ ("the exec directory { cannot be found",
+ Data.Location);
+ end if;
+ end;
+ end if;
+ end if;
+ end;
+
+ if Current_Verbosity = High then
+ if Data.Exec_Directory = No_Name then
+ Write_Line ("No exec directory");
+ else
+ Write_Str ("Exec directory: """);
+ Write_Str (Get_Name_String (Data.Exec_Directory));
Write_Line ("""");
end if;
end if;
*** prj.adb 2001/11/02 21:56:09 1.19
--- prj.adb 2001/11/06 01:38:31 1.20
***************
*** 89,94 ****
--- 89,95 ----
Sources => Nil_String,
Source_Dirs => Nil_String,
Object_Directory => No_Name,
+ Exec_Directory => No_Name,
Modifies => No_Project,
Modified_By => No_Project,
Naming => Std_Naming_Data,
*** prj.ads 2001/11/02 21:56:11 1.25
--- prj.ads 2001/11/06 01:38:32 1.26
***************
*** 40,50 ****
package Prj is
! Default_Ada_Spec_Suffix : Name_Id := No_Name;
-- The Name_Id for the standard GNAT suffix for Ada spec source file
-- name ".ads". Initialized by Prj.Initialize.
! Default_Ada_Impl_Suffix : Name_Id := No_Name;
-- The Name_Id for the standard GNAT suffix for Ada body source file
-- name ".adb". Initialized by Prj.Initialize.
--- 40,50 ----
package Prj is
! Default_Ada_Spec_Suffix : Name_Id;
-- The Name_Id for the standard GNAT suffix for Ada spec source file
-- name ".ads". Initialized by Prj.Initialize.
! Default_Ada_Impl_Suffix : Name_Id;
-- The Name_Id for the standard GNAT suffix for Ada body source file
-- name ".adb". Initialized by Prj.Initialize.
***************
*** 364,369 ****
--- 364,374 ----
Object_Directory : Name_Id := No_Name;
-- The object directory of this project file.
+ -- Set by Prj.Nmsc.Check_Naming_Scheme.
+
+ Exec_Directory : Name_Id := No_Name;
+ -- The exec directory of this project file.
+ -- Default is equal to Object_Directory.
-- Set by Prj.Nmsc.Check_Naming_Scheme.
Modifies : Project_Id := No_Project;
*** snames.adb 2001/10/31 02:15:11 1.209
--- snames.adb 2001/11/06 01:38:34 1.210
***************
*** 570,575 ****
--- 570,576 ----
"extends#" &
"naming#" &
"object_dir#" &
+ "exec_dir#" &
"source_dirs#" &
"specification#" &
"implementation#" &
*** snames.ads 2001/10/31 02:15:15 1.214
--- snames.ads 2001/11/06 01:38:36 1.215
***************
*** 868,904 ****
Name_Naming : constant Name_Id := N + 525;
Name_Object_Dir : constant Name_Id := N + 526;
! Name_Source_Dirs : constant Name_Id := N + 527;
! Name_Specification : constant Name_Id := N + 528;
! Name_Implementation : constant Name_Id := N + 529;
! Name_Specification_Exceptions : constant Name_Id := N + 530;
! Name_Implementation_Exceptions : constant Name_Id := N + 531;
! Name_Specification_Suffix : constant Name_Id := N + 532;
! Name_Implementation_Suffix : constant Name_Id := N + 533;
! Name_Separate_Suffix : constant Name_Id := N + 534;
! Name_Source_Files : constant Name_Id := N + 535;
! Name_Source_List_File : constant Name_Id := N + 536;
! Name_Default_Switches : constant Name_Id := N + 537;
! Name_Switches : constant Name_Id := N + 538;
! Name_Library_Dir : constant Name_Id := N + 539;
! Name_Library_Name : constant Name_Id := N + 540;
! Name_Library_Kind : constant Name_Id := N + 541;
! Name_Library_Version : constant Name_Id := N + 542;
! Name_Library_Elaboration : constant Name_Id := N + 543;
! Name_Languages : constant Name_Id := N + 544;
! Name_Builder : constant Name_Id := N + 545;
! Name_Gnatls : constant Name_Id := N + 546;
! Name_Cross_Reference : constant Name_Id := N + 547;
! Name_Finder : constant Name_Id := N + 548;
! Name_Binder : constant Name_Id := N + 549;
! Name_Linker : constant Name_Id := N + 550;
! Name_Compiler : constant Name_Id := N + 551;
! Name_Gnatstub : constant Name_Id := N + 552;
!
-- Mark last defined name for consistency check in Snames body
! Last_Predefined_Name : constant Name_Id := N + 552;
subtype Any_Operator_Name is Name_Id range
First_Operator_Name .. Last_Operator_Name;
--- 868,904 ----
Name_Naming : constant Name_Id := N + 525;
Name_Object_Dir : constant Name_Id := N + 526;
! Name_Exec_Dir : constant Name_Id := N + 527;
! Name_Source_Dirs : constant Name_Id := N + 528;
! Name_Specification : constant Name_Id := N + 529;
! Name_Implementation : constant Name_Id := N + 530;
! Name_Specification_Exceptions : constant Name_Id := N + 531;
! Name_Implementation_Exceptions : constant Name_Id := N + 532;
! Name_Specification_Suffix : constant Name_Id := N + 533;
! Name_Implementation_Suffix : constant Name_Id := N + 534;
! Name_Separate_Suffix : constant Name_Id := N + 535;
! Name_Source_Files : constant Name_Id := N + 536;
! Name_Source_List_File : constant Name_Id := N + 537;
! Name_Default_Switches : constant Name_Id := N + 538;
! Name_Switches : constant Name_Id := N + 539;
! Name_Library_Dir : constant Name_Id := N + 540;
! Name_Library_Name : constant Name_Id := N + 541;
! Name_Library_Kind : constant Name_Id := N + 542;
! Name_Library_Version : constant Name_Id := N + 543;
! Name_Library_Elaboration : constant Name_Id := N + 544;
! Name_Languages : constant Name_Id := N + 545;
! Name_Builder : constant Name_Id := N + 546;
! Name_Gnatls : constant Name_Id := N + 547;
! Name_Cross_Reference : constant Name_Id := N + 548;
! Name_Finder : constant Name_Id := N + 549;
! Name_Binder : constant Name_Id := N + 550;
! Name_Linker : constant Name_Id := N + 551;
! Name_Compiler : constant Name_Id := N + 552;
! Name_Gnatstub : constant Name_Id := N + 553;
-- Mark last defined name for consistency check in Snames body
! Last_Predefined_Name : constant Name_Id := N + 553;
subtype Any_Operator_Name is Name_Id range
First_Operator_Name .. Last_Operator_Name;
*** make.adb 2001/11/06 01:38:24 1.177
--- make.adb 2001/11/06 02:05:12 1.178
***************
*** 28,35 ****
with Ada.Exceptions; use Ada.Exceptions;
with Ada.Command_Line; use Ada.Command_Line;
with GNAT.Directory_Operations; use GNAT.Directory_Operations;
! with GNAT.OS_Lib; use GNAT.OS_Lib;
with ALI; use ALI;
with ALI.Util; use ALI.Util;
--- 28,36 ----
with Ada.Exceptions; use Ada.Exceptions;
with Ada.Command_Line; use Ada.Command_Line;
+
with GNAT.Directory_Operations; use GNAT.Directory_Operations;
! with GNAT.OS_Lib; use GNAT.OS_Lib;
with ALI; use ALI;
with ALI.Util; use ALI.Util;
***************
*** 383,389 ****
Naming : Naming_Data;
In_Package : Package_Id;
Allow_ALI : Boolean)
! return Variable_Value;
-- Return the switches for the source file in the specified package
-- of a project file. If the Source_File ends with a standard GNAT
-- extension (".ads" or ".adb"), try first the full name, then the
--- 384,390 ----
Naming : Naming_Data;
In_Package : Package_Id;
Allow_ALI : Boolean)
! return Variable_Value;
-- Return the switches for the source file in the specified package
-- of a project file. If the Source_File ends with a standard GNAT
-- extension (".ads" or ".adb"), try first the full name, then the
***************
*** 872,901 ****
-- Data declarations for Check --
---------------------------------
! Full_Lib_File : File_Name_Type;
-- Full name of current library file
! Full_Obj_File : File_Name_Type;
-- Full name of the object file corresponding to Lib_File.
! Lib_Stamp : Time_Stamp_Type;
-- Time stamp of the current ada library file.
! Obj_Stamp : Time_Stamp_Type;
-- Time stamp of the current object file.
! Modified_Source : File_Name_Type;
-- The first source in Lib_File whose current time stamp differs
-- from that stored in Lib_File.
! New_Spec : File_Name_Type;
-- If Lib_File contains in its W (with) section a body (for a
-- subprogram) for which there exists a spec and the spec did not
-- appear in the Sdep section of Lib_File, New_Spec contains the file
-- name of this new spec.
Source_Name : Name_Id;
! Text : Text_Buffer_Ptr;
Prev_Switch : Character;
-- First character of previous switch processed
--- 873,902 ----
-- Data declarations for Check --
---------------------------------
! Full_Lib_File : File_Name_Type;
-- Full name of current library file
! Full_Obj_File : File_Name_Type;
-- Full name of the object file corresponding to Lib_File.
! Lib_Stamp : Time_Stamp_Type;
-- Time stamp of the current ada library file.
! Obj_Stamp : Time_Stamp_Type;
-- Time stamp of the current object file.
! Modified_Source : File_Name_Type;
-- The first source in Lib_File whose current time stamp differs
-- from that stored in Lib_File.
! New_Spec : File_Name_Type;
-- If Lib_File contains in its W (with) section a body (for a
-- subprogram) for which there exists a spec and the spec did not
-- appear in the Sdep section of Lib_File, New_Spec contains the file
-- name of this new spec.
Source_Name : Name_Id;
! Text : Text_Buffer_Ptr;
Prev_Switch : Character;
-- First character of previous switch processed
***************
*** 1045,1050 ****
--- 1046,1053 ----
end if;
end loop;
+ -- Special_Arg is non-null
+
else
for J in Special_Arg'Range loop
***************
*** 2381,2387 ****
end loop;
end;
end if;
-
end Compile_Sources;
-------------
--- 2384,2389 ----
***************
*** 2544,2554 ****
declare
Main_Id : constant Name_Id := Name_Find;
! Mains : constant Prj.Variable_Value :=
! Prj.Util.Value_Of
! (Variable_Name => Main_Id,
! In_Variables =>
! Projects.Table (Main_Project).Decl.Attributes);
Value : String_List_Id := Mains.Values;
--- 2546,2556 ----
declare
Main_Id : constant Name_Id := Name_Find;
! Mains : constant Prj.Variable_Value :=
! Prj.Util.Value_Of
! (Variable_Name => Main_Id,
! In_Variables =>
! Projects.Table (Main_Project).Decl.Attributes);
Value : String_List_Id := Mains.Values;
***************
*** 3011,3016 ****
--- 3013,3019 ----
(Projects.Table
(Main_Project).
Naming.Current_Impl_Suffix);
+
Spec_Append : constant String :=
Get_Name_String
(Projects.Table
***************
*** 3259,3265 ****
end if;
end if;
end Recursive_Compilation_Step;
-
end if;
-- If we are here, it means that we need to rebuilt the current
--- 3262,3267 ----
***************
*** 3318,3324 ****
Bind (Main_ALI_File, Args);
end Bind_Step;
-
end if;
if Do_Link_Step then
--- 3320,3325 ----
***************
*** 3328,3334 ****
Linker_Switches_Last : constant Integer := Linker_Switches.Last;
begin
-
if Main_Project /= No_Project then
if MLib.Tgt.Libraries_Are_Supported then
--- 3329,3334 ----
***************
*** 3360,3368 ****
Linker_Switches.Table (Linker_Switches.Last) :=
Option;
end if;
-
end;
-
end if;
-- Put the object directories in ADA_OBJECTS_PATH
--- 3360,3366 ----
***************
*** 3372,3378 ****
declare
Args : Argument_List
! (Linker_Switches.First .. Linker_Switches.Last + 2);
Last_Arg : Integer := Linker_Switches.First - 1;
Skip : Boolean := False;
--- 3370,3377 ----
declare
Args : Argument_List
! (Linker_Switches.First .. Linker_Switches.Last + 2);
!
Last_Arg : Integer := Linker_Switches.First - 1;
Skip : Boolean := False;
***************
*** 3415,3421 ****
Linker_Switches.Set_Last (Linker_Switches_Last);
end Link_Step;
-
end if;
-- We go to here when we skip the bind and link steps.
--- 3414,3419 ----
***************
*** 3658,3664 ****
when Err : SFN_Scan.Syntax_Error_In_GNAT_ADC =>
Osint.Fail (Exception_Message (Err));
end;
-
end Initialize;
-----------------------------------
--- 3656,3661 ----
***************
*** 4591,4610 ****
Naming : Naming_Data;
In_Package : Package_Id;
Allow_ALI : Boolean)
! return Variable_Value
is
Switches : Variable_Value;
Defaults : constant Array_Element_Id :=
! Prj.Util.Value_Of
! (Name => Name_Default_Switches,
! In_Arrays =>
! Packages.Table (In_Package).Decl.Arrays);
Switches_Array : constant Array_Element_Id :=
! Prj.Util.Value_Of
! (Name => Name_Switches,
! In_Arrays => Packages.Table (In_Package).Decl.Arrays);
begin
Switches :=
--- 4588,4608 ----
Naming : Naming_Data;
In_Package : Package_Id;
Allow_ALI : Boolean)
! return Variable_Value
is
Switches : Variable_Value;
Defaults : constant Array_Element_Id :=
! Prj.Util.Value_Of
! (Name => Name_Default_Switches,
! In_Arrays =>
! Packages.Table (In_Package).Decl.Arrays);
Switches_Array : constant Array_Element_Id :=
! Prj.Util.Value_Of
! (Name => Name_Switches,
! In_Arrays =>
! Packages.Table (In_Package).Decl.Arrays);
begin
Switches :=
***************
*** 4617,4626 ****
Name : String (1 .. Source_File_Name'Length + 3);
Last : Positive := Source_File_Name'Length;
Spec_Suffix : constant String :=
! Get_Name_String (Naming.Current_Spec_Suffix);
Impl_Suffix : constant String :=
! Get_Name_String (Naming.Current_Impl_Suffix);
Truncated : Boolean := False;
begin
Name (1 .. Last) := Source_File_Name;
--- 4615,4625 ----
Name : String (1 .. Source_File_Name'Length + 3);
Last : Positive := Source_File_Name'Length;
Spec_Suffix : constant String :=
! Get_Name_String (Naming.Current_Spec_Suffix);
Impl_Suffix : constant String :=
! Get_Name_String (Naming.Current_Impl_Suffix);
Truncated : Boolean := False;
+
begin
Name (1 .. Last) := Source_File_Name;
***************
*** 4674,4680 ****
end if;
return Switches;
-
end Switches_Of;
---------------------------
--- 4673,4678 ----
***************
*** 4719,4731 ****
Fail ("relative search path switches (""" &
Sw & """) are not allowed when using project files");
end if;
-
end if;
-
end;
-
end if;
-
end Test_If_Relative_Path;
------------
--- 4717,4725 ----
*** prj-nmsc.adb 2001/11/06 01:38:28 1.34
--- prj-nmsc.adb 2001/11/06 10:32:00 1.35
***************
*** 1771,1777 ****
declare
Exec_Dir : Variable_Value :=
! Util.Value_Of (Name_Exec_Dir, Data.Decl.Attributes);
begin
pragma Assert (Exec_Dir.Kind = Single,
--- 1771,1777 ----
declare
Exec_Dir : Variable_Value :=
! Util.Value_Of (Name_Exec_Dir, Data.Decl.Attributes);
begin
pragma Assert (Exec_Dir.Kind = Single,
*** snames.adb 2001/11/06 01:38:34 1.210
--- snames.adb 2001/11/06 11:44:18 1.211
***************
*** 566,602 ****
"requeue#" &
"tagged#" &
"raise_exception#" &
! "project#" &
! "extends#" &
! "naming#" &
! "object_dir#" &
"exec_dir#" &
! "source_dirs#" &
! "specification#" &
"implementation#" &
- "specification_exceptions#" &
"implementation_exceptions#" &
- "specification_suffix#" &
"implementation_suffix#" &
! "separate_suffix#" &
! "source_files#" &
! "source_list_file#" &
! "default_switches#" &
! "switches#" &
"library_dir#" &
! "library_name#" &
"library_kind#" &
"library_version#" &
- "library_elaboration#" &
- "languages#" &
- "builder#" &
- "gnatls#" &
- "cross_reference#" &
- "finder#" &
- "binder#" &
"linker#" &
! "compiler#" &
! "gnatstub#" &
"#";
---------------------
--- 566,602 ----
"requeue#" &
"tagged#" &
"raise_exception#" &
! "binder#" &
! "builder#" &
! "compiler#" &
! "cross_reference#" &
! "default_switches#" &
"exec_dir#" &
! "extends#" &
! "finder#" &
! "gnatls#" &
! "gnatstub#" &
"implementation#" &
"implementation_exceptions#" &
"implementation_suffix#" &
! "languages#" &
"library_dir#" &
! "library_elaboration#" &
"library_kind#" &
+ "library_name#" &
"library_version#" &
"linker#" &
! "naming#" &
! "object_dir#" &
! "project#" &
! "separate_suffix#" &
! "source_dirs#" &
! "source_files#" &
! "source_list_file#" &
! "specification#" &
! "specification_exceptions#" &
! "specification_suffix#" &
! "switches#" &
"#";
---------------------
*** snames.ads 2001/11/06 01:38:36 1.215
--- snames.ads 2001/11/06 11:44:22 1.216
***************
*** 861,901 ****
-- Additional reserved words in GNAT Project Files
-- Note that Name_External is already previously declared
! Name_Project : constant Name_Id := N + 523;
! Name_Extends : constant Name_Id := N + 524;
!
! -- Names used in GNAT Project Files
!
! Name_Naming : constant Name_Id := N + 525;
! Name_Object_Dir : constant Name_Id := N + 526;
! Name_Exec_Dir : constant Name_Id := N + 527;
! Name_Source_Dirs : constant Name_Id := N + 528;
! Name_Specification : constant Name_Id := N + 529;
! Name_Implementation : constant Name_Id := N + 530;
! Name_Specification_Exceptions : constant Name_Id := N + 531;
! Name_Implementation_Exceptions : constant Name_Id := N + 532;
! Name_Specification_Suffix : constant Name_Id := N + 533;
! Name_Implementation_Suffix : constant Name_Id := N + 534;
! Name_Separate_Suffix : constant Name_Id := N + 535;
! Name_Source_Files : constant Name_Id := N + 536;
! Name_Source_List_File : constant Name_Id := N + 537;
! Name_Default_Switches : constant Name_Id := N + 538;
! Name_Switches : constant Name_Id := N + 539;
! Name_Library_Dir : constant Name_Id := N + 540;
! Name_Library_Name : constant Name_Id := N + 541;
! Name_Library_Kind : constant Name_Id := N + 542;
! Name_Library_Version : constant Name_Id := N + 543;
! Name_Library_Elaboration : constant Name_Id := N + 544;
! Name_Languages : constant Name_Id := N + 545;
!
! Name_Builder : constant Name_Id := N + 546;
! Name_Gnatls : constant Name_Id := N + 547;
! Name_Cross_Reference : constant Name_Id := N + 548;
! Name_Finder : constant Name_Id := N + 549;
! Name_Binder : constant Name_Id := N + 550;
! Name_Linker : constant Name_Id := N + 551;
! Name_Compiler : constant Name_Id := N + 552;
! Name_Gnatstub : constant Name_Id := N + 553;
-- Mark last defined name for consistency check in Snames body
Last_Predefined_Name : constant Name_Id := N + 553;
--- 861,897 ----
-- Additional reserved words in GNAT Project Files
-- Note that Name_External is already previously declared
! Name_Binder : constant Name_Id := N + 523;
! Name_Builder : constant Name_Id := N + 524;
! Name_Compiler : constant Name_Id := N + 525;
! Name_Cross_Reference : constant Name_Id := N + 526;
! Name_Default_Switches : constant Name_Id := N + 527;
! Name_Exec_Dir : constant Name_Id := N + 528;
! Name_Extends : constant Name_Id := N + 529;
! Name_Finder : constant Name_Id := N + 530;
! Name_Gnatls : constant Name_Id := N + 531;
! Name_Gnatstub : constant Name_Id := N + 532;
! Name_Implementation : constant Name_Id := N + 533;
! Name_Implementation_Exceptions : constant Name_Id := N + 534;
! Name_Implementation_Suffix : constant Name_Id := N + 535;
! Name_Languages : constant Name_Id := N + 536;
! Name_Library_Dir : constant Name_Id := N + 537;
! Name_Library_Elaboration : constant Name_Id := N + 538;
! Name_Library_Kind : constant Name_Id := N + 539;
! Name_Library_Name : constant Name_Id := N + 540;
! Name_Library_Version : constant Name_Id := N + 541;
! Name_Linker : constant Name_Id := N + 542;
! Name_Naming : constant Name_Id := N + 543;
! Name_Object_Dir : constant Name_Id := N + 544;
! Name_Project : constant Name_Id := N + 545;
! Name_Separate_Suffix : constant Name_Id := N + 546;
! Name_Source_Dirs : constant Name_Id := N + 547;
! Name_Source_Files : constant Name_Id := N + 548;
! Name_Source_List_File : constant Name_Id := N + 549;
! Name_Specification : constant Name_Id := N + 550;
! Name_Specification_Exceptions : constant Name_Id := N + 551;
! Name_Specification_Suffix : constant Name_Id := N + 552;
! Name_Switches : constant Name_Id := N + 553;
-- Mark last defined name for consistency check in Snames body
Last_Predefined_Name : constant Name_Id := N + 553;
*** trans.c 2001/11/02 17:35:04 1.6
--- trans.c 2001/11/06 14:00:32 1.7
***************
*** 3990,3995 ****
--- 3990,4004 ----
&& Present (Equivalent_Type (gnat_entity))))
return;
+ /* Don't do anything for subprograms that may have been elaborated before
+ their freeze nodes. This can happen, for example because of an inner call
+ in an instance body. */
+ if (gnu_old != 0
+ && TREE_CODE (gnu_old) == FUNCTION_DECL
+ && (Ekind (gnat_entity) == E_Function
+ || Ekind (gnat_entity) == E_Procedure))
+ return;
+
/* If we have a non-dummy type old tree, we have nothing to do. Unless
this is the public view of a private type whose full view was not
delayed, this node was never delayed as it should have been.
*** decl.c 2001/10/29 15:17:57 1.10
--- decl.c 2001/11/06 18:21:22 1.11
***************
*** 1060,1071 ****
}
/* Back-annotate the Alignment of the object if not already in the
! tree. Likewise for Esize if the object is of a constant size. */
! if (Unknown_Alignment (gnat_entity))
Set_Alignment (gnat_entity,
UI_From_Int (DECL_ALIGN (gnu_decl) / BITS_PER_UNIT));
! if (Unknown_Esize (gnat_entity)
&& DECL_SIZE (gnu_decl) != 0)
{
tree gnu_back_size = DECL_SIZE (gnu_decl);
--- 1060,1074 ----
}
/* Back-annotate the Alignment of the object if not already in the
! tree. Likewise for Esize if the object is of a constant size.
! But if the "object" is actually a pointer to an object, the
! alignment and size are the same as teh type, so don't back-annotate
! the values for the pointer. */
! if (! used_by_ref && Unknown_Alignment (gnat_entity))
Set_Alignment (gnat_entity,
UI_From_Int (DECL_ALIGN (gnu_decl) / BITS_PER_UNIT));
! if (! used_by_ref && Unknown_Esize (gnat_entity)
&& DECL_SIZE (gnu_decl) != 0)
{
tree gnu_back_size = DECL_SIZE (gnu_decl);