Commit d3cc6a32 by Arnaud Charlet

lib-writ.adb: Handle Convention_CIL in addition to Convention_Java, since both are separated.

2007-04-20  Arnaud Charlet  <charlet@adacore.com>
	    Vincent Celier  <celier@adacore.com>

	* lib-writ.adb: Handle Convention_CIL in addition to Convention_Java,
	since both are separated.
	Add support for imported CIL packages.
	Add further special handling of "value_type" for CIL.
	Add special handling of pragma Import for CIL.

	* make.ads, make.adb: When switch -eS is used, direct all outputs to
	standard output instead of standard error, except errors.
	(Absolute_Path): Use untouched casing for the parent directory.
	(Add_Library_Search_Dir): Use the untouched directory name.
	(Add_Source_Search_Dir): Idem.
	(Change_To_Object_Directory): Update output to use proper casing.
	(Create_Binder_Mapping_File): Use the untouched filename to set
	ALI_Name.
	(Gnatmake): Use untouched library and executable directory names.
	(Insert_Project_Sources): Use untouched filename for spec and body.
	(Is_In_Object_Directory): Use untouched object directory.
	(Mark_Directory): Idem.
	(Collect_Arguments_And_Compile): Ensure that Full_Source_File always
	contains the non-canonical filename in all cases.
	(Change_To_Object_Directory): In verbose mode, display the name of the
	object directory we're changing to.
	(Compile_Sources): Make sure, when a project file is used, to compile
	the body of the unit, when there is one, even when only the spec is
	recorded in an ALI file.
	(Gcc_Switches, Binder_Switches, Linker_Switches): Tables moved from the
	spec to the body.
	(Report_Compilation_Failed): New procedure
	(Bind, Display_Commands, Compile_Sources, Initialize, Scan_Make_Arg):
	procedures moved from the spec to the body.
	(Extract_Failure): Removed, not used
	Replace explicit raises of exception Bind_Failed and Link_Failed with
	calls to Make_Failed with the proper message.
	Replace explicit raises of exception Compilation_Failed with calls to
	procedure Report_Compilation_Failed.
	(Initialize): Create mapping files unconditionally when using project
	files.

	* sem_mech.adb: (Name_CIL, Name_CIL_Constructor, Convention_CIL,
	Pragma_CIL_Constructor): New names.

	* targparm.ads, targparm.adb
	(Compiler_System_Version): Removed, no longer used.
	(Get_Target_Parameters): Relax checks on system.ads validity. Add
	handling of two new system flags: JVM and CLI.

