summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/SanitizerArgs.cpp
diff options
context:
space:
mode:
authorJustin Lebar <jlebar@google.com>2016-09-15 23:44:13 +0000
committerJustin Lebar <jlebar@google.com>2016-09-15 23:44:13 +0000
commit6efbc73c2550f6b1d4b45bfdc9e4c153b5f6d30f (patch)
treeb14d2f7f9378dcc724ff7759f4fba23b68e4229e /clang/lib/Driver/SanitizerArgs.cpp
parent4dd6b50f6e7ffdff2f10e34c029e84d2c5666e20 (diff)
downloadbcm5719-llvm-6efbc73c2550f6b1d4b45bfdc9e4c153b5f6d30f.tar.gz
bcm5719-llvm-6efbc73c2550f6b1d4b45bfdc9e4c153b5f6d30f.zip
[CUDA] Don't try to run sanitizers on NVPTX.
Summary: Sanitizers aren't supported on NVPTX -- don't try to run them. This lets you e.g. pass -fsanitize=address and get asan on your host code. Reviewers: kcc Subscribers: cfe-commits, tra, jhen Differential Revision: https://reviews.llvm.org/D24640 llvm-svn: 281680
Diffstat (limited to 'clang/lib/Driver/SanitizerArgs.cpp')
-rw-r--r--clang/lib/Driver/SanitizerArgs.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Driver/SanitizerArgs.cpp b/clang/lib/Driver/SanitizerArgs.cpp
index 8ba8e53e007..7f1f6715fdd 100644
--- a/clang/lib/Driver/SanitizerArgs.cpp
+++ b/clang/lib/Driver/SanitizerArgs.cpp
@@ -608,6 +608,12 @@ static void addIncludeLinkerOption(const ToolChain &TC,
void SanitizerArgs::addArgs(const ToolChain &TC, const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs,
types::ID InputType) const {
+ // NVPTX doesn't currently support sanitizers. Bailing out here means that
+ // e.g. -fsanitize=address applies only to host code, which is what we want
+ // for now.
+ if (TC.getTriple().isNVPTX())
+ return;
+
// Translate available CoverageFeatures to corresponding clang-cc1 flags.
// Do it even if Sanitizers.empty() since some forms of coverage don't require
// sanitizers.
OpenPOWER on IntegriCloud