[multiple changes]

2014-01-21  Hristian Kirtchev  <kirtchev@adacore.com>

	* sem_prag.adb (Analyze_External_Property): Add processing for "others".
	(Analyze_Pragma): Update the grammar of pragma Abstract_State to
	include "others".

2014-01-21  Arnaud Charlet  <charlet@adacore.com>

	* gnat_ugn.texi: Minor updates.

From-SVN: r206889
This commit is contained in:
Arnaud Charlet 2014-01-21 17:24:37 +01:00
parent fb1fdf7d6b
commit 497716fecf
3 changed files with 94 additions and 28 deletions

View File

@ -1,3 +1,13 @@
2014-01-21 Hristian Kirtchev <kirtchev@adacore.com>
* sem_prag.adb (Analyze_External_Property): Add processing for "others".
(Analyze_Pragma): Update the grammar of pragma Abstract_State to
include "others".
2014-01-21 Arnaud Charlet <charlet@adacore.com>
* gnat_ugn.texi: Minor updates.
2014-01-21 Thomas Quinot <quinot@adacore.com> 2014-01-21 Thomas Quinot <quinot@adacore.com>
* exp_pakd.adb: Update comment, minor reformatting. * exp_pakd.adb: Update comment, minor reformatting.

View File

@ -3571,6 +3571,13 @@ This information is used by advanced coverage tools. See unit @file{SCOs}
in the compiler sources for details in files @file{scos.ads} and in the compiler sources for details in files @file{scos.ads} and
@file{scos.adb}. @file{scos.adb}.
@item -fdump-xref
@cindex @option{-fdump-xref} (@command{gcc})
Generates cross reference information in GLI files for C and C++ sources.
The GLI files have the same syntax as the ALI files for Ada, and can be used
for source navigation in IDEs and on the command line using e.g. gnatxref
and the @option{--ext=gli} switch.
@item -flto@r{[}=n@r{]} @item -flto@r{[}=n@r{]}
@cindex @option{-flto} (@command{gcc}) @cindex @option{-flto} (@command{gcc})
Enables Link Time Optimization. This switch must be used in conjunction Enables Link Time Optimization. This switch must be used in conjunction
@ -13177,9 +13184,9 @@ Do not look for library files in the system default directory.
@item --ext=@var{extension} @item --ext=@var{extension}
@cindex @option{--ext} (@command{gnatxref}) @cindex @option{--ext} (@command{gnatxref})
Specify an alternate ali file extension. The default is @code{ali} and other Specify an alternate ali file extension. The default is @code{ali} and other
extensions (e.g. @code{sli} for SPARK library files) may be specified via this extensions (e.g. @code{gli} for C/C++ sources when using @option{-fdump-xref})
switch. Note that if this switch overrides the default, which means that only may be specified via this switch. Note that if this switch overrides the
the new extension will be considered. default, which means that only the new extension will be considered.
@item --RTS=@var{rts-path} @item --RTS=@var{rts-path}
@cindex @option{--RTS} (@command{gnatxref}) @cindex @option{--RTS} (@command{gnatxref})
@ -13354,9 +13361,9 @@ Do not look for library files in the system default directory.
@item --ext=@var{extension} @item --ext=@var{extension}
@cindex @option{--ext} (@command{gnatfind}) @cindex @option{--ext} (@command{gnatfind})
Specify an alternate ali file extension. The default is @code{ali} and other Specify an alternate ali file extension. The default is @code{ali} and other
extensions (e.g. @code{sli} for SPARK library files) may be specified via this extensions (e.g. @code{gli} for C/C++ sources when using @option{-fdump-xref})
switch. Note that if this switch overrides the default, which means that only may be specified via this switch. Note that if this switch overrides the
the new extension will be considered. default, which means that only the new extension will be considered.
@item --RTS=@var{rts-path} @item --RTS=@var{rts-path}
@cindex @option{--RTS} (@command{gnatfind}) @cindex @option{--RTS} (@command{gnatfind})

View File

