LLVM: lib/Transforms/Instrumentation/TypeSanitizer.cpp File Reference (original) (raw)
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 Value * | convertToShadowDataInt (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< bool > | ClWritesAlwaysSetType ("tysan-writes-always-set-type", cl::desc("Writes always set the type"), cl::Hidden, cl::init(false)) |
| static cl::opt< bool > | ClOutlineInstrumentation ("tysan-outline-instrumentation", cl::desc("Uses function calls for all TySan instrumentation, reducing " "ELF size"), cl::Hidden, cl::init(true)) |
| static cl::opt< bool > | ClVerifyOutlinedInstrumentation ("tysan-verify-outlined-instrumentation", cl::desc("Check types twice with both inlined instrumentation and " "function calls. This verifies that they behave the same."), cl::Hidden, cl::init(false)) |
| static const char | LUT [] = "0123456789abcdef" |
◆ DEBUG_TYPE
#define DEBUG_TYPE "tysan"
◆ collectMemAccessInfo()
Collect all loads and stores, and for what TBAA nodes we need to generate type descriptors.
Definition at line 507 of file TypeSanitizer.cpp.
References llvm::MemoryLocation::AATags, llvm::cast(), llvm::dyn_cast(), F, llvm::MemoryLocation::get(), llvm::Type::getPointerAddressSpace(), llvm::Value::getType(), llvm::SetVector< T, Vector, Set, N >::insert(), instructions, llvm::isa(), llvm::Value::isSwiftError(), llvm::maybeMarkSanitizerLibraryCallNoBuiltin(), llvm::MemoryLocation::Ptr, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::AAMDNodes::TBAA.
◆ convertToShadowDataInt()
◆ encodeName()
◆ STATISTIC()
| STATISTIC | ( | NumInstrumentedAccesses | , |
|---|---|---|---|
| "Number of instrumented accesses" | ) |
◆ ClOutlineInstrumentation
◆ ClVerifyOutlinedInstrumentation
| cl::opt< bool > ClVerifyOutlinedInstrumentation("tysan-verify-outlined-instrumentation", cl::desc("Check types twice with both inlined instrumentation and " "function calls. This verifies that they behave the same."), cl::Hidden, cl::init(false)) ( "tysan-verify-outlined-instrumentation" , cl::desc("Check types twice with both inlined instrumentation and " "function calls. This verifies that they behave the same.") , cl::Hidden , cl::init(false) ) | static |
|---|
◆ 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
◆ kTysanCheckName
◆ kTysanGVNamePrefix
◆ kTysanInitName
◆ kTysanModuleCtorName
◆ kTysanShadowMemoryAddress
Initial value:
=
"__tysan_shadow_memory_address"
Definition at line 52 of file TypeSanitizer.cpp.