[libc-commits] [libc] f88f090 - [libc] Correct 'memrchr' definition and re-enable on GPU (#67850)

via libc-commits libc-commits at lists.llvm.org
Fri Sep 29 16:22:06 PDT 2023


Author: Joseph Huber
Date: 2023-09-29T18:22:00-05:00
New Revision: f88f090a2ef1eae500db9c398059a0eb4907ab4e

URL: https://github.com/llvm/llvm-project/commit/f88f090a2ef1eae500db9c398059a0eb4907ab4e
DIFF: https://github.com/llvm/llvm-project/commit/f88f090a2ef1eae500db9c398059a0eb4907ab4e.diff

LOG: [libc] Correct 'memrchr' definition and re-enable on GPU (#67850)

Summary:
This was disabled on the GPU because it conflicted with the definition
in `glibc`. According to information online and in the `glibc`
implementation, the first argument should be a `const void *`. Fixing
this resolves the problem when exporting this to offloading languages.

Added: 
    

Modified: 
    libc/spec/gnu_ext.td

Removed: 
    


################################################################################
diff  --git a/libc/spec/gnu_ext.td b/libc/spec/gnu_ext.td
index 362add7283d6e11..dfb12419d14005b 100644
--- a/libc/spec/gnu_ext.td
+++ b/libc/spec/gnu_ext.td
@@ -69,7 +69,7 @@ def GnuExtensions : StandardSpec<"GNUExtensions"> {
         FunctionSpec<
             "memrchr",
             RetValSpec<VoidPtr>,
-            [ArgSpec<VoidPtr>, ArgSpec<IntType>, ArgSpec<SizeTType>]
+            [ArgSpec<ConstVoidPtr>, ArgSpec<IntType>, ArgSpec<SizeTType>]
         >,
         FunctionSpec<
             "strerror_r",


        


More information about the libc-commits mailing list