From 1193f2cbc021f040eef6f97ec72dad5fb1efb7b1 Mon Sep 17 00:00:00 2001 From: Ivan Krasin Date: Thu, 13 Aug 2015 04:04:37 +0000 Subject: Add sanitizer blacklists to the rules generated with -M/-MM/-MD/-MMD. Summary: Clang sanitizers, such as AddressSanitizer, ThreadSanitizer, MemorySanitizer, Control Flow Integrity and others, use blacklists to specify which types / functions should not be instrumented to avoid false positives or suppress known failures. This change adds the blacklist filenames to the list of dependencies of the rules, generated with -M/-MM/-MD/-MMD. This lets CMake/Ninja recognize that certain C/C++/ObjC files need to be recompiled (if a blacklist is updated). Reviewers: pcc Subscribers: rsmith, honggyu.kim, pcc, cfe-commits Differential Revision: http://reviews.llvm.org/D11968 llvm-svn: 244867 --- clang/lib/Frontend/CompilerInvocation.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 8934c80..ae1ccd7 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -705,6 +705,10 @@ static void ParseDependencyOutputArgs(DependencyOutputOptions &Opts, Args.getLastArgValue(OPT_module_dependency_dir); if (Args.hasArg(OPT_MV)) Opts.OutputFormat = DependencyOutputFormat::NMake; + // 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_fsanitize_blacklist); } bool clang::ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args, -- cgit v1.1