[multiple changes]
2013-04-25 Robert Dewar <dewar@adacore.com> * sem_util.adb: Minor reformatting. 2013-04-25 Ed Schonberg <schonberg@adacore.com> * exp_aggr.adb (Expand_N_Aggregate): Use special circuitry to fold strings with a single others choice only if there are no expressions in the aggregate. 2013-04-25 Arnaud Charlet <charlet@adacore.com> * gnat_ugn.texi: Update doc on Ada 2012 default mode. From-SVN: r198293
This commit is contained in:
parent
8b404dac66
commit
49eef89f35
@ -1,3 +1,17 @@
|
|||||||
|
2013-04-25 Robert Dewar <dewar@adacore.com>
|
||||||
|
|
||||||
|
* sem_util.adb: Minor reformatting.
|
||||||
|
|
||||||
|
2013-04-25 Ed Schonberg <schonberg@adacore.com>
|
||||||
|
|
||||||
|
* exp_aggr.adb (Expand_N_Aggregate): Use special circuitry to
|
||||||
|
fold strings with a single others choice only if there are no
|
||||||
|
expressions in the aggregate.
|
||||||
|
|
||||||
|
2013-04-25 Arnaud Charlet <charlet@adacore.com>
|
||||||
|
|
||||||
|
* gnat_ugn.texi: Update doc on Ada 2012 default mode.
|
||||||
|
|
||||||
2013-04-25 Hristian Kirtchev <kirtchev@adacore.com>
|
2013-04-25 Hristian Kirtchev <kirtchev@adacore.com>
|
||||||
|
|
||||||
* exp_ch6.adb: Add with and use clause for Stringt.
|
* exp_ch6.adb: Add with and use clause for Stringt.
|
||||||
|
@ -5226,9 +5226,10 @@ package body Exp_Aggr is
|
|||||||
else
|
else
|
||||||
-- A special case, if we have a string subtype with bounds 1 .. N,
|
-- A special case, if we have a string subtype with bounds 1 .. N,
|
||||||
-- where N is known at compile time, and the aggregate is of the
|
-- where N is known at compile time, and the aggregate is of the
|
||||||
-- form (others => 'x'), and N is less than 80 (an arbitrary limit
|
-- form (others => 'x'), with a single choice and no expressions,
|
||||||
-- for now), then replace the aggregate by the equivalent string
|
-- and N is less than 80 (an arbitrary limit for now), then replace
|
||||||
-- literal (but do not mark it as static since it is not!)
|
-- the aggregate by the equivalent string literal (but do not mark
|
||||||
|
-- it as static since it is not!)
|
||||||
|
|
||||||
-- Note: this entire circuit is redundant with respect to code in
|
-- Note: this entire circuit is redundant with respect to code in
|
||||||
-- Expand_Array_Aggregate that collapses others choices to positional
|
-- Expand_Array_Aggregate that collapses others choices to positional
|
||||||
@ -5262,6 +5263,7 @@ package body Exp_Aggr is
|
|||||||
begin
|
begin
|
||||||
if Nkind (First (Choices (CA))) = N_Others_Choice
|
if Nkind (First (Choices (CA))) = N_Others_Choice
|
||||||
and then Nkind (Expression (CA)) = N_Character_Literal
|
and then Nkind (Expression (CA)) = N_Character_Literal
|
||||||
|
and then No (Expressions (N))
|
||||||
then
|
then
|
||||||
declare
|
declare
|
||||||
T : constant Entity_Id := Etype (N);
|
T : constant Entity_Id := Etype (N);
|
||||||
|
@ -89,8 +89,6 @@ Texts. A copy of the license is included in the section entitled
|
|||||||
|
|
||||||
@set FSFEDITION
|
@set FSFEDITION
|
||||||
@set EDITION GNAT
|
@set EDITION GNAT
|
||||||
@set DEFAULTLANGUAGEVERSION Ada 2005
|
|
||||||
@set NONDEFAULTLANGUAGEVERSION Ada 95
|
|
||||||
|
|
||||||
@ifset unw
|
@ifset unw
|
||||||
@set PLATFORM
|
@set PLATFORM
|
||||||
@ -237,15 +235,13 @@ toolset for the full Ada programming language.
|
|||||||
It documents the features of the compiler and tools, and explains
|
It documents the features of the compiler and tools, and explains
|
||||||
how to use them to build Ada applications.
|
how to use them to build Ada applications.
|
||||||
|
|
||||||
@value{EDITION} implements Ada 95 and Ada 2005, and it may also be invoked in
|
@value{EDITION} implements Ada 95, Ada 2005 and Ada 2012, and it may also be
|
||||||
Ada 83 compatibility mode.
|
invoked in Ada 83 compatibility mode.
|
||||||
By default, @value{EDITION} assumes @value{DEFAULTLANGUAGEVERSION},
|
By default, @value{EDITION} assumes Ada 2012, but you can override with a
|
||||||
but you can override with a compiler switch
|
compiler switch (@pxref{Compiling Different Versions of Ada})
|
||||||
(@pxref{Compiling Different Versions of Ada})
|
|
||||||
to explicitly specify the language version.
|
to explicitly specify the language version.
|
||||||
Throughout this manual, references to ``Ada'' without a year suffix
|
Throughout this manual, references to ``Ada'' without a year suffix
|
||||||
apply to both the Ada 95 and Ada 2005 versions of the language.
|
apply to both all Ada 95/2005/2012 versions of the language.
|
||||||
|
|
||||||
|
|
||||||
@ifclear FSFEDITION
|
@ifclear FSFEDITION
|
||||||
For ease of exposition, ``@value{EDITION}'' will be referred to simply as
|
For ease of exposition, ``@value{EDITION}'' will be referred to simply as
|
||||||
@ -253,8 +249,6 @@ For ease of exposition, ``@value{EDITION}'' will be referred to simply as
|
|||||||
@end ifclear
|
@end ifclear
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@menu
|
@menu
|
||||||
* What This Guide Contains::
|
* What This Guide Contains::
|
||||||
* What You Should Know before Reading This Guide::
|
* What You Should Know before Reading This Guide::
|
||||||
@ -6762,8 +6756,8 @@ and specifications where a separate body is present).
|
|||||||
@noindent
|
@noindent
|
||||||
The switches described in this section allow you to explicitly specify
|
The switches described in this section allow you to explicitly specify
|
||||||
the version of the Ada language that your programs are written in.
|
the version of the Ada language that your programs are written in.
|
||||||
By default @value{EDITION} assumes @value{DEFAULTLANGUAGEVERSION},
|
The default mode is Ada 2012,
|
||||||
but you can also specify @value{NONDEFAULTLANGUAGEVERSION} or
|
but you can also specify Ada 95, Ada 2005 mode, or
|
||||||
indicate Ada 83 compatibility mode.
|
indicate Ada 83 compatibility mode.
|
||||||
|
|
||||||
@table @option
|
@table @option
|
||||||
@ -6831,13 +6825,6 @@ may generally be compiled using this switch (see the description of the
|
|||||||
@option{-gnat83} and @option{-gnat95} switches for further
|
@option{-gnat83} and @option{-gnat95} switches for further
|
||||||
information).
|
information).
|
||||||
|
|
||||||
@ifset PROEDITION
|
|
||||||
Note that even though Ada 2005 is the current official version of the
|
|
||||||
language, GNAT still compiles in Ada 95 mode by default, so if you are
|
|
||||||
using Ada 2005 features in your program, you must use this switch (or
|
|
||||||
the equivalent Ada_05 or Ada_2005 configuration pragmas).
|
|
||||||
@end ifset
|
|
||||||
|
|
||||||
@item -gnat12 or -gnat2012 (Ada 2012 mode)
|
@item -gnat12 or -gnat2012 (Ada 2012 mode)
|
||||||
@cindex @option{-gnat12} (@command{gcc})
|
@cindex @option{-gnat12} (@command{gcc})
|
||||||
@cindex @option{-gnat2012} (@command{gcc})
|
@cindex @option{-gnat2012} (@command{gcc})
|
||||||
@ -6845,7 +6832,7 @@ the equivalent Ada_05 or Ada_2005 configuration pragmas).
|
|||||||
|
|
||||||
@noindent
|
@noindent
|
||||||
This switch directs the compiler to implement the Ada 2012 version of the
|
This switch directs the compiler to implement the Ada 2012 version of the
|
||||||
language.
|
language (also the default).
|
||||||
Since Ada 2012 is almost completely upwards
|
Since Ada 2012 is almost completely upwards
|
||||||
compatible with Ada 2005 (and thus also with Ada 83, and Ada 95),
|
compatible with Ada 2005 (and thus also with Ada 83, and Ada 95),
|
||||||
Ada 83 and Ada 95 programs
|
Ada 83 and Ada 95 programs
|
||||||
@ -6853,11 +6840,6 @@ may generally be compiled using this switch (see the description of the
|
|||||||
@option{-gnat83}, @option{-gnat95}, and @option{-gnat05/2005} switches
|
@option{-gnat83}, @option{-gnat95}, and @option{-gnat05/2005} switches
|
||||||
for further information).
|
for further information).
|
||||||
|
|
||||||
For information about the approved ``Ada Issues'' that have been incorporated
|
|
||||||
into Ada 2012, see @url{http://www.ada-auth.org/ais.html}.
|
|
||||||
Included with GNAT releases is a file @file{features-ada12} that describes
|
|
||||||
the set of implemented Ada 2012 features.
|
|
||||||
|
|
||||||
@item -gnatX (Enable GNAT Extensions)
|
@item -gnatX (Enable GNAT Extensions)
|
||||||
@cindex @option{-gnatX} (@command{gcc})
|
@cindex @option{-gnatX} (@command{gcc})
|
||||||
@cindex Ada language extensions
|
@cindex Ada language extensions
|
||||||
|
@ -8891,10 +8891,10 @@ package body Sem_Util is
|
|||||||
begin
|
begin
|
||||||
Note_Possible_Modification (AV, Sure => True);
|
Note_Possible_Modification (AV, Sure => True);
|
||||||
|
|
||||||
-- We must reject parenthesized variable names. The check for
|
-- We must reject parenthesized variable names. Comes_From_Source is
|
||||||
-- Comes_From_Source is present because there are currently
|
-- checked because there are currently cases where the compiler violates
|
||||||
-- cases where the compiler violates this rule (e.g. passing
|
-- this rule (e.g. passing a task object to its controlled Initialize
|
||||||
-- a task object to its controlled Initialize routine).
|
-- routine). This should be properly documented in sinfo???
|
||||||
|
|
||||||
if Paren_Count (AV) > 0 and then Comes_From_Source (AV) then
|
if Paren_Count (AV) > 0 and then Comes_From_Source (AV) then
|
||||||
return False;
|
return False;
|
||||||
@ -8907,15 +8907,13 @@ package body Sem_Util is
|
|||||||
-- Unchecked conversions are allowed only if they come from the
|
-- Unchecked conversions are allowed only if they come from the
|
||||||
-- generated code, which sometimes uses unchecked conversions for out
|
-- generated code, which sometimes uses unchecked conversions for out
|
||||||
-- parameters in cases where code generation is unaffected. We tell
|
-- parameters in cases where code generation is unaffected. We tell
|
||||||
-- source unchecked conversions by seeing if they are rewrites of an
|
-- source unchecked conversions by seeing if they are rewrites of
|
||||||
-- original Unchecked_Conversion function call, or of an explicit
|
-- an original Unchecked_Conversion function call, or of an explicit
|
||||||
-- conversion of a function call or an aggregate (as may happen in the
|
-- conversion of a function call or an aggregate (as may happen in the
|
||||||
-- expansion of a packed array aggregate).
|
-- expansion of a packed array aggregate).
|
||||||
|
|
||||||
elsif Nkind (AV) = N_Unchecked_Type_Conversion then
|
elsif Nkind (AV) = N_Unchecked_Type_Conversion then
|
||||||
if Nkind_In (Original_Node (AV),
|
if Nkind_In (Original_Node (AV), N_Function_Call, N_Aggregate) then
|
||||||
N_Function_Call, N_Aggregate)
|
|
||||||
then
|
|
||||||
return False;
|
return False;
|
||||||
|
|
||||||
elsif Comes_From_Source (AV)
|
elsif Comes_From_Source (AV)
|
||||||
|
Loading…
Reference in New Issue
Block a user