From: Michal Gorny Date: Wed, 19 Dec 2018 17:25:55 +0000 (+0000) Subject: [Driver] Add .hasAnySanitizer() to SanitizerArgs X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5b01cba101848240d513c2f58854c109bc50f2d3;p=clang [Driver] Add .hasAnySanitizer() to SanitizerArgs Add a simple method to query whether any sanitizer was enabled, via SanitizerArgs. This will be used in the NetBSD driver to pass additional definitions that are required by all sanitizers. Differential Revision: https://reviews.llvm.org/D55832 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@349649 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Driver/SanitizerArgs.h b/include/clang/Driver/SanitizerArgs.h index 763a187d71..55c5826bfb 100644 --- a/include/clang/Driver/SanitizerArgs.h +++ b/include/clang/Driver/SanitizerArgs.h @@ -82,6 +82,7 @@ class SanitizerArgs { bool needsUnwindTables() const; bool linkCXXRuntimes() const { return LinkCXXRuntimes; } bool hasCrossDsoCfi() const { return CfiCrossDso; } + bool hasAnySanitizer() const { return !Sanitizers.empty(); } void addArgs(const ToolChain &TC, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, types::ID InputType) const; };