[Sanitizers] Provide better diagnostic for sanitizers unsupported for target triple.
authorAlexey Samsonov <vonosmas@gmail.com>
Fri, 19 Jun 2015 21:36:47 +0000 (21:36 +0000)
committerAlexey Samsonov <vonosmas@gmail.com>
Fri, 19 Jun 2015 21:36:47 +0000 (21:36 +0000)
commit7f2a0d2c04409730c4af2e56d6d117c5a2306a4b
treeadae1567be67cf4d5a724986e7b4dd80a2aaec73
parent29792a82a9ed7733e76eb8ef30fa27fa6f606c45
[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
clang/include/clang/Driver/ToolChain.h
clang/lib/Driver/MSVCToolChain.cpp
clang/lib/Driver/SanitizerArgs.cpp
clang/lib/Driver/ToolChain.cpp
clang/lib/Driver/ToolChains.cpp
clang/lib/Driver/ToolChains.h
clang/test/Driver/fsanitize.c
clang/test/Driver/rtti-options.cpp