This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGb454e7aa7ceb: [libc] Remove GPU string functions incompatible with C++ (authored by jhuber6).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154850/new/ https://reviews.llvm.org/D154850 Files: clang/lib/Headers/llvm_libc_wrappers/string.h libc/config/gpu/entrypoints.txt libc/docs/gpu/support.rst Index: libc/docs/gpu/support.rst =================================================================== --- libc/docs/gpu/support.rst +++ libc/docs/gpu/support.rst @@ -47,7 +47,7 @@ bcmp |check| bzero |check| memccpy |check| -memchr |check| +memchr memcmp |check| memcpy |check| memmove |check| @@ -57,7 +57,7 @@ stpcpy |check| stpncpy |check| strcat |check| -strchr |check| +strchr strcmp |check| strcpy |check| strcspn |check| @@ -68,10 +68,10 @@ strncmp |check| strncpy |check| strnlen |check| -strpbrk |check| -strrchr |check| +strpbrk +strrchr strspn |check| -strstr |check| +strstr strtok |check| strtok_r |check| strdup Index: libc/config/gpu/entrypoints.txt =================================================================== --- libc/config/gpu/entrypoints.txt +++ libc/config/gpu/entrypoints.txt @@ -21,7 +21,6 @@ libc.src.string.bcmp libc.src.string.bzero libc.src.string.memccpy - libc.src.string.memchr libc.src.string.memcmp libc.src.string.memcpy libc.src.string.memmem @@ -32,10 +31,7 @@ libc.src.string.stpcpy libc.src.string.stpncpy libc.src.string.strcasecmp - libc.src.string.strcasestr libc.src.string.strcat - libc.src.string.strchr - libc.src.string.strchrnul libc.src.string.strcmp libc.src.string.strcpy libc.src.string.strcspn @@ -47,10 +43,7 @@ libc.src.string.strncmp libc.src.string.strncpy libc.src.string.strnlen - libc.src.string.strpbrk - libc.src.string.strrchr libc.src.string.strspn - libc.src.string.strstr libc.src.string.strtok libc.src.string.strtok_r Index: clang/lib/Headers/llvm_libc_wrappers/string.h =================================================================== --- clang/lib/Headers/llvm_libc_wrappers/string.h +++ clang/lib/Headers/llvm_libc_wrappers/string.h @@ -13,22 +13,11 @@ #error "This file is for GPU offloading compilation only" #endif -// The GNU headers provide non C-standard headers when in C++ mode. Manually -// undefine it here so that the definitions agree with the C standard for our -// purposes. -#ifdef __cplusplus -extern "C" { -#pragma push_macro("__cplusplus") -#undef __cplusplus -#endif - +// FIXME: The GNU headers provide C++ standard compliant headers when in C++ +// mode and the LLVM libc does not. We cannot enable memchr, strchr, strchrnul, +// strpbrk, strrchr, strstr, or strcasestr until this is addressed. #include_next <string.h> -#pragma pop_macro("__cplusplus") -#ifdef __cplusplus -} -#endif - #if __has_include(<llvm-libc-decls/string.h>) #if defined(__HIP__) || defined(__CUDA__)
Index: libc/docs/gpu/support.rst =================================================================== --- libc/docs/gpu/support.rst +++ libc/docs/gpu/support.rst @@ -47,7 +47,7 @@ bcmp |check| bzero |check| memccpy |check| -memchr |check| +memchr memcmp |check| memcpy |check| memmove |check| @@ -57,7 +57,7 @@ stpcpy |check| stpncpy |check| strcat |check| -strchr |check| +strchr strcmp |check| strcpy |check| strcspn |check| @@ -68,10 +68,10 @@ strncmp |check| strncpy |check| strnlen |check| -strpbrk |check| -strrchr |check| +strpbrk +strrchr strspn |check| -strstr |check| +strstr strtok |check| strtok_r |check| strdup Index: libc/config/gpu/entrypoints.txt =================================================================== --- libc/config/gpu/entrypoints.txt +++ libc/config/gpu/entrypoints.txt @@ -21,7 +21,6 @@ libc.src.string.bcmp libc.src.string.bzero libc.src.string.memccpy - libc.src.string.memchr libc.src.string.memcmp libc.src.string.memcpy libc.src.string.memmem @@ -32,10 +31,7 @@ libc.src.string.stpcpy libc.src.string.stpncpy libc.src.string.strcasecmp - libc.src.string.strcasestr libc.src.string.strcat - libc.src.string.strchr - libc.src.string.strchrnul libc.src.string.strcmp libc.src.string.strcpy libc.src.string.strcspn @@ -47,10 +43,7 @@ libc.src.string.strncmp libc.src.string.strncpy libc.src.string.strnlen - libc.src.string.strpbrk - libc.src.string.strrchr libc.src.string.strspn - libc.src.string.strstr libc.src.string.strtok libc.src.string.strtok_r Index: clang/lib/Headers/llvm_libc_wrappers/string.h =================================================================== --- clang/lib/Headers/llvm_libc_wrappers/string.h +++ clang/lib/Headers/llvm_libc_wrappers/string.h @@ -13,22 +13,11 @@ #error "This file is for GPU offloading compilation only" #endif -// The GNU headers provide non C-standard headers when in C++ mode. Manually -// undefine it here so that the definitions agree with the C standard for our -// purposes. -#ifdef __cplusplus -extern "C" { -#pragma push_macro("__cplusplus") -#undef __cplusplus -#endif - +// FIXME: The GNU headers provide C++ standard compliant headers when in C++ +// mode and the LLVM libc does not. We cannot enable memchr, strchr, strchrnul, +// strpbrk, strrchr, strstr, or strcasestr until this is addressed. #include_next <string.h> -#pragma pop_macro("__cplusplus") -#ifdef __cplusplus -} -#endif - #if __has_include(<llvm-libc-decls/string.h>) #if defined(__HIP__) || defined(__CUDA__)
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits