From a6ac73115af92e964988677378306f5c08dd0ddf Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Wed, 27 Apr 2016 14:42:03 +0200 Subject: [PATCH] [multiple changes] 2016-04-27 Vincent Celier * gnatcmd.adb: For "gnat ls -V -P", recognize switch --unchecked-shared-lib-imports and set the flag Opt.Unchecked_Shared_Lib_Imports accordingly. 2016-04-27 Ed Schonberg * sem_prag.adb (Analyze_Pre_Post_Condition_In_Decl_Part): A generic subprogram is never a primitive operation, and thus a classwide condition for it is not legal. 2016-04-27 Hristian Kirtchev * sem_aggr.adb, sem_dim.adb, sem_dim.ads, einfo.adb: Minor reformatting. From-SVN: r235494 --- gcc/ada/ChangeLog | 17 +++++++++++++++++ gcc/ada/einfo.adb | 8 ++------ gcc/ada/gnatcmd.adb | 10 +++++++++- gcc/ada/sem_aggr.adb | 4 ++-- gcc/ada/sem_dim.adb | 4 ++-- gcc/ada/sem_dim.ads | 16 ++++++++-------- gcc/ada/sem_prag.adb | 5 +++-- 7 files changed, 43 insertions(+), 21 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index eb0f5ae046f8..1cf844c700a9 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,20 @@ +2016-04-27 Vincent Celier + + * gnatcmd.adb: For "gnat ls -V -P", recognize switch + --unchecked-shared-lib-imports and set the flag + Opt.Unchecked_Shared_Lib_Imports accordingly. + +2016-04-27 Ed Schonberg + + * sem_prag.adb (Analyze_Pre_Post_Condition_In_Decl_Part): + A generic subprogram is never a primitive operation, and thus + a classwide condition for it is not legal. + +2016-04-27 Hristian Kirtchev + + * sem_aggr.adb, sem_dim.adb, sem_dim.ads, einfo.adb: Minor + reformatting. + 2016-04-27 Hristian Kirtchev * sem_res.adb (Flag_Effectively_Volatile_Objects): New routine. diff --git a/gcc/ada/einfo.adb b/gcc/ada/einfo.adb index 32a56a6f8f11..eade226f0428 100644 --- a/gcc/ada/einfo.adb +++ b/gcc/ada/einfo.adb @@ -3935,17 +3935,13 @@ package body Einfo is procedure Set_Corresponding_Function (Id : E; V : E) is begin - pragma Assert - (Ekind (Id) = E_Procedure - and then Rewritten_For_C (V)); + pragma Assert (Ekind (Id) = E_Procedure and then Rewritten_For_C (V)); Set_Node32 (Id, V); end Set_Corresponding_Function; procedure Set_Corresponding_Procedure (Id : E; V : E) is begin - pragma Assert - (Ekind (Id) = E_Function - and then Rewritten_For_C (Id)); + pragma Assert (Ekind (Id) = E_Function and then Rewritten_For_C (Id)); Set_Node32 (Id, V); end Set_Corresponding_Procedure; diff --git a/gcc/ada/gnatcmd.adb b/gcc/ada/gnatcmd.adb index 2432f89f8f43..433ac7d2bb0c 100644 --- a/gcc/ada/gnatcmd.adb +++ b/gcc/ada/gnatcmd.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1996-2015, Free Software Foundation, Inc. -- +-- Copyright (C) 1996-2016, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -983,6 +983,14 @@ begin Remove_Switch (Arg_Num); + -- --unchecked-shared-lib-imports + + elsif Argv.all = "--unchecked-shared-lib-imports" then + Opt.Unchecked_Shared_Lib_Imports := True; + Remove_Switch (Arg_Num); + + -- gnat list -U + elsif The_Command = List and then Argv'Length = 2 diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index 575a1d2ea3cc..876521b6d23c 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -2052,8 +2052,8 @@ package body Sem_Aggr is Set_Parent (Expr, Parent (Expression (Assoc))); Analyze (Expr); - -- Compute its dimensions now, rather than at the end - -- of resolution, because in the case of multidimensional + -- Compute its dimensions now, rather than at the end of + -- resolution, because in the case of multidimensional -- aggregates subsequent expansion may lead to spurious -- errors. diff --git a/gcc/ada/sem_dim.adb b/gcc/ada/sem_dim.adb index 754be84ab0df..4a9201570bdf 100644 --- a/gcc/ada/sem_dim.adb +++ b/gcc/ada/sem_dim.adb @@ -2277,8 +2277,8 @@ package body Sem_Dim is --------------------------------- procedure Check_Expression_Dimensions - (Expr : Node_Id; - Typ : Entity_Id) + (Expr : Node_Id; + Typ : Entity_Id) is begin if Is_Floating_Point_Type (Etype (Expr)) then diff --git a/gcc/ada/sem_dim.ads b/gcc/ada/sem_dim.ads index bce497a58508..44f4e86fced7 100644 --- a/gcc/ada/sem_dim.ads +++ b/gcc/ada/sem_dim.ads @@ -165,14 +165,14 @@ package Sem_Dim is -- literal default value in the list of formals Formals. procedure Check_Expression_Dimensions - (Expr : Node_Id; - Typ : Entity_Id); - -- Compute dimensions of a floating-point expression and compare them - -- with the dimensions of a the given type. Used to verify dimensions - -- of the components of a multidimensional array type, for which components - -- are typically themselves arrays. The resolution of such arrays delays - -- the resolution of the ultimate components to a separate phase, which - -- forces this separate dimension verification. + (Expr : Node_Id; + Typ : Entity_Id); + -- Compute dimensions of a floating-point expression and compare them with + -- the dimensions of a the given type. Used to verify dimensions of the + -- components of a multidimensional array type, for which components are + -- typically themselves arrays. The resolution of such arrays delays the + -- resolution of the ultimate components to a separate phase, which forces + -- this separate dimension verification. procedure Copy_Dimensions (From, To : Node_Id); -- Copy dimension vector of node From to node To. Note that To must be a diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 3d3683c9ba0e..14b53ee3c41b 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -23319,11 +23319,12 @@ package body Sem_Prag is if Class_Present (N) then -- Verify that a class-wide condition is legal, i.e. the operation is - -- a primitive of a tagged type. + -- a primitive of a tagged type. Note that a generic subprogram is + -- not a primitive operation. Disp_Typ := Find_Dispatching_Type (Spec_Id); - if No (Disp_Typ) then + if No (Disp_Typ) or else Is_Generic_Subprogram (Spec_Id) then Error_Msg_Name_1 := Original_Aspect_Pragma_Name (N); if From_Aspect_Specification (N) then -- 2.47.2