[multiple changes]

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.

From-SVN: r145913
This commit is contained in:
Arnaud Charlet 2009-04-10 16:43:28 +02:00
parent b66c3ff49e
commit 8a78c50d6e
3 changed files with 53 additions and 13 deletions

View File

@ -1,3 +1,15 @@
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.
2009-04-10 Robert Dewar <dewar@adacore.com>
* gnat_rm.texi: Document that postconditions are tested on implicit

View File

@ -4341,6 +4341,13 @@ package body Exp_Attr is
Ttyp := Underlying_Type (Ttyp);
-- Ada 2005: The type may be a synchronized tagged type, in which
-- case the tag information is stored in the corresponding record.
if Is_Concurrent_Type (Ttyp) then
Ttyp := Corresponding_Record_Type (Ttyp);
end if;
if Prefix_Is_Type then
-- For VMs we leave the type attribute unexpanded because

View File

@ -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;