diff options
author | Arnaud Charlet <charlet@adacore.com> | 2021-01-06 04:41:54 -0500 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2021-05-04 05:17:33 -0400 |
commit | 7367cd5949ec066811979dbb60b51cbcc6c123b3 (patch) | |
tree | 4f92dbe4db0e64f588d2136fcfc9d0b3bc657537 /gcc/ada/libgnat | |
parent | 716e7c15aba61327712f90c11afb766e9c69dbba (diff) | |
download | gcc-7367cd5949ec066811979dbb60b51cbcc6c123b3.zip gcc-7367cd5949ec066811979dbb60b51cbcc6c123b3.tar.gz gcc-7367cd5949ec066811979dbb60b51cbcc6c123b3.tar.bz2 |
[Ada] Assert_Failure vs Assertion_Error
gcc/ada/
* libgnat/s-assert.ads (Assert_Failure): Now a renaming of
Assertion_Error.
* libgnat/a-assert.ads (Assertion_Error): Now a first class
citizen. Remove dependency on System.Assertions.
* gcc-interface/a-assert.ads, gcc-interface/a-assert.adb: New.
* gcc-interface/Make-lang.in (GNAT_ADA_OBJS, GNATBIND_OBJS): Add
a-assert.o from gcc-interface.
Diffstat (limited to 'gcc/ada/libgnat')
-rw-r--r-- | gcc/ada/libgnat/a-assert.ads | 17 | ||||
-rw-r--r-- | gcc/ada/libgnat/s-assert.ads | 4 |
2 files changed, 6 insertions, 15 deletions
diff --git a/gcc/ada/libgnat/a-assert.ads b/gcc/ada/libgnat/a-assert.ads index c31d6e8..0a590d6 100644 --- a/gcc/ada/libgnat/a-assert.ads +++ b/gcc/ada/libgnat/a-assert.ads @@ -39,23 +39,12 @@ pragma Assertion_Policy (Pre => Ignore); --- We do a with of System.Assertions to get hold of the exception (following --- the specific RM permission that lets' Assertion_Error being a renaming). --- The suppression of Warnings stops the warning about bad categorization. - -pragma Warnings (Off); -with System.Assertions; -pragma Warnings (On); +pragma Compiler_Unit_Warning; package Ada.Assertions with - SPARK_Mode + SPARK_Mode, Pure is - pragma Pure (Assertions); - - Assertion_Error : exception renames System.Assertions.Assert_Failure; - -- This is the renaming that is allowed by 11.4.2(24). Note that the - -- Exception_Name will refer to the one in System.Assertions (see - -- AARM-11.4.1(12.b)). + Assertion_Error : exception; procedure Assert (Check : Boolean) with Pre => Check; diff --git a/gcc/ada/libgnat/s-assert.ads b/gcc/ada/libgnat/s-assert.ads index 372b875..aa82549 100644 --- a/gcc/ada/libgnat/s-assert.ads +++ b/gcc/ada/libgnat/s-assert.ads @@ -38,9 +38,11 @@ pragma Compiler_Unit_Warning; +with Ada.Assertions; + package System.Assertions is - Assert_Failure : exception; + Assert_Failure : exception renames Ada.Assertions.Assertion_Error; -- Exception raised when assertion fails procedure Raise_Assert_Failure (Msg : String); |