aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/Tools.cpp
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2012-11-29 22:36:21 +0000
committerAlexey Samsonov <samsonov@google.com>2012-11-29 22:36:21 +0000
commit4d1a6e41e1eaeaf5a4672c802519f15c8fb91e91 (patch)
tree7c55765b4b0f845e8b0c51db5eb510dc6fce42ef /lib/Driver/Tools.cpp
parent2ec5f551cc455df30183e796a91498c5325b17f2 (diff)
This patch exposes to Clang users three more sanitizers are experimental features of ASan:
1) init-order sanitizer: initialization-order checker. Status: usable, but may produce false positives w/o proper blacklisting. 2) use-after-return sanitizer Status: implemented, but heavily understed. Should be optional, as it significanlty slows program down. 3) use-after-scope sanitizer Status: in progress. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168950 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r--lib/Driver/Tools.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index f9cb5eff53..f2c1a03caf 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -1474,6 +1474,13 @@ SanitizerArgs::SanitizerArgs(const Driver &D, const ArgList &Args) {
D.Diag(diag::err_drv_argument_not_allowed_with)
<< lastArgumentForKind(D, Args, NeedsAsan ? NeedsAsanRt : NeedsTsanRt)
<< lastArgumentForKind(D, Args, NeedsUbsan ? NeedsUbsanRt : NeedsTsanRt);
+
+ // If -fsanitize contains extra features of ASan, it should also
+ // explicitly contain -fsanitize=address.
+ if (NeedsAsan && ((Kind & Address) == 0))
+ D.Diag(diag::err_drv_argument_only_allowed_with)
+ << lastArgumentForKind(D, Args, NeedsAsanRt)
+ << "-fsanitize=address";
}
/// If AddressSanitizer is enabled, add appropriate linker flags (Linux).