diff options
author | Ronan Desplanques <desplanques@adacore.com> | 2024-08-21 17:22:20 +0200 |
---|---|---|
committer | Marc Poulhiès <dkm@gcc.gnu.org> | 2024-09-05 10:10:12 +0200 |
commit | 87023e0c7cd3aadb2ef60aa2592ba34d0ab8a5af (patch) | |
tree | 2820cc5fe683c377bf7ff03c44481e2e79591ae8 /gcc/ada | |
parent | 5df05de3d917754274cadb7d006b2011f93f4f7b (diff) | |
download | gcc-87023e0c7cd3aadb2ef60aa2592ba34d0ab8a5af.zip gcc-87023e0c7cd3aadb2ef60aa2592ba34d0ab8a5af.tar.gz gcc-87023e0c7cd3aadb2ef60aa2592ba34d0ab8a5af.tar.bz2 |
ada: Tweak assertions in Inline.Cannot_Inline
The purpose of this patch is to silence a GNATSAS report.
gcc/ada/
* inline.adb (Cannot_Inline): Remove assertion.
* inline.ads (Cannot_Inline): Add precondition.
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/inline.adb | 2 | ||||
-rw-r--r-- | gcc/ada/inline.ads | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb index 519e26e..5f310ab 100644 --- a/gcc/ada/inline.adb +++ b/gcc/ada/inline.adb @@ -2136,8 +2136,6 @@ package body Inline is end; end if; - pragma Assert (Msg (Msg'Last) = '?'); - -- Legacy front-end inlining model if not Back_End_Inlining then diff --git a/gcc/ada/inline.ads b/gcc/ada/inline.ads index bc90c0c..696f422 100644 --- a/gcc/ada/inline.ads +++ b/gcc/ada/inline.ads @@ -165,7 +165,10 @@ package Inline is N : Node_Id; Subp : Entity_Id; Is_Serious : Boolean := False; - Suppress_Info : Boolean := False); + Suppress_Info : Boolean := False) + with + Pre => Msg'First <= Msg'Last + and then Msg (Msg'Last) = '?'; -- This procedure is called if the node N, an instance of a call to -- subprogram Subp, cannot be inlined. Msg is the message to be issued, -- which ends with ? (it does not end with ?p?, this routine takes care of |