Update upgrade some uses of mlir::interleave API to take container argument directly.

PiperOrigin-RevId: 273446814
This commit is contained in:
Jing Pu 2019-10-07 21:52:36 -07:00 committed by A. Unique TensorFlower
parent a8a73f0640
commit 780f107a57
2 changed files with 3 additions and 7 deletions

View File

@ -632,15 +632,11 @@ static LogicalResult verify(YieldOp op) {
static void printLinalgLibraryOp(OpAsmPrinter &p, Operation *op) {
assert(op->getAbstractOperation() && "unregistered operation");
p << op->getName().getStringRef() << "(";
interleave(
op->getOperands().begin(), op->getOperands().end(),
[&](Value *v) { p << *v; }, [&]() { p << ", "; });
interleaveComma(op->getOperands(), p, [&](Value *v) { p << *v; });
p << ")";
p.printOptionalAttrDict(op->getAttrs());
p << " : ";
interleave(
op->getOperands().begin(), op->getOperands().end(),
[&](Value *v) { p << v->getType(); }, [&]() { p << ", "; });
interleaveComma(op->getOperands(), p, [&](Value *v) { p << v->getType(); });
}
static ParseResult parseLinalgLibraryOp(OpAsmParser &parser,

View File

@ -394,7 +394,7 @@ public:
template <typename Container, typename UnaryFunctor>
inline void interleaveComma(const Container &c, UnaryFunctor each_fn) const {
interleave(c.begin(), c.end(), each_fn, [&]() { os << ", "; });
mlir::interleaveComma(c, os, each_fn);
}
void print(ModuleOp module);