]> granicus.if.org Git - clang/commit
[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)
commitbd98816515bb7627065d380422a1376ea89b12ac
treec6d47da6842b5f288d7751951a573c0d4d8b791c
parenteb4df0a70bd96c8fe05121a693a65b951e16047c
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240179 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Driver/ToolChain.h
lib/Driver/MSVCToolChain.cpp
lib/Driver/SanitizerArgs.cpp
lib/Driver/ToolChain.cpp
lib/Driver/ToolChains.cpp
lib/Driver/ToolChains.h
test/Driver/fsanitize.c
test/Driver/rtti-options.cpp