/external/compiler-rt/lib/asan/tests/ |
asan_str_test.cc | 212 // Users may have different definitions of "strchr" and "index", so provide 220 static void RunStrChrTestImpl(StrChrFn *StrChr) { 225 EXPECT_EQ(str, StrChr(str, 'z')); 226 EXPECT_EQ(str + 10, StrChr(str, 'q')); 227 EXPECT_EQ(NULL, StrChr(str, 'a')); 228 // StrChr argument points to not allocated memory. 229 EXPECT_DEATH(Ident(StrChr(str - 1, 'z')), LeftOOBReadMessage(1)); 230 EXPECT_DEATH(Ident(StrChr(str + size, 'z')), RightOOBReadMessage(0)); 233 EXPECT_DEATH(Ident(StrChr(str, 'a')), RightOOBReadMessage(0)); 238 UNUSED static void RunStrChrTest(PointerToStrChr1 StrChr, ...) [all...] |
/external/swiftshader/third_party/LLVM/lib/Transforms/Utils/ |
BuildLibCalls.cpp | 52 /// EmitStrChr - Emit a call to the strchr function to the builder, for the 63 Constant *StrChr = M->getOrInsertFunction("strchr", AttrListPtr::get(&AWI, 1), 65 CallInst *CI = B.CreateCall2(StrChr, CastToCStr(Ptr, B), 66 ConstantInt::get(I32Ty, C), "strchr"); 67 if (const Function *F = dyn_cast<Function>(StrChr->stripPointerCasts()))
|
/external/v8/src/base/platform/ |
platform.h | 207 static char* StrChr(char* str, int c);
|
platform-posix.cc | 671 char* OS::StrChr(char* str, int c) { 672 return strchr(str, c); 831 char* period_pos = strchr(buffer, '.');
|
platform-win32.cc | 673 char* OS::StrChr(char* str, int c) { 674 return const_cast<char*>(strchr(str, c)); [all...] |
/external/llvm/lib/Transforms/Utils/ |
BuildLibCalls.cpp | 121 case LibFunc::strchr: 736 if (!TLI->has(LibFunc::strchr)) 742 Constant *StrChr = 743 M->getOrInsertFunction("strchr", I8Ptr, I8Ptr, I32Ty, nullptr); 744 inferLibFuncAttributes(*M->getFunction("strchr"), *TLI); 746 StrChr, {castToCStr(Ptr, B), ConstantInt::get(I32Ty, C)}, "strchr"); 747 if (const Function *F = dyn_cast<Function>(StrChr->stripPointerCasts())) [all...] |
SimplifyLibCalls.cpp | 204 if (CharC->isZero()) // strchr(p, 0) -> p + strlen(p) 206 "strchr"); 215 if (I == StringRef::npos) // Didn't find the char. strchr returns null. 218 // strchr(s+n,c) -> gep(s+n+i,c) 219 return B.CreateGEP(B.getInt8Ty(), SrcStr, B.getInt64(I), "strchr"); 232 // strrchr(s, 0) -> strchr(s, 0) 501 // strpbrk(s, "a") -> strchr(s, 'a') 610 // fold strstr(x, "y") -> strchr(x, 'y'). 612 Value *StrChr = emitStrChr(CI->getArgOperand(0), ToFindStr[0], B, TLI); 613 return StrChr ? B.CreateBitCast(StrChr, CI->getType()) : nullptr [all...] |
/external/swiftshader/third_party/llvm-7.0/llvm/lib/Transforms/Utils/ |
BuildLibCalls.cpp | 787 Constant *StrChr = 791 StrChr, {castToCStr(Ptr, B), ConstantInt::get(I32Ty, C)}, StrChrName); 792 if (const Function *F = dyn_cast<Function>(StrChr->stripPointerCasts())) [all...] |
SimplifyLibCalls.cpp | 250 if (CharC->isZero()) // strchr(p, 0) -> p + strlen(p) 252 "strchr"); 261 if (I == StringRef::npos) // Didn't find the char. strchr returns null. 264 // strchr(s+n,c) -> gep(s+n+i,c) 265 return B.CreateGEP(B.getInt8Ty(), SrcStr, B.getInt64(I), "strchr"); 278 // strrchr(s, 0) -> strchr(s, 0) 570 // strpbrk(s, "a") -> strchr(s, 'a') 679 // fold strstr(x, "y") -> strchr(x, 'y'). 681 Value *StrChr = emitStrChr(CI->getArgOperand(0), ToFindStr[0], B, TLI); 682 return StrChr ? B.CreateBitCast(StrChr, CI->getType()) : nullptr [all...] |
/external/swiftshader/third_party/LLVM/lib/Transforms/Scalar/ |
SimplifyLibCalls.cpp | 230 // 'strchr' Optimizations 234 // Verify the "strchr" function prototype. 266 // strchr can find the nul character. 271 if (I == std::string::npos) // Didn't find the char. strchr returns null. 274 // strchr(s+n,c) -> gep(s+n+i,c) 275 return B.CreateGEP(SrcStr, B.getInt64(I), "strchr"); 301 // strrchr(s, 0) -> strchr(s, 0) 570 // strpbrk(s, "a") -> strchr(s, 'a') 716 // fold strstr(x, "y") -> strchr(x, 'y'). [all...] |