diff options
author | Alexey Samsonov <vonosmas@gmail.com> | 2015-06-19 21:36:47 +0000 |
---|---|---|
committer | Alexey Samsonov <vonosmas@gmail.com> | 2015-06-19 21:36:47 +0000 |
commit | 7f2a0d2c04409730c4af2e56d6d117c5a2306a4b (patch) | |
tree | adae1567be67cf4d5a724986e7b4dd80a2aaec73 /clang/lib/Driver/MSVCToolChain.cpp | |
parent | 29792a82a9ed7733e76eb8ef30fa27fa6f606c45 (diff) | |
download | bcm5719-llvm-7f2a0d2c04409730c4af2e56d6d117c5a2306a4b.tar.gz bcm5719-llvm-7f2a0d2c04409730c4af2e56d6d117c5a2306a4b.zip |
[Sanitizers] Provide better diagnostic for sanitizers unsupported for target triple.
Introduce ToolChain::getSupportedSanitizers() that would return the set
of sanitizers available on given toolchain. By default, these are
sanitizers which don't necessarily require runtime support and are
not toolchain- or architecture-dependent.
Sanitizers (ASan, DFSan, TSan, MSan etc.) which cannot function
without runtime library are marked as supported only on platforms
for which we actually build these runtimes.
This would allow more fine-grained checks in the future: for instance,
we have to restrict availability of -fsanitize=vptr to Mac OS 10.9+
(PR23539).
Update test cases accrodingly: add tests for certain unsupported
configurations, remove test cases for -fsanitize=vptr + PS4
integration, as we don't build the runtime for PS4 at the moment.
This change was first submitted as r239953 and reverted in r239958.
The problem was and still is in Darwin toolchains, which get the
knowledge about target platform too late after initializaition, while
now we require this information when ToolChain::getSanitizerArgs() is
called. r240170 works around this issue.
llvm-svn: 240179
Diffstat (limited to 'clang/lib/Driver/MSVCToolChain.cpp')
-rw-r--r-- | clang/lib/Driver/MSVCToolChain.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Driver/MSVCToolChain.cpp b/clang/lib/Driver/MSVCToolChain.cpp index d824fe4c108..72161213db0 100644 --- a/clang/lib/Driver/MSVCToolChain.cpp +++ b/clang/lib/Driver/MSVCToolChain.cpp @@ -522,3 +522,12 @@ MSVCToolChain::ComputeEffectiveClangTriple(const ArgList &Args, } return Triple.getTriple(); } + +SanitizerMask MSVCToolChain::getSupportedSanitizers() const { + SanitizerMask Res = ToolChain::getSupportedSanitizers(); + Res |= SanitizerKind::Address; + // CFI checks are not implemented for MSVC ABI for now. + Res &= ~SanitizerKind::CFI; + Res &= ~SanitizerKind::CFICastStrict; + return Res; +} |