Lines Matching refs:ASan
16 #define DEBUG_TYPE "asan"
66 static const char *const kAsanModuleCtorName = "asan.module_ctor";
67 static const char *const kAsanModuleDtorName = "asan.module_dtor";
99 // This flag may need to be replaced with -f[no-]asan-reads.
100 static cl::opt<bool> ClInstrumentReads("asan-instrument-reads",
102 static cl::opt<bool> ClInstrumentWrites("asan-instrument-writes",
104 static cl::opt<bool> ClInstrumentAtomics("asan-instrument-atomics",
107 static cl::opt<bool> ClAlwaysSlowPath("asan-always-slow-path",
114 static cl::opt<int> ClMaxInsnsToInstrumentPerBB("asan-max-ins-per-bb",
118 // This flag may need to be replaced with -f[no]asan-stack.
119 static cl::opt<bool> ClStack("asan-stack",
121 // This flag may need to be replaced with -f[no]asan-use-after-return.
122 static cl::opt<bool> ClUseAfterReturn("asan-use-after-return",
124 // This flag may need to be replaced with -f[no]asan-globals.
125 static cl::opt<bool> ClGlobals("asan-globals",
127 static cl::opt<bool> ClInitializers("asan-initialization-order",
129 static cl::opt<bool> ClMemIntrin("asan-memintrin",
131 static cl::opt<bool> ClRealignStack("asan-realign-stack",
133 static cl::opt<std::string> ClBlacklistFile("asan-blacklist",
140 // clone; if the function is not changed by asan the clone is deleted.
142 // called "ASAN" and the uninstrumented function into a section called "NOASAN".
146 static cl::opt<bool> ClKeepUninstrumented("asan-keep-uninstrumented-functions",
153 static cl::opt<int> ClMappingScale("asan-mapping-scale",
154 cl::desc("scale of asan shadow mapping"), cl::Hidden, cl::init(0));
155 static cl::opt<int> ClMappingOffsetLog("asan-mapping-offset-log",
156 cl::desc("offset of asan shadow mapping"), cl::Hidden, cl::init(-1));
157 static cl::opt<bool> ClShort64BitOffset("asan-short-64bit-mapping-offset",
163 static cl::opt<bool> ClOpt("asan-opt",
165 static cl::opt<bool> ClOptSameTemp("asan-opt-same-temp",
168 static cl::opt<bool> ClOptGlobals("asan-opt-globals",
171 static cl::opt<bool> ClCheckLifetime("asan-check-lifetime",
176 static cl::opt<int> ClDebug("asan-debug", cl::desc("debug"), cl::Hidden,
178 static cl::opt<int> ClDebugStack("asan-debug-stack", cl::desc("debug stack"),
180 static cl::opt<std::string> ClDebugFunc("asan-debug-func",
182 static cl::opt<int> ClDebugMin("asan-debug-min", cl::desc("Debug min inst"),
184 static cl::opt<int> ClDebugMax("asan-debug-max", cl::desc("Debug man inst"),
194 M.getNamedMetadata("llvm.asan.dynamically_initialized_globals");
383 // This causes asan to report a non-existing bug on 453.povray.
387 AddressSanitizer &ASan;
414 FunctionStackPoisoner(Function &F, AddressSanitizer &ASan)
415 : F(F), ASan(ASan), DIB(*F.getParent()), C(ASan.C),
416 IntptrTy(ASan.IntptrTy), IntptrPtrTy(PointerType::get(IntptrTy, 0)),
417 Mapping(ASan.Mapping),
464 if (!ASan.CheckLifetime) return;
469 // Found lifetime intrinsic, add ASan instrumentation if necessary.
503 uint64_t SizeInBytes = ASan.TD->getTypeAllocSize(Ty);
524 INITIALIZE_PASS(AddressSanitizer, "asan",
535 INITIALIZE_PASS(AddressSanitizerModule, "asan-module",
808 // Don't handle ODR type linkages since other modules may be built w/o asan.
1124 DEBUG(dbgs() << "ASAN instrumenting:\n" << F << "\n");
1215 DEBUG(dbgs() << "ASAN done instrumenting: " << res << " " << F << "\n");
1227 F.setSection("ASAN");
1328 ASan.TD->isLittleEndian()
1351 bool DoStackMalloc = ASan.CheckUseAfterReturn
1417 IRB.CreateAdd(LocalStackBase, ConstantInt::get(IntptrTy, ASan.LongSize/8)),
1427 2 * ASan.LongSize/8)),
1432 Value *ShadowBase = ASan.memToShadow(LocalStackBase, IRB);
1464 // For now just insert the call to ASan runtime.