summaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-13 10:32:13 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-13 10:32:13 +0000
commitc310752724a6c7b262a7c91275bae6579f607e0e (patch)
treef7b58b4cae33ed6726612c0bde2cd261451d1d52 /gcc/ada
parent4f986f8be0481dfebdc43dae04bb30fa6316f8a6 (diff)
downloadgcc-c310752724a6c7b262a7c91275bae6579f607e0e.tar.gz
2011-10-13 Sergey Rybin <rybin@adacore.com>
* gnat_ugn.texi, vms_data.ads: Add an option to control enumeration literal casing. 2011-10-13 Nicolas Roche <roche@adacore.com> * gnatlink.adb: Ensure that -mrtp is passed when runtime name ends with 'rtp'. 2011-10-13 Ed Schonberg <schonberg@adacore.com> * sem_prag.adb (Analyze_Pragma, case Unchecked_Union): an unchecked union type can be limited. 2011-10-13 Olivier Hainque <hainque@adacore.com> * init.c (__gnat_error_handler) <VxWorks version>: Add comments on the use of the signal trampoline for PPC in the sjlj case as well. Add legitimate casts, preventing compile time warnings on the (sighandler *) profile. 2011-10-13 Yannick Moy <moy@adacore.com> * sem_aggr.adb (Resolve_Aggr_Expr): Always perform semantic analysis in Alfa mode. 2011-10-13 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (OK_For_Limited_Init_In_05): Conditional and case expressions are legal limited return values if each one of their dependent expressions are legal. 2011-10-13 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb (Analyze_Procedure_Call_Statement): In Ada 2012 mode, if the prefix of the call is a qualified expression, rewrite as a code statement. * sem_ch13.adb (Analyze_Code_Statement): In Ada 2012 mode, the code statement is legal if it is a rewriting of a procedure call. 2011-10-13 Ed Schonberg <schonberg@adacore.com> * exp_aggr.adb (Flatten): If a component association has a box, assume that aggregate is not static. (Safe_Aggregate): If a component association in a non-limited aggregate has a box, assume that it cannot be expanded in place. 2011-10-13 Vincent Celier <celier@adacore.com> * prj-conf.adb (Get_Or_Create_Configuration_File): Call Process_Project_Tree_Phase_1 with Packages_To_Check. (Process_Project_And_Apply_Config): Ditto * prj-part.ads, prj-part.adb, prj-pars.ads, prj-pars.adb (Parse): Remove default for argument Packages_To_Check. * prj-proc.adb (Recursive_Process): New argument Packages_To_Check. (Process): Ditto. (Process_Project_Tree_Phase_1): Ditto. (Recursive_Project.Process_Aggregated_Projects): Call Prj.Part.Parse and Process_Project_Tree_Phase_1 with Packages_To_Check. * prj-proc.ads (Process): New argument Packages_To_Check (Process_Project_Tree_Phase_1): Ditto git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179902 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog65
-rw-r--r--gcc/ada/exp_aggr.adb15
-rw-r--r--gcc/ada/gnat_ugn.texi17
-rw-r--r--gcc/ada/gnatlink.adb4
-rw-r--r--gcc/ada/init.c11
-rw-r--r--gcc/ada/sem_aggr.adb6
-rw-r--r--gcc/ada/sem_ch13.adb10
-rw-r--r--gcc/ada/sem_ch3.adb32
-rw-r--r--gcc/ada/sem_ch6.adb9
-rw-r--r--gcc/ada/sem_prag.adb6
-rw-r--r--gcc/ada/vms_data.ads25
11 files changed, 188 insertions, 12 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 80c2c7a7578..003158f5cbd 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,68 @@
+2011-10-13 Sergey Rybin <rybin@adacore.com>
+
+ * gnat_ugn.texi, vms_data.ads: Add an option to control enumeration
+ literal casing.
+
+2011-10-13 Nicolas Roche <roche@adacore.com>
+
+ * gnatlink.adb: Ensure that -mrtp is passed when
+ runtime name ends with 'rtp'.
+
+2011-10-13 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_prag.adb (Analyze_Pragma, case Unchecked_Union): an
+ unchecked union type can be limited.
+
+2011-10-13 Olivier Hainque <hainque@adacore.com>
+
+ * init.c (__gnat_error_handler) <VxWorks version>: Add comments on
+ the use of the signal trampoline for PPC in the sjlj case as well.
+ Add legitimate casts, preventing compile time warnings on the
+ (sighandler *) profile.
+
+2011-10-13 Yannick Moy <moy@adacore.com>
+
+ * sem_aggr.adb (Resolve_Aggr_Expr): Always perform semantic
+ analysis in Alfa mode.
+
+2011-10-13 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch3.adb (OK_For_Limited_Init_In_05): Conditional and case
+ expressions are legal limited return values if each one of their
+ dependent expressions are legal.
+
+2011-10-13 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch6.adb (Analyze_Procedure_Call_Statement): In Ada 2012 mode,
+ if the prefix of the call is a qualified expression, rewrite as
+ a code statement.
+ * sem_ch13.adb (Analyze_Code_Statement): In Ada 2012 mode, the
+ code statement is legal if it is a rewriting of a procedure call.
+
+2011-10-13 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_aggr.adb (Flatten): If a component association has a box,
+ assume that aggregate is not static.
+ (Safe_Aggregate): If a component association in a non-limited
+ aggregate has a box, assume that it cannot be expanded in place.
+
+2011-10-13 Vincent Celier <celier@adacore.com>
+
+ * prj-conf.adb (Get_Or_Create_Configuration_File): Call
+ Process_Project_Tree_Phase_1 with Packages_To_Check.
+ (Process_Project_And_Apply_Config): Ditto
+ * prj-part.ads, prj-part.adb, prj-pars.ads, prj-pars.adb (Parse):
+ Remove default for argument Packages_To_Check.
+ * prj-proc.adb (Recursive_Process): New argument
+ Packages_To_Check.
+ (Process): Ditto.
+ (Process_Project_Tree_Phase_1): Ditto.
+ (Recursive_Project.Process_Aggregated_Projects): Call
+ Prj.Part.Parse and Process_Project_Tree_Phase_1 with
+ Packages_To_Check.
+ * prj-proc.ads (Process): New argument Packages_To_Check
+ (Process_Project_Tree_Phase_1): Ditto
+
2011-10-13 Arnaud Charlet <charlet@adacore.com>
* gcc-interface/Makefile.in: Fix typo.
diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb
index d06d8b9fb54..b48b2281b3d 100644
--- a/gcc/ada/exp_aggr.adb
+++ b/gcc/ada/exp_aggr.adb
@@ -3398,6 +3398,15 @@ package body Exp_Aggr is
begin
Assoc := First (Component_Associations (N));
while Present (Assoc) loop
+
+ -- If this is a box association, flattening is in general
+ -- not possible because at this point we cannot tell if the
+ -- default is static or even exists.
+
+ if Box_Present (Assoc) then
+ return False;
+ end if;
+
Choice := First (Choices (Assoc));
while Present (Choice) loop
@@ -4148,6 +4157,12 @@ package body Exp_Aggr is
return False;
end if;
+ -- If association has a box, no way to determine yet
+ -- whether default can be assigned in place.
+
+ elsif Box_Present (Expr) then
+ return False;
+
elsif not Safe_Component (Expression (Expr)) then
return False;
end if;
diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi
index 6d9138c7505..d7e7a7d8d1a 100644
--- a/gcc/ada/gnat_ugn.texi
+++ b/gcc/ada/gnat_ugn.texi
@@ -13002,6 +13002,23 @@ Names are in lower case
@item ^-nM^/NAME_CASING=MIXED_CASE^
Names are in mixed case
+@cindex @option{^-ne@var{x}^/ENUM_CASING^} (@command{gnatpp})
+@item ^-neD^/ENUM_CASING=AS_DECLARED^
+Enumeration literal casing for defining occurrences are as they appear in the
+source file. Overrides ^-n^/NAME_CASING^ casing setting.
+
+@item ^-neU^/ENUM_CASING=UPPER_CASE^
+Enumeration literals are in upper case. Overrides ^-n^/NAME_CASING^ casing
+setting.
+
+@item ^-neL^/ENUM_CASING=LOWER_CASE^
+Enumeration literals are in lower case. Overrides ^-n^/NAME_CASING^ casing
+setting.
+
+@item ^-neM^/ENUM_CASING=MIXED_CASE^
+Enumeration literals are in mixed case. Overrides ^-n^/NAME_CASING^ casing
+setting.
+
@cindex @option{^-p@var{x}^/PRAGMA_CASING^} (@command{gnatpp})
@item ^-pL^/PRAGMA_CASING=LOWER_CASE^
Pragma names are lower case
diff --git a/gcc/ada/gnatlink.adb b/gcc/ada/gnatlink.adb
index 61d3db3861f..de9d491f2bd 100644
--- a/gcc/ada/gnatlink.adb
+++ b/gcc/ada/gnatlink.adb
@@ -1614,7 +1614,9 @@ begin
-- Pass -mrtp to the linker if --RTS=rtp was passed
if Arg'Length > 8
- and then Arg (Arg'First + 6 .. Arg'First + 8) = "rtp"
+ and then
+ (Arg (Arg'First + 6 .. Arg'First + 8) = "rtp"
+ or else Arg (Arg'Last - 2 .. Arg'Last) = "rtp")
then
Linker_Options.Increment_Last;
Linker_Options.Table (Linker_Options.Last) :=
diff --git a/gcc/ada/init.c b/gcc/ada/init.c
index 9b24395e8d4..7eee3bf19b4 100644
--- a/gcc/ada/init.c
+++ b/gcc/ada/init.c
@@ -2015,12 +2015,17 @@ __gnat_error_handler (int sig, void *si, struct sigcontext *sc)
sigprocmask (SIG_SETMASK, &mask, NULL);
#if defined (__PPC__)
- /* We process signals through a Call Frame Info trampoline, voiding
- the need for myriads of fallback_frame_state variants. */
+ /* On PowerPC, we process signals through a Call Frame Info trampoline,
+ voiding the need for myriads of fallback_frame_state variants in the
+ ZCX runtime. We have no simple way to distinguish ZCX from SJLJ here,
+ so we do this for SJLJ as well even though this is not necessary.
+ This only incurs a few extra instructions and a tiny amount of extra
+ stack usage. */
#include "sigtramp.h"
- __gnat_sigtramp (sig, si, sc, &__gnat_map_signal);
+ __gnat_sigtramp (sig, (void *)si, (void *)sc,
+ (sighandler_t *)&__gnat_map_signal);
#else
__gnat_map_signal (sig, si, sc);
diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb
index 82c7547360d..011a444cf0d 100644
--- a/gcc/ada/sem_aggr.adb
+++ b/gcc/ada/sem_aggr.adb
@@ -1675,8 +1675,12 @@ package body Sem_Aggr is
-- unless the expression covers a single component, or the
-- expander is inactive.
+ -- In Alfa mode, expressions that can perform side-effects will be
+ -- recognized by the gnat2why back-end, and the whole subprogram
+ -- will be ignored. So semantic analysis can be performed safely.
+
if Single_Elmt
- or else not Expander_Active
+ or else not Full_Expander_Active
or else In_Spec_Expression
then
Analyze_And_Resolve (Expr, Component_Typ);
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index 0895eb68652..02c9325a298 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -3364,11 +3364,19 @@ package body Sem_Ch13 is
-- No statements other than code statements, pragmas, and labels.
-- Again we allow certain internally generated statements.
+ -- In Ada 2012, qualified expressions are names, and the code
+ -- statement is initially parsed as a procedure call.
Stmt := First (Statements (HSS));
while Present (Stmt) loop
StmtO := Original_Node (Stmt);
- if Comes_From_Source (StmtO)
+
+ if Ada_Version >= Ada_2012
+ and then Nkind (StmtO) = N_Procedure_Call_Statement
+ then
+ null;
+
+ elsif Comes_From_Source (StmtO)
and then not Nkind_In (StmtO, N_Pragma,
N_Label,
N_Code_Statement)
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index 5cc4cb5ad40..918763d64c2 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -16889,6 +16889,38 @@ package body Sem_Ch3 is
when N_Attribute_Reference =>
return Attribute_Name (Original_Node (Exp)) = Name_Input;
+ -- For a conditional expression, all dependent expressions must be
+ -- legal constructs.
+
+ when N_Conditional_Expression =>
+ declare
+ Then_Expr : constant Node_Id :=
+ Next
+ (First (Expressions (Original_Node (Exp))));
+ Else_Expr : constant Node_Id := Next (Then_Expr);
+
+ begin
+ return OK_For_Limited_Init_In_05 (Typ, Then_Expr)
+ and then OK_For_Limited_Init_In_05 (Typ, Else_Expr);
+ end;
+
+ when N_Case_Expression =>
+ declare
+ Alt : Node_Id;
+
+ begin
+ Alt := First (Alternatives (Original_Node (Exp)));
+ while Present (Alt) loop
+ if not OK_For_Limited_Init_In_05 (Typ, Expression (Alt)) then
+ return False;
+ end if;
+
+ Next (Alt);
+ end loop;
+
+ return True;
+ end;
+
when others =>
return False;
end case;
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index 2fc3b96670d..3c5e3f834fe 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -1340,6 +1340,15 @@ package body Sem_Ch6 is
Analyze (P);
Analyze_Call_And_Resolve;
+ -- In Ada 2012. a qualified expression is a name, but it cannot be a
+ -- procedure name, so the construct can only be a qualified expression.
+
+ elsif Nkind (P) = N_Qualified_Expression
+ and then Ada_Version >= Ada_2012
+ then
+ Rewrite (N, Make_Code_Statement (Loc, Expression => P));
+ Analyze (N);
+
-- Anything else is an error
else
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 46906943762..9a55bf8e157 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -13762,12 +13762,6 @@ package body Sem_Prag is
Error_Msg_N ("Unchecked_Union must not be tagged", Typ);
return;
- elsif Is_Limited_Type (Typ) then
- Error_Msg_N
- ("Unchecked_Union must not be limited record type", Typ);
- Explain_Limited_Type (Typ, Typ);
- return;
-
else
if not Has_Discriminants (Typ) then
Error_Msg_N
diff --git a/gcc/ada/vms_data.ads b/gcc/ada/vms_data.ads
index 1da9855245a..bfda0a73c56 100644
--- a/gcc/ada/vms_data.ads
+++ b/gcc/ada/vms_data.ads
@@ -6119,6 +6119,30 @@ package VMS_Data is
-- See 'HELP GNAT COMPILE /WIDE_CHARACTER_ENCODING' for an explanation
-- about the different character encoding methods.
+ S_Pretty_Enums : aliased constant S := "/ENUM_CASING=" &
+ "AS_DECLARED " &
+ "-neD " &
+ "LOWER_CASE " &
+ "-neL " &
+ "UPPER_CASE " &
+ "-neU " &
+ "MIXED_CASE " &
+ "-neM";
+ -- /ENUM_CASING=name-option
+ --
+ -- Specify the casing of enumeration literals. If not specified, the
+ -- casing of enumeration literals is defined by the NAME_CASING option.
+ -- 'name-option' may be one of:
+ --
+ -- AS_DECLARED Literals casing for defining occurrences are
+ -- as they appear in the source file.
+ --
+ -- LOWER_CASE Literals are in lower case.
+ --
+ -- UPPER_CASE Literals are in upper case.
+ --
+ -- MIXED_CASE Literals are in mixed case.
+
S_Pretty_Files : aliased constant S := "/FILES=@" &
"-files=@";
-- /FILES=filename
@@ -6369,6 +6393,7 @@ package VMS_Data is
S_Pretty_Eol 'Access,
S_Pretty_Ext 'Access,
S_Pretty_Encoding 'Access,
+ S_Pretty_Enums 'Access,
S_Pretty_Files 'Access,
S_Pretty_Follow 'Access,
S_Pretty_Forced 'Access,