summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/ToolChains.cpp
diff options
context:
space:
mode:
authorJason Henline <jhen@google.com>2016-12-02 17:32:18 +0000
committerJason Henline <jhen@google.com>2016-12-02 17:32:18 +0000
commit531f5221bab424e2ccd46a6bd9b9cf19b4e08502 (patch)
tree8b06fd8dfc637c8de5e9e1e3c93211ccb082ada8 /clang/lib/Driver/ToolChains.cpp
parent83ec681a5cc112c3ad933f944281c00a6303f646 (diff)
downloadbcm5719-llvm-531f5221bab424e2ccd46a6bd9b9cf19b4e08502.tar.gz
bcm5719-llvm-531f5221bab424e2ccd46a6bd9b9cf19b4e08502.zip
[CUDA] Forward sanitizer support to host toolchain
Summary: This is an improvement on rL288448 where address sanitization was listed as supported for the CudaToolChain. Since the intent is for the CudaToolChain not to reject any flags supported by the host compiler, this patch switches to forwarding the CudaToolChain sanitizer support to the host toolchain rather than explicitly whitelisting address sanitization. Thanks to hfinkel for this suggestion. Reviewers: jlebar Subscribers: hfinkel, cfe-commits Differential Revision: https://reviews.llvm.org/D27351 llvm-svn: 288512
Diffstat (limited to 'clang/lib/Driver/ToolChains.cpp')
-rw-r--r--clang/lib/Driver/ToolChains.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp
index d03e0cbd8ae..be7fb7f59ef 100644
--- a/clang/lib/Driver/ToolChains.cpp
+++ b/clang/lib/Driver/ToolChains.cpp
@@ -4974,12 +4974,16 @@ void CudaToolChain::AddIAMCUIncludeArgs(const ArgList &Args,
}
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
OpenPOWER on IntegriCloud