LLVM 22.0.0git
TypeSanitizer.cpp File Reference

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "tysan"

Functions

 STATISTIC (NumInstrumentedAccesses, "Number of instrumented accesses")
static std::string encodeName (StringRef Name)
void collectMemAccessInfo (Function &F, const TargetLibraryInfo &TLI, SmallVectorImpl< std::pair< Instruction *, MemoryLocation > > &MemoryAccesses, SmallSetVector< const MDNode *, 8 > &TBAAMetadata, SmallVectorImpl< Value * > &MemTypeResetInsts)
 Collect all loads and stores, and for what TBAA nodes we need to generate type descriptors.
static ValueconvertToShadowDataInt (IRBuilder<> &IRB, Value *Ptr, Type *IntptrTy, uint64_t PtrShift, Value *ShadowBase, Value *AppMemMask)

Variables

static const char *const kTysanModuleCtorName = "tysan.module_ctor"
static const char *const kTysanInitName = "__tysan_init"
static const char *const kTysanCheckName = "__tysan_check"
static const char *const kTysanGVNamePrefix = "__tysan_v1_"
static const char *const kTysanShadowMemoryAddress
static const char *const kTysanAppMemMask = "__tysan_app_memory_mask"
static cl::opt< boolClWritesAlwaysSetType ("tysan-writes-always-set-type", cl::desc("Writes always set the type"), cl::Hidden, cl::init(false))
static const char LUT [] = "0123456789abcdef"

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "tysan"

Definition at line 45 of file TypeSanitizer.cpp.

Function Documentation

◆ collectMemAccessInfo()

◆ convertToShadowDataInt()

Value * convertToShadowDataInt ( IRBuilder<> & IRB,
Value * Ptr,
Type * IntptrTy,
uint64_t PtrShift,
Value * ShadowBase,
Value * AppMemMask )
static

◆ encodeName()

std::string encodeName ( StringRef Name)
static

Definition at line 197 of file TypeSanitizer.cpp.

References kTysanGVNamePrefix, llvm::Length, and LUT.

◆ STATISTIC()

STATISTIC ( NumInstrumentedAccesses ,
"Number of instrumented accesses"  )

References DL, F, I, and Ptr.

Variable Documentation

◆ ClWritesAlwaysSetType

cl::opt< bool > ClWritesAlwaysSetType("tysan-writes-always-set-type", cl::desc("Writes always set the type"), cl::Hidden, cl::init(false)) ( "tysan-writes-always-set-type" ,
cl::desc("Writes always set the type") ,
cl::Hidden ,
cl::init(false)  )
static

◆ kTysanAppMemMask

const char* const kTysanAppMemMask = "__tysan_app_memory_mask"
static

Definition at line 54 of file TypeSanitizer.cpp.

◆ kTysanCheckName

const char* const kTysanCheckName = "__tysan_check"
static

Definition at line 49 of file TypeSanitizer.cpp.

◆ kTysanGVNamePrefix

const char* const kTysanGVNamePrefix = "__tysan_v1_"
static

Definition at line 50 of file TypeSanitizer.cpp.

Referenced by encodeName().

◆ kTysanInitName

const char* const kTysanInitName = "__tysan_init"
static

Definition at line 48 of file TypeSanitizer.cpp.

Referenced by llvm::TypeSanitizerPass::run().

◆ kTysanModuleCtorName

const char* const kTysanModuleCtorName = "tysan.module_ctor"
static

Definition at line 47 of file TypeSanitizer.cpp.

Referenced by llvm::TypeSanitizerPass::run().

◆ kTysanShadowMemoryAddress

const char* const kTysanShadowMemoryAddress
static
Initial value:
=
"__tysan_shadow_memory_address"

Definition at line 52 of file TypeSanitizer.cpp.

◆ LUT