Commit 434a2807 by Vincent Celier Committed by Arnaud Charlet

prj-attr.adb: New attribute Compiler'Name_Syntax (<lang>)

2008-08-01  Vincent Celier  <celier@adacore.com>

	* prj-attr.adb: New attribute Compiler'Name_Syntax (<lang>)
	
	* prj-nmsc.adb (Process_Compiler): Recognize attribute Name_Syntax
	
	* prj.adb (Object_Exist_For): Use Object_Generated, not
	Objects_Generated that is removed and was never modified anyway.

	* prj.ads:
	(Path_Syntax_Kind): New enumeration type
	(Language_Config): New component Path_Syntax, defaulted to Host.
	Components PIC_Option and Objects_Generated removed, as they are not
	used.

	* snames.adb: New standard name Path_Syntax
	
	* snames.ads: New standard name Path_Syntax

From-SVN: r138487
parent 44114dff
......@@ -168,6 +168,7 @@ package body Prj.Attr is
"Sadriver#" &
"Larequired_switches#" &
"Lapic_option#" &
"Sapath_syntax#" &
-- Configuration - Mapping files
......
......@@ -1509,6 +1509,22 @@ package body Prj.Nmsc is
From_List => Element.Value.Values,
In_Tree => In_Tree);
when Name_Path_Syntax =>
begin
In_Tree.Languages_Data.Table
(Lang_Index).Config.Path_Syntax :=
Path_Syntax_Kind'Value
(Get_Name_String (Element.Value.Value));
exception
when Constraint_Error =>
Error_Msg
(Project,
In_Tree,
"invalid value for Path_Syntax",
Element.Value.Location);
end;
when Name_Pic_Option =>
-- Attribute Compiler_Pic_Option (<language>)
......
......@@ -690,7 +690,7 @@ package body Prj is
if In_Tree.Languages_Data.Table (Lang).Name = Language_Id then
return
In_Tree.Languages_Data.Table
(Lang).Config.Objects_Generated;
(Lang).Config.Object_Generated;
end if;
Lang := In_Tree.Languages_Data.Table (Lang).Next;
......
......@@ -399,6 +399,10 @@ package Prj is
No_Source : constant Source_Id := 0;
type Path_Syntax_Kind is (Canonical, Host);
-- Canonical = Unix style
-- Host = host specific syntax, for example on VMS (the default)
type Language_Config is record
Kind : Language_Kind := File_Based;
-- Kind of language. All languages are file based, except Ada which is
......@@ -423,6 +427,10 @@ package Prj is
-- The list of switches that are required as a minimum to invoke the
-- compiler driver.
Path_Syntax : Path_Syntax_Kind := Host;
-- Value may be Canonical (Unix style) or Host (host syntax, for example
-- on VMS for DEC C).
Compilation_PIC_Option : Name_List_Index := No_Name_List;
-- The option(s) to compile a source in Position Independent Code for
-- shared libraries. Specified in the configuration. When not specified,
......@@ -525,12 +533,6 @@ package Prj is
Toolchain_Description : Name_Id := No_Name;
-- Hold the value of attribute Toolchain_Description for the language
PIC_Option : Name_Id := No_Name;
-- Hold the value of attribute Compiler'PIC_Option for the language
Objects_Generated : Boolean := True;
-- Indicates if objects are generated for the language
end record;
-- Record describing the configuration of a language
......@@ -541,6 +543,7 @@ package Prj is
Compiler_Driver => No_File,
Compiler_Driver_Path => null,
Compiler_Required_Switches => No_Name_List,
Path_Syntax => Canonical,
Compilation_PIC_Option => No_Name_List,
Object_Generated => True,
Objects_Linked => True,
......@@ -567,9 +570,7 @@ package Prj is
Binder_Required_Switches => No_Name_List,
Binder_Prefix => No_Name,
Toolchain_Version => No_Name,
Toolchain_Description => No_Name,
PIC_Option => No_Name,
Objects_Generated => True);
Toolchain_Description => No_Name);
type Language_Data is record
Name : Name_Id := No_Name;
......
......@@ -780,6 +780,7 @@ package body Snames is
"objects_path#" &
"objects_path_file#" &
"object_dir#" &
"path_syntax#" &
"pic_option#" &
"pretty_printer#" &
"prefix#" &
......
......@@ -1107,53 +1107,54 @@ package Snames is
Name_Objects_Path : constant Name_Id := N + 719;
Name_Objects_Path_File : constant Name_Id := N + 720;
Name_Object_Dir : constant Name_Id := N + 721;
Name_Pic_Option : constant Name_Id := N + 722;
Name_Pretty_Printer : constant Name_Id := N + 723;
Name_Prefix : constant Name_Id := N + 724;
Name_Project : constant Name_Id := N + 725;
Name_Roots : constant Name_Id := N + 726;
Name_Required_Switches : constant Name_Id := N + 727;
Name_Run_Path_Option : constant Name_Id := N + 728;
Name_Runtime_Project : constant Name_Id := N + 729;
Name_Shared_Library_Minimum_Switches : constant Name_Id := N + 730;
Name_Shared_Library_Prefix : constant Name_Id := N + 731;
Name_Shared_Library_Suffix : constant Name_Id := N + 732;
Name_Separate_Suffix : constant Name_Id := N + 733;
Name_Source_Dirs : constant Name_Id := N + 734;
Name_Source_Files : constant Name_Id := N + 735;
Name_Source_List_File : constant Name_Id := N + 736;
Name_Spec : constant Name_Id := N + 737;
Name_Spec_Suffix : constant Name_Id := N + 738;
Name_Specification : constant Name_Id := N + 739;
Name_Specification_Exceptions : constant Name_Id := N + 740;
Name_Specification_Suffix : constant Name_Id := N + 741;
Name_Stack : constant Name_Id := N + 742;
Name_Switches : constant Name_Id := N + 743;
Name_Symbolic_Link_Supported : constant Name_Id := N + 744;
Name_Sync : constant Name_Id := N + 745;
Name_Synchronize : constant Name_Id := N + 746;
Name_Toolchain_Description : constant Name_Id := N + 747;
Name_Toolchain_Version : constant Name_Id := N + 748;
Name_Runtime_Library_Dir : constant Name_Id := N + 749;
Name_Path_Syntax : constant Name_Id := N + 722;
Name_Pic_Option : constant Name_Id := N + 723;
Name_Pretty_Printer : constant Name_Id := N + 724;
Name_Prefix : constant Name_Id := N + 725;
Name_Project : constant Name_Id := N + 726;
Name_Roots : constant Name_Id := N + 727;
Name_Required_Switches : constant Name_Id := N + 728;
Name_Run_Path_Option : constant Name_Id := N + 729;
Name_Runtime_Project : constant Name_Id := N + 730;
Name_Shared_Library_Minimum_Switches : constant Name_Id := N + 731;
Name_Shared_Library_Prefix : constant Name_Id := N + 732;
Name_Shared_Library_Suffix : constant Name_Id := N + 733;
Name_Separate_Suffix : constant Name_Id := N + 734;
Name_Source_Dirs : constant Name_Id := N + 735;
Name_Source_Files : constant Name_Id := N + 736;
Name_Source_List_File : constant Name_Id := N + 737;
Name_Spec : constant Name_Id := N + 738;
Name_Spec_Suffix : constant Name_Id := N + 739;
Name_Specification : constant Name_Id := N + 740;
Name_Specification_Exceptions : constant Name_Id := N + 741;
Name_Specification_Suffix : constant Name_Id := N + 742;
Name_Stack : constant Name_Id := N + 743;
Name_Switches : constant Name_Id := N + 744;
Name_Symbolic_Link_Supported : constant Name_Id := N + 745;
Name_Sync : constant Name_Id := N + 746;
Name_Synchronize : constant Name_Id := N + 747;
Name_Toolchain_Description : constant Name_Id := N + 748;
Name_Toolchain_Version : constant Name_Id := N + 749;
Name_Runtime_Library_Dir : constant Name_Id := N + 750;
-- Other miscellaneous names used in front end
Name_Unaligned_Valid : constant Name_Id := N + 750;
Name_Unaligned_Valid : constant Name_Id := N + 751;
-- Ada 2005 reserved words
First_2005_Reserved_Word : constant Name_Id := N + 751;
Name_Interface : constant Name_Id := N + 751;
Name_Overriding : constant Name_Id := N + 752;
Name_Synchronized : constant Name_Id := N + 753;
Last_2005_Reserved_Word : constant Name_Id := N + 753;
First_2005_Reserved_Word : constant Name_Id := N + 752;
Name_Interface : constant Name_Id := N + 752;
Name_Overriding : constant Name_Id := N + 753;
Name_Synchronized : constant Name_Id := N + 754;
Last_2005_Reserved_Word : constant Name_Id := N + 754;
subtype Ada_2005_Reserved_Words is
Name_Id range First_2005_Reserved_Word .. Last_2005_Reserved_Word;
-- Mark last defined name for consistency check in Snames body
Last_Predefined_Name : constant Name_Id := N + 753;
Last_Predefined_Name : constant Name_Id := N + 754;
---------------------------------------
-- Subtypes Defining Name Categories --
......
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