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"
29 std::vector<std::string> UserIgnorelistFiles;
30 std::vector<std::string> SystemIgnorelistFiles;
31 std::vector<std::string> CoverageAllowlistFiles;
32 std::vector<std::string> CoverageIgnorelistFiles;
33 std::vector<std::string> BinaryMetadataIgnorelistFiles;
34 int CoverageFeatures = 0;
35 int BinaryMetadataFeatures = 0;
36 int OverflowPatternExclusions = 0;
37 int MsanTrackOrigins = 0;
38 bool MsanUseAfterDtor =
true;
39 bool MsanParamRetval =
true;
40 bool CfiCrossDso =
false;
41 bool CfiICallGeneralizePointers =
false;
42 bool CfiICallNormalizeIntegers =
false;
43 bool CfiCanonicalJumpTables =
false;
44 int AsanFieldPadding = 0;
45 bool SharedRuntime =
false;
46 bool StableABI =
false;
47 bool AsanUseAfterScope =
true;
48 bool AsanPoisonCustomArrayCookie =
false;
49 bool AsanGlobalsDeadStripping =
false;
50 bool AsanUseOdrIndicator =
false;
51 bool AsanInvalidPointerCmp =
false;
52 bool AsanInvalidPointerSub =
false;
53 bool AsanOutlineInstrumentation =
false;
54 llvm::AsanDtorKind AsanDtorKind = llvm::AsanDtorKind::Invalid;
55 std::string HwasanAbi;
56 bool LinkRuntimes =
true;
57 bool LinkCXXRuntimes =
false;
59 bool SafeStackRuntime =
false;
61 bool TsanMemoryAccess =
true;
62 bool TsanFuncEntryExit =
true;
63 bool TsanAtomics =
true;
64 bool MinimalRuntime =
false;
66 bool ImplicitCfiRuntime =
false;
67 bool NeedsMemProfRt =
false;
68 bool HwasanUseAliases =
false;
69 llvm::AsanDetectStackUseAfterReturnMode AsanUseAfterReturn =
70 llvm::AsanDetectStackUseAfterReturnMode::Invalid;
72 std::string MemtagMode;
77 bool DiagnoseErrors =
true);
85 return Sanitizers.
has(SanitizerKind::HWAddress);
94 return Sanitizers.
has(SanitizerKind::Leak) &&
95 !Sanitizers.
has(SanitizerKind::Address) &&
96 !Sanitizers.
has(SanitizerKind::HWAddress);
108 return Sanitizers.
has(SanitizerKind::NumericalStability);
115 return Sanitizers.
has(SanitizerKind::MemtagHeap);
118 return Sanitizers.
has(SanitizerKind::MemtagStack);
121 return Sanitizers.
has(SanitizerKind::MemtagGlobals);
124 assert(!MemtagMode.empty());
129 return Sanitizers.
has(SanitizerKind::ShadowCallStack);
140 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 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 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.