aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2020-04-11 13:04:31 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2020-06-17 04:14:10 -0400
commitc3a2dc654c8e9474dbf0de2da168cd7816eae813 (patch)
tree941cafbf4260e08c2b71200823cdebc3c81adcb7 /gcc
parent7b6a7ef8ad0e180b2f12b2a1535b31d0acc83f1c (diff)
downloadgcc-c3a2dc654c8e9474dbf0de2da168cd7816eae813.zip
gcc-c3a2dc654c8e9474dbf0de2da168cd7816eae813.tar.gz
gcc-c3a2dc654c8e9474dbf0de2da168cd7816eae813.tar.bz2
[Ada] Fix comment of Get_Iterable_Type_Primitive
2020-06-17 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * sem_util.ads, sem_util.adb (Get_Iterable_Type_Primitive): Fix comment and enforce it with an assertion in the body.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/sem_util.adb10
-rw-r--r--gcc/ada/sem_util.ads4
2 files changed, 12 insertions, 2 deletions
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 5f15107..62b526d 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -10175,6 +10175,16 @@ package body Sem_Util is
(Typ : Entity_Id;
Nam : Name_Id) return Entity_Id
is
+ pragma Assert
+ (Is_Type (Typ)
+ and then
+ Nam_In (Nam, Name_Element,
+ Name_First,
+ Name_Has_Element,
+ Name_Last,
+ Name_Next,
+ Name_Previous));
+
Funcs : constant Node_Id := Find_Value_Of_Aspect (Typ, Aspect_Iterable);
Assoc : Node_Id;
diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads
index caefa05..9f2ad5a 100644
--- a/gcc/ada/sem_util.ads
+++ b/gcc/ada/sem_util.ads
@@ -1126,8 +1126,8 @@ package Sem_Util is
function Get_Iterable_Type_Primitive
(Typ : Entity_Id;
Nam : Name_Id) return Entity_Id;
- -- Retrieve one of the primitives First, Next, Has_Element, Element from
- -- the value of the Iterable aspect of a type.
+ -- Retrieve one of the primitives First, Last, Next, Previous, Has_Element,
+ -- Element from the value of the Iterable aspect of a type.
procedure Get_Library_Unit_Name_String (Decl_Node : Node_Id);
-- Retrieve the fully expanded name of the library unit declared by