]> granicus.if.org Git - clang/commitdiff
[Driver] Add .hasAnySanitizer() to SanitizerArgs
authorMichal Gorny <mgorny@gentoo.org>
Wed, 19 Dec 2018 17:25:55 +0000 (17:25 +0000)
committerMichal Gorny <mgorny@gentoo.org>
Wed, 19 Dec 2018 17:25:55 +0000 (17:25 +0000)
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

include/clang/Driver/SanitizerArgs.h

index 763a187d711166fecdc15f10b384017fb42ab5ba..55c5826bfb0072fe9ec6045836736601969aa6d0 100644 (file)
@@ -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;
 };