8#ifndef LLVM_CLANG_DRIVER_SANITIZERARGS_H
9#define LLVM_CLANG_DRIVER_SANITIZERARGS_H
13#include "llvm/Option/Arg.h"
14#include "llvm/Option/ArgList.h"
15#include "llvm/Transforms/Instrumentation/AddressSanitizerOptions.h"
30 std::vector<std::string> UserIgnorelistFiles;
31 std::vector<std::string> SystemIgnorelistFiles;
32 std::vector<std::string> CoverageAllowlistFiles;
33 std::vector<std::string> CoverageIgnorelistFiles;
34 std::vector<std::string> BinaryMetadataIgnorelistFiles;
35 int CoverageFeatures = 0;
36 int BinaryMetadataFeatures = 0;
37 int OverflowPatternExclusions = 0;
38 int MsanTrackOrigins = 0;
39 bool MsanUseAfterDtor =
true;
40 bool MsanParamRetval =
true;
41 bool CfiCrossDso =
false;
42 bool CfiICallGeneralizePointers =
false;
43 bool CfiICallNormalizeIntegers =
false;
44 bool CfiCanonicalJumpTables =
false;
45 int AsanFieldPadding = 0;
46 bool SharedRuntime =
false;
47 bool StableABI =
false;
48 bool AsanUseAfterScope =
true;
49 bool AsanPoisonCustomArrayCookie =
false;
50 bool AsanGlobalsDeadStripping =
false;
51 bool AsanUseOdrIndicator =
false;
52 bool AsanInvalidPointerCmp =
false;
53 bool AsanInvalidPointerSub =
false;
54 bool AsanOutlineInstrumentation =
false;
55 llvm::AsanDtorKind AsanDtorKind = llvm::AsanDtorKind::Invalid;
56 std::string HwasanAbi;
57 bool LinkRuntimes =
true;
58 bool LinkCXXRuntimes =
false;
60 bool SafeStackRuntime =
false;
62 bool TsanMemoryAccess =
true;
63 bool TsanFuncEntryExit =
true;
64 bool TsanAtomics =
true;
65 bool MinimalRuntime =
false;
67 bool ImplicitCfiRuntime =
false;
68 bool NeedsMemProfRt =
false;
69 bool HwasanUseAliases =
false;
70 llvm::AsanDetectStackUseAfterReturnMode AsanUseAfterReturn =
71 llvm::AsanDetectStackUseAfterReturnMode::Invalid;
73 std::string MemtagMode;
78 bool DiagnoseErrors =
true);
86 return Sanitizers.
has(SanitizerKind::HWAddress);
96 return Sanitizers.
has(SanitizerKind::Leak) &&
97 !Sanitizers.
has(SanitizerKind::Address) &&
98 !Sanitizers.
has(SanitizerKind::HWAddress);
110 return Sanitizers.
has(SanitizerKind::NumericalStability);
118 return Sanitizers.
has(SanitizerKind::MemtagHeap);
121 return Sanitizers.
has(SanitizerKind::MemtagStack);
124 return Sanitizers.
has(SanitizerKind::MemtagGlobals);
127 assert(!MemtagMode.empty());
132 return Sanitizers.
has(SanitizerKind::ShadowCallStack);
143 llvm::opt::ArgStringList &CmdArgs,
types::ID InputType)
const;
Defines the clang::SanitizerKind enum.
bool needsFuzzerInterceptors() const
bool needsHwasanAliasesRt() const
bool needsStatsRt() const
bool needsMemProfRt() const
bool needsCfiDiagRt() const
bool linkRuntimes() const
bool needsUbsanRt() const
bool needsHwasanRt() const
bool hasCrossDsoCfi() const
bool hasMemtagHeap() const
bool hasAnySanitizer() const
bool needsSafeStackRt() const
bool needsRtsanRt() const
bool requiresMinimalRuntime() const
bool needsUnwindTables() const
bool hasMemtagStack() const
bool needsDfsanRt() const
bool needsScudoRt() const
bool hasMemtagGlobals() const
bool hasShadowCallStack() const
const std::string & getMemtagMode() const
void addArgs(const ToolChain &TC, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, types::ID InputType) const
bool needsSharedRt() const
bool needsTysanRt() const
bool linkCXXRuntimes() const
bool needsStableAbi() const
The JSON file list parser is used to communicate input to InstallAPI.
bool empty() const
Returns true if no sanitizers are enabled.
bool has(SanitizerMask K) const
Check if a certain (single) sanitizer is enabled.