diff options
author | Yannick Moy <moy@adacore.com> | 2015-02-05 13:55:03 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2015-02-05 14:55:03 +0100 |
commit | b21d8148ff0bed1e92ace175384ba4371999082d (patch) | |
tree | f860db127600c062aa47a78a8ed9c64b4abc4bac /gcc/ada/par-prag.adb | |
parent | 6d13d38e28cf50b9ad29ab2cae058e18afbc457e (diff) | |
download | gcc-b21d8148ff0bed1e92ace175384ba4371999082d.zip gcc-b21d8148ff0bed1e92ace175384ba4371999082d.tar.gz gcc-b21d8148ff0bed1e92ace175384ba4371999082d.tar.bz2 |
sem_prag.adb, [...]: Minor code clean up.
2015-02-05 Yannick Moy <moy@adacore.com>
* sem_prag.adb, par-prag.adb: Minor code clean up.
From-SVN: r220448
Diffstat (limited to 'gcc/ada/par-prag.adb')
-rw-r--r-- | gcc/ada/par-prag.adb | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/gcc/ada/par-prag.adb b/gcc/ada/par-prag.adb index 1b72a29..8456177 100644 --- a/gcc/ada/par-prag.adb +++ b/gcc/ada/par-prag.adb @@ -1047,14 +1047,21 @@ begin -- Warnings (GNAT) -- --------------------- - -- pragma Warnings ([TOOL_NAME,] On | Off [,REASON]); - -- pragma Warnings ([TOOL_NAME,] On | Off, LOCAL_NAME [,REASON]); - -- pragma Warnings ([TOOL_NAME,] static_string_EXPRESSION [,REASON]); - -- pragma Warnings ([TOOL_NAME,] On | Off, - -- static_string_EXPRESSION [,REASON]); + -- pragma Warnings ([TOOL_NAME,] DETAILS [, REASON]); + + -- DETAILS ::= On | Off + -- DETAILS ::= On | Off, local_NAME + -- DETAILS ::= static_string_EXPRESSION + -- DETAILS ::= On | Off, static_string_EXPRESSION + + -- TOOL_NAME ::= GNAT | GNATProve -- REASON ::= Reason => STRING_LITERAL {& STRING_LITERAL} + -- Note: If the first argument matches an allowed tool name, it is + -- always considered to be a tool name, even if there is a string + -- variable of that name. + -- The one argument ON/OFF case is processed by the parser, since it may -- control parser warnings as well as semantic warnings, and in any case -- we want to be absolutely sure that the range in the warnings table is @@ -1065,8 +1072,6 @@ begin -- arguments if the first one is a tool name, and/or the last one is a -- reason argument. - -- Need documentation and syntax for TOOL_NAME ??? - when Pragma_Warnings => Warnings : declare function First_Arg_Is_Matching_Tool_Name return Boolean; -- Returns True if the first argument is a tool name matching the @@ -1087,14 +1092,20 @@ begin -- First_Arg_Is_Matching_Tool_Name -- ------------------------------------- - -- Comments needed for these complex conditionals ??? - function First_Arg_Is_Matching_Tool_Name return Boolean is begin return Nkind (Arg1) = N_Identifier + + -- Return True if the tool name is GNAT, and we're not in + -- GNATprove or CodePeer or ASIS mode... + and then ((Chars (Arg1) = Name_Gnat and then not (CodePeer_Mode or GNATprove_Mode or ASIS_Mode)) + + -- or if the tool name is GNATprove, and we're in GNATprove + -- mode. + or else (Chars (Arg1) = Name_Gnatprove and then GNATprove_Mode)); |