aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/prj-util.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2010-10-05 12:07:35 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2010-10-05 12:07:35 +0200
commit96d2756f41a4a5f90fa8c302e38be5e35761d14b (patch)
tree0fa2829f8d8a8f4fb45ed1d55d449fa99eaed70b /gcc/ada/prj-util.adb
parent610ef7c0f9b816601f89d3483ef9824da717c0e3 (diff)
downloadgcc-96d2756f41a4a5f90fa8c302e38be5e35761d14b.zip
gcc-96d2756f41a4a5f90fa8c302e38be5e35761d14b.tar.gz
gcc-96d2756f41a4a5f90fa8c302e38be5e35761d14b.tar.bz2
[multiple changes]
2010-10-05 Ed Schonberg <schonberg@adacore.com> * sem_res.adb (Check_Parameterless_Call): If the prefix of 'Address is an explicit dereference of an access to function, the prefix is not interpreted as a parameterless call. 2010-10-05 Ed Schonberg <schonberg@adacore.com> * exp_attr.adb: For 'Read and 'Write, use full view of base type if private. 2010-10-05 Vincent Celier <celier@adacore.com> * make.adb (Switches_Of): Allow wild cards in index of attributes Switches. * prj-util.adb (Value_Of): When Allow_Wildcards is True, use the index of the associative array as a glob regular expression. * prj-util.ads (Value_Of (Index, In_Array)): New Boolean parameter Allow_Wildcards, defaulted to False. (Value_Of (Name, Attribute_Or_Array_Name)): Ditto * projects.texi: Document that attribute Switches (<file name>) may use wild cards in the index. 2010-10-05 Robert Dewar <dewar@adacore.com> * a-direct.adb, a-direct.ads, back_end.adb, checks.adb, einfo.adb: Minor reformatting. * debug.adb: Remove obsolete documentation for d.Z flag. From-SVN: r164978
Diffstat (limited to 'gcc/ada/prj-util.adb')
-rw-r--r--gcc/ada/prj-util.adb19
1 files changed, 14 insertions, 5 deletions
diff --git a/gcc/ada/prj-util.adb b/gcc/ada/prj-util.adb
index ce5c38f..1bc8b11 100644
--- a/gcc/ada/prj-util.adb
+++ b/gcc/ada/prj-util.adb
@@ -26,6 +26,7 @@
with Ada.Unchecked_Deallocation;
with GNAT.Case_Util; use GNAT.Case_Util;
+with GNAT.Regexp; use GNAT.Regexp;
with Osint; use Osint;
with Output; use Output;
@@ -848,7 +849,8 @@ package body Prj.Util is
Src_Index : Int := 0;
In_Array : Array_Element_Id;
In_Tree : Project_Tree_Ref;
- Force_Lower_Case_Index : Boolean := False) return Variable_Value
+ Force_Lower_Case_Index : Boolean := False;
+ Allow_Wildcards : Boolean := False) return Variable_Value
is
Current : Array_Element_Id;
Element : Array_Element;
@@ -888,8 +890,13 @@ package body Prj.Util is
end if;
end if;
- if Real_Index_1 = Real_Index_2 and then
- Src_Index = Element.Src_Index
+ if Src_Index = Element.Src_Index and then
+ (Real_Index_1 = Real_Index_2 or else
+ (Real_Index_2 /= All_Other_Names and then
+ Allow_Wildcards and then
+ Match (Get_Name_String (Real_Index_1),
+ Compile (Get_Name_String (Real_Index_2),
+ Glob => True))))
then
return Element.Value;
else
@@ -906,7 +913,8 @@ package body Prj.Util is
Attribute_Or_Array_Name : Name_Id;
In_Package : Package_Id;
In_Tree : Project_Tree_Ref;
- Force_Lower_Case_Index : Boolean := False) return Variable_Value
+ Force_Lower_Case_Index : Boolean := False;
+ Allow_Wildcards : Boolean := False) return Variable_Value
is
The_Array : Array_Element_Id;
The_Attribute : Variable_Value := Nil_Variable_Value;
@@ -927,7 +935,8 @@ package body Prj.Util is
Src_Index => Index,
In_Array => The_Array,
In_Tree => In_Tree,
- Force_Lower_Case_Index => Force_Lower_Case_Index);
+ Force_Lower_Case_Index => Force_Lower_Case_Index,
+ Allow_Wildcards => Allow_Wildcards);
-- If there is no array element, look for a variable