@ -9487,12 +9487,12 @@ package body Sem_Prag is
-- pragma Abstract_State (ABSTRACT_STATE_LIST) -- pragma Abstract_State (ABSTRACT_STATE_LIST)
-- ABSTRACT_STATE_LIST ::= -- ABSTRACT_STATE_LIST ::=
-- null -- null
-- | STATE_NAME_WITH_OPTIONS -- | STATE_NAME_WITH_OPTIONS
-- | (STATE_NAME_WITH_OPTIONS {, STATE_NAME_WITH_OPTIONS} ) -- | (STATE_NAME_WITH_OPTIONS {, STATE_NAME_WITH_OPTIONS} )
-- STATE_NAME_WITH_OPTIONS ::= -- STATE_NAME_WITH_OPTIONS ::=
-- STATE_NAME -- STATE_NAME
-- | (STATE_NAME with OPTION_LIST) -- | (STATE_NAME with OPTION_LIST)
-- OPTION_LIST ::= OPTION {, OPTION} -- OPTION_LIST ::= OPTION {, OPTION}
@ -9508,7 +9508,7 @@ package body Sem_Prag is
-- | External [=> EXTERNAL_PROPERTY_LIST] -- | External [=> EXTERNAL_PROPERTY_LIST]
-- EXTERNAL_PROPERTY_LIST ::= -- EXTERNAL_PROPERTY_LIST ::=
-- EXTERNAL_PROPERTY -- EXTERNAL_PROPERTY
-- | (EXTERNAL_PROPERTY {, EXTERNAL_PROPERTY} ) -- | (EXTERNAL_PROPERTY {, EXTERNAL_PROPERTY} )
-- EXTERNAL_PROPERTY ::= -- EXTERNAL_PROPERTY ::=
@ -9516,6 +9516,7 @@ package body Sem_Prag is
-- | Async_Writers [=> boolean_EXPRESSION] -- | Async_Writers [=> boolean_EXPRESSION]
-- | Effective_Reads [=> boolean_EXPRESSION] -- | Effective_Reads [=> boolean_EXPRESSION]
-- | Effective_Writes [=> boolean_EXPRESSION] -- | Effective_Writes [=> boolean_EXPRESSION]
-- others => boolean_EXPRESSION
-- STATE_NAME ::= defining_identifier -- STATE_NAME ::= defining_identifier
@ -9549,6 +9550,7 @@ package body Sem_Prag is
ER_Seen : Boolean := False; ER_Seen : Boolean := False;
EW_Seen : Boolean := False; EW_Seen : Boolean := False;
External_Seen : Boolean := False; External_Seen : Boolean := False;
Others_Seen : Boolean := False;
Part_Of_Seen : Boolean := False; Part_Of_Seen : Boolean := False;
-- Flags used to store the static value of all external states' -- Flags used to store the static value of all external states'
@ -9660,15 +9662,36 @@ package body Sem_Prag is
Expr_Val : Boolean; Expr_Val : Boolean;
begin begin
-- The external property must be one of the predefined four -- Check the placement of "others" (if available)
-- reader/writer choices.
if Nkind (Prop) /= N_Identifier if Nkind (Prop) = N_Others_Choice then
or else not Nam_In (Chars (Prop), Name_Async_Readers, if Others_Seen then
Name_Async_Writers, Error_Msg_N
Name_Effective_Reads, ("only one others choice allowed in option External",
Name_Effective_Writes) Prop);
else
Others_Seen := True;
end if;
elsif Others_Seen then
Error_Msg_N
("others must be the last property in option External",
Prop);
-- The only remaining legal options are the four predefined
-- external properties.
elsif Nkind (Prop) = N_Identifier
and then Nam_In (Chars (Prop), Name_Async_Readers,
Name_Async_Writers,
Name_Effective_Reads,
Name_Effective_Writes)
then then
null;
-- Otherwise the construct is not a valid property
else
Error_Msg_N ("invalid external state property", Prop); Error_Msg_N ("invalid external state property", Prop);
return; return;
end if; end if;
@ -9693,21 +9716,47 @@ package body Sem_Prag is
Expr_Val := True; Expr_Val := True;
end if; end if;
if Chars (Prop) = Name_Async_Readers then -- Named properties
Check_Duplicate_Option (Prop, AR_Seen);
AR_Val := Expr_Val;
elsif Chars (Prop) = Name_Async_Writers then if Nkind (Prop) = N_Identifier then
Check_Duplicate_Option (Prop, AW_Seen); if Chars (Prop) = Name_Async_Readers then
AW_Val := Expr_Val; Check_Duplicate_Option (Prop, AR_Seen);
AR_Val := Expr_Val;
elsif Chars (Prop) = Name_Effective_Reads then elsif Chars (Prop) = Name_Async_Writers then
Check_Duplicate_Option (Prop, ER_Seen); Check_Duplicate_Option (Prop, AW_Seen);
ER_Val := Expr_Val; AW_Val := Expr_Val;
elsif Chars (Prop) = Name_Effective_Reads then
Check_Duplicate_Option (Prop, ER_Seen);
ER_Val := Expr_Val;
else
Check_Duplicate_Option (Prop, EW_Seen);
EW_Val := Expr_Val;
end if;
-- The handling of property "others" must take into account
-- all other named properties that have been encountered so
-- far. Only those that have not been seen are affected by
-- "others".
else else
Check_Duplicate_Option (Prop, EW_Seen); if not AR_Seen then
EW_Val := Expr_Val; AR_Val := Expr_Val;
end if;
if not AW_Seen then
AW_Val := Expr_Val;
end if;
if not ER_Seen then
ER_Val := Expr_Val;
end if;
if not EW_Seen then
EW_Val := Expr_Val;
end if;
end if; end if;
end Analyze_External_Property; end Analyze_External_Property;