Use std::find instead of manual loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250624 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Craig Topper 2015-10-17 21:32:28 +00:00
parent f67852f012
commit 7a2d52ce5d

View File

@ -2044,11 +2044,8 @@ bool llvm::isImageOrSamplerVal(const Value *arg, const Module *context) {
auto *STy = dyn_cast<StructType>(PTy->getElementType());
const std::string TypeName = STy && !STy->isLiteral() ? STy->getName() : "";
for (int i = 0, e = array_lengthof(specialTypes); i != e; ++i)
if (TypeName == specialTypes[i])
return true;
return false;
return std::find(std::begin(specialTypes), std::end(specialTypes),
TypeName) != std::end(specialTypes);
}
SDValue NVPTXTargetLowering::LowerFormalArguments(