diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2016-06-16 11:44:04 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2016-06-16 11:44:04 +0200 |
commit | fb757f7da43d13603d3d8b821f62076336e412a9 (patch) | |
tree | 053397ad0da456b40522b26baa0eeb0cfbf88e9e /gcc/ada/restrict.adb | |
parent | 17d7bdd87dcafe86ec678cb22604e4aada008948 (diff) | |
download | gcc-fb757f7da43d13603d3d8b821f62076336e412a9.zip gcc-fb757f7da43d13603d3d8b821f62076336e412a9.tar.gz gcc-fb757f7da43d13603d3d8b821f62076336e412a9.tar.bz2 |
[multiple changes]
2016-06-16 Hristian Kirtchev <kirtchev@adacore.com>
* exp_attr.adb, inline.adb, sem_attr.adb, sem_elab.adb: Minor
reformatting.
2016-06-16 Bob Duff <duff@adacore.com>
* sem_util.adb (Collect): Avoid Empty Full_T. Otherwise Etype
(Full_T) crashes when assertions are on.
* sem_ch12.adb (Matching_Actual): Correctly handle the case where
"others => <>" appears in a generic formal package, other than
by itself.
2016-06-16 Arnaud Charlet <charlet@adacore.com>
* usage.adb: Remove confusing comment in usage line.
* bindgen.adb: Fix binder generated file in codepeer mode wrt
recent additions.
2016-06-16 Javier Miranda <miranda@adacore.com>
* restrict.adb (Check_Restriction_No_Use_Of_Entity): Avoid
never-ending loop, code cleanup; adding also support for Text_IO.
* sem_ch8.adb (Find_Expanded_Name): Invoke
Check_Restriction_No_Use_Entity.
2016-06-16 Tristan Gingold <gingold@adacore.com>
* exp_ch9.adb: Minor comment fix.
* einfo.ads (Has_Protected): Clarify comment.
* sem_ch9.adb (Analyze_Protected_Type_Declaration): Do not
consider private protected types declared in the runtime for
the No_Local_Protected_Types restriction.
From-SVN: r237507
Diffstat (limited to 'gcc/ada/restrict.adb')
-rw-r--r-- | gcc/ada/restrict.adb | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/gcc/ada/restrict.adb b/gcc/ada/restrict.adb index f49f9d8..6cc308f 100644 --- a/gcc/ada/restrict.adb +++ b/gcc/ada/restrict.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2015, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-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- -- @@ -759,9 +759,16 @@ package body Restrict is Ent := Entity (N); Expr := NE_Ent.Entity; loop - -- Here if at outer level of entity name in reference - - if Scope (Ent) = Standard_Standard then + -- Here if at outer level of entity name in reference (handle + -- also the direct use of Text_IO in the pragma). For example: + -- pragma Restrictions (No_Use_Of_Entity => Text_IO.Put); + + if Scope (Ent) = Standard_Standard + or else (Nkind (Expr) = N_Identifier + and then Chars (Ent) = Name_Text_IO + and then Chars (Scope (Ent)) = Name_Ada + and then Scope (Scope (Ent)) = Standard_Standard) + then if Nkind_In (Expr, N_Identifier, N_Operator_Symbol) and then Chars (Ent) = Chars (Expr) then @@ -774,22 +781,19 @@ package body Restrict is return; else - goto Continue; + exit; end if; -- Here if at outer level of entity name in table elsif Nkind_In (Expr, N_Identifier, N_Operator_Symbol) then - goto Continue; + exit; -- Here if neither at the outer level else pragma Assert (Nkind (Expr) = N_Selected_Component); - - if Chars (Selector_Name (Expr)) /= Chars (Ent) then - goto Continue; - end if; + exit when Chars (Selector_Name (Expr)) /= Chars (Ent); end if; -- Move up a level @@ -800,10 +804,6 @@ package body Restrict is end loop; Expr := Prefix (Expr); - - -- Entry did not match - - <<Continue>> null; end loop; end; end loop; |