From-SVN: r125432
parent 437bae3f
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2006, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -33,7 +33,6 @@ with Fname; use Fname;
with Fname.UF; use Fname.UF;
with Lib.Util; use Lib.Util;
with Lib.Xref; use Lib.Xref;
with Namet; use Namet;
with Nlists; use Nlists;
with Gnatvsn; use Gnatvsn;
with Opt; use Opt;
......@@ -45,6 +44,7 @@ with Rident; use Rident;
with Scn; use Scn;
with Sinfo; use Sinfo;
with Sinput; use Sinput;
with Snames; use Snames;
with Stringt; use Stringt;
with Tbuild; use Tbuild;
with Uname; use Uname;
......@@ -71,8 +71,8 @@ package body Lib.Writ is
Units.Increment_Last;
Units.Table (Units.Last) :=
(Unit_File_Name => File_Name (S),
Unit_Name => No_Name,
Expected_Unit => No_Name,
Unit_Name => No_Unit_Name,
Expected_Unit => No_Unit_Name,
Source_Index => S,
Cunit => Empty,
Cunit_Entity => Empty,
......@@ -427,7 +427,16 @@ package body Lib.Writ is
(Declaration_Node
(Body_Entity (Uent))))))
then
Write_Info_Str (" EE");
if Convention (Uent) = Convention_CIL then
-- Special case for generic CIL packages which never have
-- elaboration code
Write_Info_Str (" NE");
else
Write_Info_Str (" EE");
end if;
end if;
if Has_No_Elaboration_Code (Unode) then
......@@ -672,7 +681,7 @@ package body Lib.Writ is
-- For preproc. data and def. files, there is no Unit_Name,
-- check for that first.
if Unit_Name (J) /= No_Name
if Unit_Name (J) /= No_Unit_Name
and then (With_Flags (J) or else Unit_Name (J) = Pname)
then
Num_Withs := Num_Withs + 1;
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1996-2003 Free Software Foundation, Inc. --
-- Copyright (C) 1996-2007, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -27,13 +27,14 @@
with Atree; use Atree;
with Einfo; use Einfo;
with Errout; use Errout;
with Targparm; use Targparm;
with Namet; use Namet;
with Nlists; use Nlists;
with Sem; use Sem;
with Sem_Util; use Sem_Util;
with Sinfo; use Sinfo;
with Snames; use Snames;
with Stand; use Stand;
with Targparm; use Targparm;
package body Sem_Mech is
......@@ -274,6 +275,7 @@ package body Sem_Mech is
when Convention_Assembler |
Convention_C |
Convention_CIL |
Convention_CPP |
Convention_Java |
Convention_Stdcall =>
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1999-2006, Free Software Foundation, Inc. --
-- Copyright (C) 1999-2007, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -25,7 +25,6 @@
------------------------------------------------------------------------------
with Csets; use Csets;
with Namet; use Namet;
with Opt; use Opt;
with Osint; use Osint;
with Output; use Output;
......@@ -44,13 +43,14 @@ package body Targparm is
BDC, -- Backend_Divide_Checks
BOC, -- Backend_Overflow_Checks
CLA, -- Command_Line_Args
CLI, -- CLI (.NET)
CRT, -- Configurable_Run_Times
CSV, -- Compiler_System_Version
D32, -- Duration_32_Bits
DEN, -- Denorm
EXS, -- Exit_Status_Supported
FEL, -- Frontend_Layout
FFO, -- Fractional_Fixed_Ops
JVM, -- JVM
MOV, -- Machine_Overflows
MRN, -- Machine_Rounds
PAS, -- Preallocated_Stacks
......@@ -68,9 +68,6 @@ package body Targparm is
ZCD, -- ZCX_By_Default
ZCG); -- GCC_ZCX_Support
subtype Targparm_Tags_OK is Targparm_Tags range AAM .. ZCG;
-- Range excluding obsolete entries
Targparm_Flags : array (Targparm_Tags) of Boolean := (others => False);
-- Flag is set True if corresponding parameter is scanned
......@@ -80,13 +77,14 @@ package body Targparm is
BDC_Str : aliased constant Source_Buffer := "Backend_Divide_Checks";
BOC_Str : aliased constant Source_Buffer := "Backend_Overflow_Checks";
CLA_Str : aliased constant Source_Buffer := "Command_Line_Args";
CLI_Str : aliased constant Source_Buffer := "CLI";
CRT_Str : aliased constant Source_Buffer := "Configurable_Run_Time";
CSV_Str : aliased constant Source_Buffer := "Compiler_System_Version";
D32_Str : aliased constant Source_Buffer := "Duration_32_Bits";
DEN_Str : aliased constant Source_Buffer := "Denorm";
EXS_Str : aliased constant Source_Buffer := "Exit_Status_Supported";
FEL_Str : aliased constant Source_Buffer := "Frontend_Layout";
FFO_Str : aliased constant Source_Buffer := "Fractional_Fixed_Ops";
JVM_Str : aliased constant Source_Buffer := "JVM";
MOV_Str : aliased constant Source_Buffer := "Machine_Overflows";
MRN_Str : aliased constant Source_Buffer := "Machine_Rounds";
PAS_Str : aliased constant Source_Buffer := "Preallocated_Stacks";
......@@ -113,13 +111,14 @@ package body Targparm is
BDC_Str'Access,
BOC_Str'Access,
CLA_Str'Access,
CLI_Str'Access,
CRT_Str'Access,
CSV_Str'Access,
D32_Str'Access,
DEN_Str'Access,
EXS_Str'Access,
FEL_Str'Access,
FFO_Str'Access,
JVM_Str'Access,
MOV_Str'Access,
MRN_Str'Access,
PAS_Str'Access,
......@@ -549,13 +548,22 @@ package body Targparm is
when BDC => Backend_Divide_Checks_On_Target := Result;
when BOC => Backend_Overflow_Checks_On_Target := Result;
when CLA => Command_Line_Args_On_Target := Result;
when CLI =>
if Result then
VM_Target := CLI_Target;
end if;
when CRT => Configurable_Run_Time_On_Target := Result;
when CSV => Compiler_System_Version := Result;
when D32 => Duration_32_Bits_On_Target := Result;
when DEN => Denorm_On_Target := Result;
when EXS => Exit_Status_Supported_On_Target := Result;
when FEL => Frontend_Layout_On_Target := Result;
when FFO => Fractional_Fixed_Ops_On_Target := Result;
when JVM =>
if Result then
VM_Target := JVM_Target;
end if;
when MOV => Machine_Overflows_On_Target := Result;
when MRN => Machine_Rounds_On_Target := Result;
when PAS => Preallocated_Stacks_On_Target := Result;
......@@ -614,27 +622,6 @@ package body Targparm is
Multi_Unit_Index_Character := '$';
end if;
-- Check no missing target parameter settings (skip for compiler vsn)
if not Compiler_System_Version then
for K in Targparm_Tags_OK loop
if not Targparm_Flags (K) then
Set_Standard_Error;
Write_Line
("fatal error: system.ads is incorrectly formatted");
Write_Str ("missing line for parameter: ");
for J in Targparm_Str (K)'Range loop
Write_Char (Targparm_Str (K).all (J));
end loop;
Write_Eol;
Set_Standard_Output;
Fatal := True;
end if;
end loop;
end if;
if Fatal then
raise Unrecoverable_Error;
end if;
......
......@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 1999-2006, Free Software Foundation, Inc. --
-- Copyright (C) 1999-2007, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -77,6 +77,7 @@
-- only item in this category is whether type Address is private.
with Rident; use Rident;
with Namet; use Namet;
with Types; use Types;
package Targparm is
......@@ -166,11 +167,11 @@ package Targparm is
--------------------------
Executable_Extension_On_Target : Name_Id := No_Name;
-- Executable extension on the target.
-- This name is useful for setting the executable extension in a
-- dynamic way, e.g. depending on the run-time used, rather than
-- using a configure-time macro as done by Get_Target_Executable_Suffix.
-- If not set (No_Name), use GNAT.OS_Lib.Get_Target_Executable_Suffix.
-- Executable extension on the target. This name is useful for setting
-- the executable extension in a dynamic way, e.g. depending on the
-- run time used, rather than using a configure-time macro as done by
-- Get_Target_Executable_Suffix. If not set (No_Name), instead use
-- System.OS_Lib.Get_Target_Executable_Suffix.
-----------------------
-- Target Parameters --
......@@ -187,24 +188,14 @@ package Targparm is
-- text buffer containing the source of the system package.
-- The default values here are used if no value is found in system.ads.
-- This should normally happen only if the special version of system.ads
-- used by the compiler itself is in use. The default values are suitable
-- for use by the compiler itself in normal environments. This approach
-- allows the possibility of new versions of the compiler (possibly with
-- new system parameters added) being used to compile older versions of
-- the compiler sources. This is not guaranteed to work, but often will
-- and by setting appropriate default values, we make it more likely that
-- this can succeed.
Compiler_System_Version : Boolean := True;
-- This is set False in all target dependent versions of System. In the
-- compiler default version, it is omitted entirely, meaning that the
-- above default value of True will be set. If the flag is False, then
-- the scanning circuits in the body of this package do an error check to
-- ensure that all parameters other than this one are specified and not
-- defaulted. If the parameter is set True, then this check is omitted,
-- and any parameters not present in system.ads are left set to their
-- default value as described above.
-- This should normally happen if the special version of system.ads used
-- by the compiler itself is in use or if the value is only relevant to
-- a particular target (e.g. OpenVMS, AAMP). The default values are
-- suitable for use in normal environments. This approach allows the
-- possibility of new versions of the compiler (possibly with new system
-- parameters added) being used to compile older versions of the compiler
-- sources, as well as avoiding duplicating values in all system-*.ads
-- files for flags that are used on a few platforms only.
----------------------------
-- Special Target Control --
......@@ -220,6 +211,10 @@ package Targparm is
OpenVMS_On_Target : Boolean := False;
-- Set to True if target is OpenVMS
type Virtual_Machine_Kind is (No_VM, JVM_Target, CLI_Target);
VM_Target : Virtual_Machine_Kind := No_VM;
-- Kind of virtual machine targetted
-------------------------------
-- Backend Arithmetic Checks --
-------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment