[PATCH] D55832: [clang] [Driver] Add .hasAnySanitizer() to SanitizerArgs

Michał Górny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 18 09:09:37 PST 2018


mgorny created this revision.
mgorny added reviewers: krytarowski, vitalybuka, samsonov, pcc.

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.


Repository:
  rC Clang

https://reviews.llvm.org/D55832

Files:
  include/clang/Driver/SanitizerArgs.h


Index: include/clang/Driver/SanitizerArgs.h
===================================================================
--- include/clang/Driver/SanitizerArgs.h
+++ include/clang/Driver/SanitizerArgs.h
@@ -82,6 +82,7 @@
   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;
 };


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55832.178699.patch
Type: text/x-patch
Size: 578 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181218/7f44ff8c/attachment.bin>


More information about the cfe-commits mailing list