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"
31 std::vector<std::string> UserIgnorelistFiles;
32 std::vector<std::string> SystemIgnorelistFiles;
33 std::vector<std::string> CoverageAllowlistFiles;
34 std::vector<std::string> CoverageIgnorelistFiles;
35 std::vector<std::string> BinaryMetadataIgnorelistFiles;
36 int CoverageFeatures = 0;
37 int BinaryMetadataFeatures = 0;
38 int OverflowPatternExclusions = 0;
39 int MsanTrackOrigins = 0;
40 bool MsanUseAfterDtor =
true;
41 bool MsanParamRetval =
true;
42 bool CfiCrossDso =
false;
43 bool CfiICallGeneralizePointers =
false;
44 bool CfiICallNormalizeIntegers =
false;
45 bool CfiCanonicalJumpTables =
false;
46 int AsanFieldPadding = 0;
47 bool SharedRuntime =
false;
48 bool StableABI =
false;
49 bool AsanUseAfterScope =
true;
50 bool AsanPoisonCustomArrayCookie =
false;
51 bool AsanGlobalsDeadStripping =
false;
52 bool AsanUseOdrIndicator =
false;
53 bool AsanInvalidPointerCmp =
false;
54 bool AsanInvalidPointerSub =
false;
55 bool AsanOutlineInstrumentation =
false;
56 llvm::AsanDtorKind AsanDtorKind = llvm::AsanDtorKind::Invalid;
57 std::string HwasanAbi;
58 bool LinkRuntimes =
true;
59 bool LinkCXXRuntimes =
false;
61 bool SafeStackRuntime =
false;
63 bool TsanMemoryAccess =
true;
64 bool TsanFuncEntryExit =
true;
65 bool TsanAtomics =
true;
66 bool MinimalRuntime =
false;
68 bool ImplicitCfiRuntime =
false;
69 bool NeedsMemProfRt =
false;
70 bool HwasanUseAliases =
false;
71 llvm::AsanDetectStackUseAfterReturnMode AsanUseAfterReturn =
72 llvm::AsanDetectStackUseAfterReturnMode::Invalid;
74 std::string MemtagMode;
79 bool DiagnoseErrors =
true);
87 return Sanitizers.
has(SanitizerKind::HWAddress);
97 return Sanitizers.
has(SanitizerKind::Leak) &&
98 !Sanitizers.
has(SanitizerKind::Address) &&
99 !Sanitizers.
has(SanitizerKind::HWAddress);
112 return Sanitizers.
has(SanitizerKind::NumericalStability);
120 return Sanitizers.
has(SanitizerKind::MemtagHeap);
123 return Sanitizers.
has(SanitizerKind::MemtagStack);
126 return Sanitizers.
has(SanitizerKind::MemtagGlobals);
129 assert(!MemtagMode.empty());
134 return Sanitizers.
has(SanitizerKind::ShadowCallStack);
145 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 needsUbsanCXXRt() 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