From 1bf773bb9fb7ab8169e9c185a903f3c618b6bf75 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Thu, 4 Aug 2011 15:38:05 +0200 Subject: [multiple changes] 2011-08-04 Bob Duff * sem_type.adb (Covers): If T2 is a subtype of a class-wide type, we need to compare with Class_Wide_Type (T2), in order to get at the original class-wide type node. * sem_type.ads (Covers): Improve the comment. * einfo.ads (Class_Wide_Type): Improve the comment. * exp_intr.adb (Expand_Unc_Deallocation): Remove unnecessary setting of the type of the Deref. 2011-08-04 Yannick Moy * gnat_rm.texi: Document that Test_Case pragma can only appear on separate declarations. * sem_prag.adb (procedure Check_Identifier_Is_One_Of): new procedure to check identifier of pragma argument. (Chain_TC): check that no other test case associated to the same entity share the same name. (Check_Test_Case): disallow test case inside subprogram body (Analyze_Pragma): correct call to check identifier and not argument * sem_util.adb, sem_util.ads (Get_Name_From_Test_Case_Pragma): new function gets name from test case pragma. From-SVN: r177385 --- gcc/ada/sem_util.ads | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gcc/ada/sem_util.ads') diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads index e880601..5078b3a 100644 --- a/gcc/ada/sem_util.ads +++ b/gcc/ada/sem_util.ads @@ -485,7 +485,7 @@ package Sem_Util is -- Otherwise return Empty. Expression N should have been resolved already. function Get_Ensures_From_Test_Case_Pragma (N : Node_Id) return Node_Id; - -- Return the Ensures components of Test_Case pragma N, or Empty otherwise + -- Return the Ensures component of Test_Case pragma N, or Empty otherwise function Get_Generic_Entity (N : Node_Id) return Entity_Id; -- Returns the true generic entity in an instantiation. If the name in the @@ -518,6 +518,9 @@ package Sem_Util is -- is the innermost visible entity with the given name. See the body of -- Sem_Ch8 for further details on handling of entity visibility. + function Get_Name_From_Test_Case_Pragma (N : Node_Id) return String_Id; + -- Return the Name component of Test_Case pragma N + function Get_Pragma_Id (N : Node_Id) return Pragma_Id; pragma Inline (Get_Pragma_Id); -- Obtains the Pragma_Id from the Chars field of Pragma_Identifier (N) @@ -534,7 +537,7 @@ package Sem_Util is -- with any other kind of entity. function Get_Requires_From_Test_Case_Pragma (N : Node_Id) return Node_Id; - -- Return the Requires components of Test_Case pragma N, or Empty otherwise + -- Return the Requires component of Test_Case pragma N, or Empty otherwise function Get_Subprogram_Entity (Nod : Node_Id) return Entity_Id; -- Nod is either a procedure call statement, or a function call, or an -- cgit v1.1