Skip to content

Commit

Permalink
Update upgrade some uses of mlir::interleave API to take container ar…
Browse files Browse the repository at this point in the history
…gument directly.

PiperOrigin-RevId: 273446814
  • Loading branch information
jingpu authored and tensorflower-gardener committed Oct 8, 2019
1 parent a8a73f0 commit 780f107
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion mlir/lib/IR/AsmPrinter.cpp
Expand Up @@ -394,7 +394,7 @@ class ModulePrinter {

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);
Expand Down

0 comments on commit 780f107

Please sign in to comment.