This revision was automatically updated to reflect the committed changes.
Closed by commit rL288512: [CUDA] Forward sanitizer support to host toolchain 
(authored by jhen).

Changed prior to commit:
  https://reviews.llvm.org/D27351?vs=80082&id=80084#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D27351

Files:
  cfe/trunk/lib/Driver/ToolChains.cpp


Index: cfe/trunk/lib/Driver/ToolChains.cpp
===================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp
+++ cfe/trunk/lib/Driver/ToolChains.cpp
@@ -4974,12 +4974,16 @@
 }
 
 SanitizerMask CudaToolChain::getSupportedSanitizers() const {
-  // The CudaToolChain only supports address sanitization in the sense that it
-  // allows ASAN arguments on the command line. It must not error out on these
-  // command line arguments because the host code compilation supports them.
-  // However, it doesn't actually do any address sanitization for device code;
-  // instead, it just ignores any ASAN command line arguments it sees.
-  return SanitizerKind::Address;
+  // The CudaToolChain only supports sanitizers in the sense that it allows
+  // sanitizer arguments on the command line if they are supported by the host
+  // toolchain. The CudaToolChain will actually ignore any command line
+  // arguments for any of these "supported" sanitizers. That means that no
+  // sanitization of device code is actually supported at this time.
+  //
+  // This behavior is necessary because the host and device toolchains
+  // invocations often share the command line, so the device toolchain must
+  // tolerate flags meant only for the host toolchain.
+  return HostTC.getSupportedSanitizers();
 }
 
 /// XCore tool chain


Index: cfe/trunk/lib/Driver/ToolChains.cpp
===================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp
+++ cfe/trunk/lib/Driver/ToolChains.cpp
@@ -4974,12 +4974,16 @@
 }
 
 SanitizerMask CudaToolChain::getSupportedSanitizers() const {
-  // The CudaToolChain only supports address sanitization in the sense that it
-  // allows ASAN arguments on the command line. It must not error out on these
-  // command line arguments because the host code compilation supports them.
-  // However, it doesn't actually do any address sanitization for device code;
-  // instead, it just ignores any ASAN command line arguments it sees.
-  return SanitizerKind::Address;
+  // The CudaToolChain only supports sanitizers in the sense that it allows
+  // sanitizer arguments on the command line if they are supported by the host
+  // toolchain. The CudaToolChain will actually ignore any command line
+  // arguments for any of these "supported" sanitizers. That means that no
+  // sanitization of device code is actually supported at this time.
+  //
+  // This behavior is necessary because the host and device toolchains
+  // invocations often share the command line, so the device toolchain must
+  // tolerate flags meant only for the host toolchain.
+  return HostTC.getSupportedSanitizers();
 }
 
 /// XCore tool chain
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to