[Ada] Move match function for pragma Warnings to public spec

Message ID 20210504095222.GA90446@adacore.com
State New
Headers show
Series
  • [Ada] Move match function for pragma Warnings to public spec
Related show

Commit Message

Pierre-Marie de Rodat May 4, 2021, 9:52 a.m.
In order to use the same matching function in GNATprove for justifying
messages through pragma Annotate as the matching function used for
pragma Warnings, make that function publicly visible in Erroutc.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* erroutc.adb (Matches): Move spec...
	* erroutc.ads (Matches): ...here.

Patch

diff --git a/gcc/ada/erroutc.adb b/gcc/ada/erroutc.adb
--- a/gcc/ada/erroutc.adb
+++ b/gcc/ada/erroutc.adb
@@ -51,11 +51,6 @@  package body Erroutc is
    -- Local Subprograms --
    -----------------------
 
-   function Matches (S : String; P : String) return Boolean;
-   --  Returns true if the String S matches the pattern P, which can contain
-   --  wildcard chars (*). The entire pattern must match the entire string.
-   --  Case is ignored in the comparison (so X matches x).
-
    function Sloc_In_Range (Loc, Start, Stop : Source_Ptr) return Boolean;
    --  Return whether Loc is in the range Start .. Stop, taking instantiation
    --  locations of Loc into account. This is useful for suppressing warnings


diff --git a/gcc/ada/erroutc.ads b/gcc/ada/erroutc.ads
--- a/gcc/ada/erroutc.ads
+++ b/gcc/ada/erroutc.ads
@@ -496,6 +496,11 @@  package Erroutc is
    --  Given an error message ID, return tag showing warning message class, or
    --  the null string if this option is not enabled or this is not a warning.
 
+   function Matches (S : String; P : String) return Boolean;
+   --  Returns true if the String S matches the pattern P, which can contain
+   --  wildcard chars (*). The entire pattern must match the entire string.
+   --  Case is ignored in the comparison (so X matches x).
+
    procedure Output_Error_Msgs (E : in out Error_Msg_Id);
    --  Output source line, error flag, and text of stored error message and all
    --  subsequent messages for the same line and unit. On return E is set to be