diff options
| author | Devin Coughlin <dcoughlin@apple.com> | 2016-03-20 18:24:33 +0000 |
|---|---|---|
| committer | Devin Coughlin <dcoughlin@apple.com> | 2016-03-20 18:24:33 +0000 |
| commit | fcfa38cf764269cd2853a8f670eff3b1335a6b16 (patch) | |
| tree | c2594ce8ca6d2e246259788ff794547412b63a38 /clang/lib/Driver/ToolChains.cpp | |
| parent | 936a05452296dbbf1fb9ddbdc9c5b074021b8bcc (diff) | |
| download | bcm5719-llvm-fcfa38cf764269cd2853a8f670eff3b1335a6b16.tar.gz bcm5719-llvm-fcfa38cf764269cd2853a8f670eff3b1335a6b16.zip | |
[tsan] Allow -fsanitize=thread for iOS-style simulator targets
Update the clang driver to allow -fsanitize=thread when targeting x86_64 iOS and tvOS
simulators. Also restrict TSan targeting OS X to only be supported on x86_64 and not i386.
Differential Revision: http://reviews.llvm.org/D18280
llvm-svn: 263913
Diffstat (limited to 'clang/lib/Driver/ToolChains.cpp')
| -rw-r--r-- | clang/lib/Driver/ToolChains.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp index 263d5df2dd3..fd69ca87c28 100644 --- a/clang/lib/Driver/ToolChains.cpp +++ b/clang/lib/Driver/ToolChains.cpp @@ -1225,13 +1225,18 @@ void Darwin::CheckObjCARC() const { } SanitizerMask Darwin::getSupportedSanitizers() const { + const bool IsX86_64 = getTriple().getArch() == llvm::Triple::x86_64; SanitizerMask Res = ToolChain::getSupportedSanitizers(); Res |= SanitizerKind::Address; if (isTargetMacOS()) { if (!isMacosxVersionLT(10, 9)) Res |= SanitizerKind::Vptr; Res |= SanitizerKind::SafeStack; - Res |= SanitizerKind::Thread; + if (IsX86_64) + Res |= SanitizerKind::Thread; + } else if (isTargetIOSSimulator() || isTargetTvOSSimulator()) { + if (IsX86_64) + Res |= SanitizerKind::Thread; } return Res; } |

