aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorAbel Kocsis <abelkocsis@cc.inf.elte.hu>2019-11-08 14:00:44 +0100
committerAbel Kocsis <abelkocsis@cc.inf.elte.hu>2019-11-08 14:00:44 +0100
commit3182027282c59c51d5080d83365917fccd695854 (patch)
tree1cbb5c6ad0aba728fb9cdad7350285e75a6bea34 /clang/lib/Frontend/CompilerInvocation.cpp
parent3ffce13f8c7ecb21c5729aa358f1f9fc008bbea2 (diff)
downloadllvm-3182027282c59c51d5080d83365917fccd695854.zip
llvm-3182027282c59c51d5080d83365917fccd695854.tar.gz
llvm-3182027282c59c51d5080d83365917fccd695854.tar.bz2
Revert "Revert "[clang] Report sanitizer blacklist as a dependency in cc1""
This reverts commit 6b45e1bc11e91ea7b57a6ab1c19461a86dba33f8.
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 195a29d..17fd4ce 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -1447,7 +1447,26 @@ static void ParseDependencyOutputArgs(DependencyOutputOptions &Opts,
// Add sanitizer blacklists as extra dependencies.
// They won't be discovered by the regular preprocessor, so
// we let make / ninja to know about this implicit dependency.
- Opts.ExtraDeps = Args.getAllArgValues(OPT_fdepfile_entry);
+ if (!Args.hasArg(OPT_fno_sanitize_blacklist)) {
+ for (const auto *A : Args.filtered(OPT_fsanitize_blacklist)) {
+ StringRef Val = A->getValue();
+ if (Val.find('=') == StringRef::npos)
+ Opts.ExtraDeps.push_back(Val);
+ }
+ if (Opts.IncludeSystemHeaders) {
+ for (const auto *A : Args.filtered(OPT_fsanitize_system_blacklist)) {
+ StringRef Val = A->getValue();
+ if (Val.find('=') == StringRef::npos)
+ Opts.ExtraDeps.push_back(Val);
+ }
+ }
+ }
+
+ // Propagate the extra dependencies.
+ for (const auto *A : Args.filtered(OPT_fdepfile_entry)) {
+ Opts.ExtraDeps.push_back(A->getValue());
+ }
+
// Only the -fmodule-file=<file> form.
for (const auto *A : Args.filtered(OPT_fmodule_file)) {
StringRef Val = A->getValue();