diff options
Diffstat (limited to 'llvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h')
-rw-r--r-- | llvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h b/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h index 53ad0cbf9968..3781253d2694 100644 --- a/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h +++ b/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h @@ -11,12 +11,13 @@ // AddressSanitizer pass to use the new PassManager infrastructure. // //===----------------------------------------------------------------------===// -#ifndef LLVM_TRANSFORMS_INSTRUMENTATION_ADDRESSSANITIZERPASS_H -#define LLVM_TRANSFORMS_INSTRUMENTATION_ADDRESSSANITIZERPASS_H +#ifndef LLVM_TRANSFORMS_INSTRUMENTATION_ADDRESSSANITIZER_H +#define LLVM_TRANSFORMS_INSTRUMENTATION_ADDRESSSANITIZER_H #include "llvm/IR/Function.h" #include "llvm/IR/Module.h" #include "llvm/IR/PassManager.h" +#include "llvm/Transforms/Instrumentation/AddressSanitizerOptions.h" namespace llvm { @@ -98,9 +99,11 @@ private: /// surrounding requested memory to be checked for invalid accesses. class AddressSanitizerPass : public PassInfoMixin<AddressSanitizerPass> { public: - explicit AddressSanitizerPass(bool CompileKernel = false, - bool Recover = false, - bool UseAfterScope = false); + explicit AddressSanitizerPass( + bool CompileKernel = false, bool Recover = false, + bool UseAfterScope = false, + AsanDetectStackUseAfterReturnMode UseAfterReturn = + AsanDetectStackUseAfterReturnMode::Runtime); PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); static bool isRequired() { return true; } @@ -108,6 +111,7 @@ private: bool CompileKernel; bool Recover; bool UseAfterScope; + AsanDetectStackUseAfterReturnMode UseAfterReturn; }; /// Public interface to the address sanitizer module pass for instrumenting code @@ -118,10 +122,10 @@ private: class ModuleAddressSanitizerPass : public PassInfoMixin<ModuleAddressSanitizerPass> { public: - explicit ModuleAddressSanitizerPass(bool CompileKernel = false, - bool Recover = false, - bool UseGlobalGC = true, - bool UseOdrIndicator = false); + explicit ModuleAddressSanitizerPass( + bool CompileKernel = false, bool Recover = false, bool UseGlobalGC = true, + bool UseOdrIndicator = false, + AsanDtorKind DestructorKind = AsanDtorKind::Global); PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); static bool isRequired() { return true; } @@ -130,15 +134,19 @@ private: bool Recover; bool UseGlobalGC; bool UseOdrIndicator; + AsanDtorKind DestructorKind; }; // Insert AddressSanitizer (address sanity checking) instrumentation -FunctionPass *createAddressSanitizerFunctionPass(bool CompileKernel = false, - bool Recover = false, - bool UseAfterScope = false); +FunctionPass *createAddressSanitizerFunctionPass( + bool CompileKernel = false, bool Recover = false, + bool UseAfterScope = false, + AsanDetectStackUseAfterReturnMode UseAfterReturn = + AsanDetectStackUseAfterReturnMode::Runtime); ModulePass *createModuleAddressSanitizerLegacyPassPass( bool CompileKernel = false, bool Recover = false, bool UseGlobalsGC = true, - bool UseOdrIndicator = true); + bool UseOdrIndicator = true, + AsanDtorKind DestructorKind = AsanDtorKind::Global); } // namespace llvm |