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; };
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; };
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits