Lines Matching refs:ASan
64 #define DEBUG_TYPE "asan"
85 static const char *const kAsanModuleCtorName = "asan.module_ctor";
86 static const char *const kAsanModuleDtorName = "asan.module_dtor";
123 "asan-kernel", cl::desc("Enable KernelAddressSanitizer instrumentation"),
126 "asan-recover",
130 // This flag may need to be replaced with -f[no-]asan-reads.
131 static cl::opt<bool> ClInstrumentReads("asan-instrument-reads",
135 "asan-instrument-writes", cl::desc("instrument write instructions"),
138 "asan-instrument-atomics",
142 "asan-always-slow-path",
150 "asan-max-ins-per-bb", cl::init(10000),
153 // This flag may need to be replaced with -f[no]asan-stack.
154 static cl::opt<bool> ClStack("asan-stack", cl::desc("Handle stack memory"),
156 static cl::opt<bool> ClUseAfterReturn("asan-use-after-return",
159 // This flag may need to be replaced with -f[no]asan-globals.
160 static cl::opt<bool> ClGlobals("asan-globals",
163 static cl::opt<bool> ClInitializers("asan-initialization-order",
167 "asan-detect-invalid-pointer-pair",
171 "asan-realign-stack",
175 "asan-instrumentation-with-call-threshold",
182 "asan-memory-access-callback-prefix",
185 static cl::opt<bool> ClInstrumentAllocas("asan-instrument-allocas",
189 "asan-skip-promotable-allocas",
196 static cl::opt<int> ClMappingScale("asan-mapping-scale",
197 cl::desc("scale of asan shadow mapping"),
202 static cl::opt<bool> ClOpt("asan-opt", cl::desc("Optimize instrumentation"),
205 "asan-opt-same-temp", cl::desc("Instrument the same temp just once"),
207 static cl::opt<bool> ClOptGlobals("asan-opt-globals",
211 "asan-opt-stack", cl::desc("Don't instrument scalar stack variables"),
215 "asan-check-lifetime",
220 "asan-stack-dynamic-alloca",
225 "asan-force-experiment",
230 static cl::opt<int> ClDebug("asan-debug", cl::desc("debug"), cl::Hidden,
232 static cl::opt<int> ClDebugStack("asan-debug-stack", cl::desc("debug stack"),
234 static cl::opt<std::string> ClDebugFunc("asan-debug-func", cl::Hidden,
236 static cl::opt<int> ClDebugMin("asan-debug-min", cl::desc("Debug min inst"),
238 static cl::opt<int> ClDebugMax("asan-debug-max", cl::desc("Debug man inst"),
291 NamedMDNode *Globals = M.getNamedMetadata("llvm.asan.globals");
548 // This causes asan to report a non-existing bug on 453.povray.
552 AddressSanitizer &ASan;
591 FunctionStackPoisoner(Function &F, AddressSanitizer &ASan)
593 ASan(ASan),
595 C(ASan.C),
596 IntptrTy(ASan.IntptrTy),
598 Mapping(ASan.Mapping),
600 EmptyInlineAsm(CallInst::Create(ASan.EmptyAsm)) {}
677 if (!ASan.isInterestingAlloca(AI)) {
683 if (ASan.isDynamicAlloca(AI))
698 // Found lifetime intrinsic, add ASan instrumentation if necessary.
730 if (!ASan.getDominatorTree().dominates(I, Ret)) return false;
753 AddressSanitizer, "asan",
759 AddressSanitizer, "asan",
770 AddressSanitizerModule, "asan-module",
1179 // Don't instrument CTORs that will run before asan.module_ctor.
1196 // without ASan.
1582 DEBUG(dbgs() << "ASAN instrumenting:\n" << F << "\n");
1688 DEBUG(dbgs() << "ASAN done instrumenting: " << res << " " << F << "\n");
1737 for (size_t LargeStoreSizeInBytes = ASan.LongSize / 8;
1873 ASan.getAllocaSizeInBytes(AI),
1879 size_t MinHeaderSize = ASan.LongSize / 2;
1884 bool DoStackMalloc = ClUseAfterReturn && !ASan.CompileKernel &&
1962 ConstantInt::get(IntptrTy, ASan.LongSize / 8)),
1972 ConstantInt::get(IntptrTy, 2 * ASan.LongSize / 8)),
1977 Value *ShadowBase = ASan.memToShadow(LocalStackBase, IRB);
2010 ConstantInt::get(IntptrTy, ClassSize - ASan.LongSize / 8));
2040 // For now just insert the call to ASan runtime.
2060 return ASan.isInterestingAlloca(*AI) ? AI : nullptr;