diff options
author | Ian Lance Taylor <iant@golang.org> | 2021-09-13 10:37:49 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2021-09-13 10:37:49 -0700 |
commit | e252b51ccde010cbd2a146485d8045103cd99533 (patch) | |
tree | e060f101cdc32bf5e520de8e5275db9d4236b74c /gcc/ada/aspects.adb | |
parent | f10c7c4596dda99d2ee872c995ae4aeda65adbdf (diff) | |
parent | 104c05c5284b7822d770ee51a7d91946c7e56d50 (diff) | |
download | gcc-e252b51ccde010cbd2a146485d8045103cd99533.zip gcc-e252b51ccde010cbd2a146485d8045103cd99533.tar.gz gcc-e252b51ccde010cbd2a146485d8045103cd99533.tar.bz2 |
Merge from trunk revision 104c05c5284b7822d770ee51a7d91946c7e56d50.
Diffstat (limited to 'gcc/ada/aspects.adb')
-rw-r--r-- | gcc/ada/aspects.adb | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/gcc/ada/aspects.adb b/gcc/ada/aspects.adb index 91550c8..a6e4f28 100644 --- a/gcc/ada/aspects.adb +++ b/gcc/ada/aspects.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2010-2020, Free Software Foundation, Inc. -- +-- Copyright (C) 2010-2021, 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- -- @@ -23,10 +23,14 @@ -- -- ------------------------------------------------------------------------------ -with Atree; use Atree; -with Einfo; use Einfo; -with Nlists; use Nlists; -with Sinfo; use Sinfo; +with Atree; use Atree; +with Einfo; use Einfo; +with Einfo.Entities; use Einfo.Entities; +with Einfo.Utils; use Einfo.Utils; +with Nlists; use Nlists; +with Sinfo; use Sinfo; +with Sinfo.Nodes; use Sinfo.Nodes; +with Sinfo.Utils; use Sinfo.Utils; with GNAT.HTable; @@ -224,7 +228,7 @@ package body Aspects is while Present (Item) loop if Nkind (Item) = N_Aspect_Specification and then Get_Aspect_Id (Item) = A - and then Class_Present = Sinfo.Class_Present (Item) + and then Class_Present = Sinfo.Nodes.Class_Present (Item) then return Item; end if; @@ -237,6 +241,10 @@ package body Aspects is -- find the declaration node where the aspects reside. This is usually -- the parent or the parent of the parent. + if No (Parent (Owner)) then + return Empty; + end if; + Decl := Parent (Owner); if not Permits_Aspect_Specifications (Decl) then Decl := Parent (Decl); @@ -248,7 +256,7 @@ package body Aspects is Spec := First (Aspect_Specifications (Decl)); while Present (Spec) loop if Get_Aspect_Id (Spec) = A - and then Class_Present = Sinfo.Class_Present (Spec) + and then Class_Present = Sinfo.Nodes.Class_Present (Spec) then return Spec; end if; @@ -484,6 +492,7 @@ package body Aspects is function Permits_Aspect_Specifications (N : Node_Id) return Boolean is begin + pragma Assert (Present (N)); return Has_Aspect_Specifications_Flag (Nkind (N)); end Permits_Aspect_Specifications; |