[mlir] Use all_of instead of a manual loop in IntrinsicGen. NFC

This was suggested in post-commit review of D72926.
This commit is contained in:
Alex Zinenko 2020-01-24 11:27:17 +01:00
parent 0298a87511
commit b901335193

View File

@ -117,11 +117,11 @@ public:
/// Get the number of operands.
unsigned getNumOperands() const {
auto operands = record.getValueAsListOfDefs(fieldOperands);
for (const llvm::Record *r : operands) {
(void)r;
assert(r->isSubClassOf("LLVMType") &&
"expected operands to be of LLVM type");
}
assert(llvm::all_of(operands,
[](const llvm::Record *r) {
return r->isSubClassOf("LLVMType");
}) &&
"expected operands to be of LLVM type");
return operands.size();
}