]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix bindings for CHERI Set_Bounds and Set_Exact_Bounds intrinsics.
authorDaniel King <dmking@adacore.com>
Thu, 27 Feb 2025 14:11:16 +0000 (14:11 +0000)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Mon, 9 Jun 2025 06:32:02 +0000 (08:32 +0200)
gcc/ada/ChangeLog:

* libgnat/i-cheri.ads
(Set_Bounds, Set_Exact_Bounds): Remove wrong intrinsic binding.
* libgnat/i-cheri.adb
(Set_Bounds, Set_Exact_Bounds): New subprogram bodies.

gcc/ada/libgnat/i-cheri.adb
gcc/ada/libgnat/i-cheri.ads

index 37e5c3d28889d210bee492fd23b83e7edaf92654..157570577168a4be94d4f45e546be8ceb9c28e47 100644 (file)
 
 package body Interfaces.CHERI is
 
+   ----------------
+   -- Set_Bounds --
+   ----------------
+
+   procedure Set_Bounds
+     (Cap    : in out Capability;
+      Length :        Bounds_Length)
+   is
+   begin
+      Cap := Capability_With_Bounds (Cap, Length);
+   end Set_Bounds;
+
+   ----------------------
+   -- Set_Exact_Bounds --
+   ----------------------
+
+   procedure Set_Exact_Bounds
+     (Cap    : in out Capability;
+      Length :        Bounds_Length)
+   is
+   begin
+      Cap := Capability_With_Exact_Bounds (Cap, Length);
+   end Set_Exact_Bounds;
+
    ----------------------------
    -- Set_Address_And_Bounds --
    ----------------------------
index ed26e55c797254d30d45f73b7cfd7e7f21b99ee0..4186b6d47a9ab41f43bee864ace75bdbbb51a532 100644 (file)
@@ -273,8 +273,7 @@ is
      (Cap    : in out Capability;
       Length :        Bounds_Length)
    with
-     Import, Convention => Intrinsic,
-     External_Name => "__builtin_cheri_bounds_set";
+     Inline;
    --  Narrow the bounds of a capability so that the lower bound is the
    --  current address and the upper bound is suitable for the Length.
    --
@@ -287,8 +286,7 @@ is
      (Cap    : in out Capability;
       Length :        Bounds_Length)
    with
-     Import, Convention => Intrinsic,
-     External_Name => "__builtin_cheri_bounds_set_exact";
+     Inline;
    --  Narrow the bounds of a capability so that the lower bound is the
    --  current address and the upper bound is suitable for the Length.
    --