Use std::find instead of manual loop.

llvm-svn: 250624
This commit is contained in:
Craig Topper 2015-10-17 21:32:28 +00:00
parent a833451173
commit ec15ea12e7
1 changed files with 2 additions and 5 deletions

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(