summaryrefslogtreecommitdiff
path: root/gcc/ada/g-comlin.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-10 14:43:28 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-10 14:43:28 +0000
commit8188864bf70425d928dbded9b924614dd8c4ab71 (patch)
tree91d1547a1ae1bad765c6ee2a23ba711b2c423ae1 /gcc/ada/g-comlin.adb
parent1ce752d5cbd9d26c1c57811908a878ce2eba6afb (diff)
downloadgcc-8188864bf70425d928dbded9b924614dd8c4ab71.tar.gz
2009-04-10 Ed Schonberg <schonberg@adacore.com>
* exp_attr.adb (Expand_N_Attribute_Reference, case 'Tag): If the tagged type is a synchronized type, retrieve tag information from the corresponding record, which has the dispatch table link. 2009-04-10 Jerome Lambourg <lambourg@adacore.com> * g-comlin.adb (Group_Analysis): Take care of switches that might be decomposed afterwards, but are present as-is in the command line configuration, and thus should be kept as-is. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145913 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/g-comlin.adb')
-rw-r--r--gcc/ada/g-comlin.adb47
1 files changed, 34 insertions, 13 deletions
diff --git a/gcc/ada/g-comlin.adb b/gcc/ada/g-comlin.adb
index adb1553836e..307f890750e 100644
--- a/gcc/ada/g-comlin.adb
+++ b/gcc/ada/g-comlin.adb
@@ -1509,22 +1509,43 @@ package body GNAT.Command_Line is
end Group_Analysis;
begin
- -- Are we adding a switch that can in fact be expanded through aliases ?
- -- If yes, we add separately each of its expansion.
+ -- First determine if the switch corresponds to one belonging to the
+ -- configuration. If so, run callback and exit.
+
+ if Cmd.Config /= null and then Cmd.Config.Switches /= null then
+ for S in Cmd.Config.Switches'Range loop
+ declare
+ Config_Switch : String renames Cmd.Config.Switches (S).all;
+ begin
+ if Actual_Switch (Config_Switch) = Switch
+ and then
+ ((Can_Have_Parameter (Config_Switch)
+ and then Parameter /= "")
+ or else
+ (not Require_Parameter (Config_Switch)
+ and then Parameter = ""))
+ then
+ Callback (Switch, Parameter);
+ return;
+ end if;
+ end;
+ end loop;
+ end if;
+
+ -- If adding a switch that can in fact be expanded through aliases,
+ -- add separately each of its expansions.
-- This takes care of expansions like "-T" -> "-gnatwrs", where the
-- alias and its expansion do not have the same prefix. Given the order
-- in which we do things here, the expansion of the alias will itself
- -- be checked for a common prefix and further split into simple switches
+ -- be checked for a common prefix and split into simple switches.
if Unalias
and then Cmd.Config /= null
and then Cmd.Config.Aliases /= null
then
for A in Cmd.Config.Aliases'Range loop
- if Cmd.Config.Aliases (A).all = Switch
- and then Parameter = ""
- then
+ if Cmd.Config.Aliases (A).all = Switch and then Parameter = "" then
For_Each_Simple_Switch
(Cmd, Cmd.Config.Expansions (A).all, "");
return;
@@ -1532,18 +1553,17 @@ package body GNAT.Command_Line is
end loop;
end if;
- -- Are we adding a switch grouping several switches ? If yes, add each
- -- of the simple switches instead.
+ -- If adding a switch grouping several switches, add each of the simple
+ -- switches instead.
- if Cmd.Config /= null
- and then Cmd.Config.Prefixes /= null
- then
+ if Cmd.Config /= null and then Cmd.Config.Prefixes /= null then
for P in Cmd.Config.Prefixes'Range loop
if Switch'Length > Cmd.Config.Prefixes (P)'Length + 1
and then Looking_At
(Switch, Switch'First, Cmd.Config.Prefixes (P).all)
then
-- Alias expansion will be done recursively
+
if Cmd.Config.Switches = null then
for S in Switch'First + Cmd.Config.Prefixes (P)'Length
.. Switch'Last
@@ -1560,8 +1580,9 @@ package body GNAT.Command_Line is
(Switch'First + Cmd.Config.Prefixes (P)'Length
.. Switch'Last))
then
- -- Recursive calls already done on each switch of the
- -- group. Let's return to not call Callback.
+ -- Recursive calls already done on each switch of the group:
+ -- Return without executing Callback.
+
return;
end if;
end if;