[Sanitizers] Provide better diagnostic for sanitizers unsupported for target triple.
authorAlexey Samsonov <vonosmas@gmail.com>
Wed, 17 Jun 2015 22:07:28 +0000 (22:07 +0000)
committerAlexey Samsonov <vonosmas@gmail.com>
Wed, 17 Jun 2015 22:07:28 +0000 (22:07 +0000)
commit9170efdc0d6274b0d7438dcee929243fcca77e95
tree1ad88f95c7dbe0a1391d845f4d6d3093ec761e96
parente0d4037c6a0bcbdadf080e7a2ccd9846370d5f4c
[Sanitizers] Provide better diagnostic for sanitizers unsupported for target triple.

Summary:
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 (i.e.
set from -fsanitize=undefined-trap).

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.

Test Plan: regression test suite

Reviewers: pcc

Subscribers: cfe-commits, filcab, eugenis, thakis, kubabrecka, emaste, rsmith

Differential Revision: http://reviews.llvm.org/D10467

llvm-svn: 239953
clang/include/clang/Basic/Sanitizers.h
clang/include/clang/Driver/ToolChain.h
clang/lib/Basic/Sanitizers.cpp
clang/lib/Driver/MSVCToolChain.cpp
clang/lib/Driver/SanitizerArgs.cpp
clang/lib/Driver/ToolChains.cpp
clang/lib/Driver/ToolChains.h
clang/test/Driver/asan.c
clang/test/Driver/fsanitize.c
clang/test/Driver/rtti-options.cpp