* [Ada] Record components do not appear in the Global contract
@ 2018-11-14 11:43 Pierre-Marie de Rodat
0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2018-11-14 11:43 UTC (permalink / raw)
To: gcc-patches; +Cc: Piotr Trojanek
[-- Attachment #1: Type: text/plain, Size: 446 bytes --]
In the Global contract there can be only entire objects, which are
represented either as N_Identifier or N_Expanded_Name. The test for
record components was dead. Now removed. Semantics unaffected.
Tested on x86_64-pc-linux-gnu, committed on trunk
2018-11-14 Piotr Trojanek <trojanek@adacore.com>
gcc/ada/
* sem_util.adb (First_From_Global_List): Do not expect
N_Selected_Component in the Global contract; simplify assertion
with Nam_In.
[-- Attachment #2: patch.diff --]
[-- Type: text/x-diff, Size: 1129 bytes --]
--- gcc/ada/sem_util.adb
+++ gcc/ada/sem_util.adb
@@ -8594,8 +8594,7 @@ package body Sem_Util is
-- Single global item declaration (only input items)
elsif Nkind_In (List, N_Expanded_Name,
- N_Identifier,
- N_Selected_Component)
+ N_Identifier)
then
if Global_Mode = Name_Input then
return List;
@@ -8648,10 +8647,10 @@ package body Sem_Util is
Body_Id : Entity_Id;
begin
- pragma Assert (Global_Mode = Name_Input
- or else Global_Mode = Name_Output
- or else Global_Mode = Name_In_Out
- or else Global_Mode = Name_Proof_In);
+ pragma Assert (Nam_In (Global_Mode, Name_Input,
+ Name_Output,
+ Name_In_Out,
+ Name_Proof_In));
-- Retrieve the suitable pragma Global or Refined_Global. In the second
-- case, it can only be located on the body entity.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-11-14 11:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-14 11:43 [Ada] Record components do not appear in the Global contract Pierre-Marie de Rodat
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).