[llvm-branch-commits] [clang] 73daeb3 - [CUDA] Make sure <string.h> is included with original __THROW defined.

Tom Stellard via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Oct 22 00:40:23 PDT 2021


Author: Artem Belevich
Date: 2021-10-22T00:40:06-07:00
New Revision: 73daeb3d507f7c8da52a35311ec1799f161ac7a5

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

LOG: [CUDA] Make sure <string.h> is included with original __THROW defined.

Otherwise we may end up with an inconsistent redeclarations of the standard
library functions if _FORTIFY_SOURCE is in effect.

https://bugs.llvm.org/show_bug.cgi?id=47869

Differential Revision: https://reviews.llvm.org/D110781

(cherry picked from commit 29e00b29f76adb15a51c1ccd6c1fdb6fce5f4d7b)

Added: 
    

Modified: 
    clang/lib/Headers/__clang_cuda_runtime_wrapper.h

Removed: 
    


################################################################################
diff  --git a/clang/lib/Headers/__clang_cuda_runtime_wrapper.h b/clang/lib/Headers/__clang_cuda_runtime_wrapper.h
index f401964bd529c..31126292755f6 100644
--- a/clang/lib/Headers/__clang_cuda_runtime_wrapper.h
+++ b/clang/lib/Headers/__clang_cuda_runtime_wrapper.h
@@ -41,6 +41,7 @@
 #include <cmath>
 #include <cstdlib>
 #include <stdlib.h>
+#include <string.h>
 #undef __CUDACC__
 
 // Preserve common macros that will be changed below by us or by CUDA
@@ -205,11 +206,6 @@ inline __host__ double __signbitd(double x) {
 #endif
 
 #if CUDA_VERSION >= 9000
-// CUDA-9.2 needs host-side memcpy for some host functions in
-// device_functions.hpp
-#if CUDA_VERSION >= 9020
-#include <string.h>
-#endif
 #include "crt/math_functions.hpp"
 #else
 #include "math_functions.hpp"


        


More information about the llvm-branch-commits mailing list