diff options
| author | River Riddle <riverriddle@google.com> | 2019-09-20 20:43:02 -0700 |
|---|---|---|
| committer | A. Unique TensorFlower <gardener@tensorflow.org> | 2019-09-20 20:43:35 -0700 |
| commit | 3a643de92b4c1a93b0725f171f4384c8dd941dd5 (patch) | |
| tree | 267002d5439f6551f70bd415987774e51cf6823c /mlir/lib/Dialect/LoopOps | |
| parent | 729727ebc7e9e5b27e73b1ae0fdaa4bb7c312098 (diff) | |
| download | bcm5719-llvm-3a643de92b4c1a93b0725f171f4384c8dd941dd5.tar.gz bcm5719-llvm-3a643de92b4c1a93b0725f171f4384c8dd941dd5.zip | |
NFC: Pass OpAsmPrinter by reference instead of by pointer.
MLIR follows the LLVM style of pass-by-reference.
PiperOrigin-RevId: 270401378
Diffstat (limited to 'mlir/lib/Dialect/LoopOps')
| -rw-r--r-- | mlir/lib/Dialect/LoopOps/LoopOps.cpp | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/mlir/lib/Dialect/LoopOps/LoopOps.cpp b/mlir/lib/Dialect/LoopOps/LoopOps.cpp index ddc263642e1..7ea9c156ea4 100644 --- a/mlir/lib/Dialect/LoopOps/LoopOps.cpp +++ b/mlir/lib/Dialect/LoopOps/LoopOps.cpp @@ -72,14 +72,13 @@ LogicalResult verify(ForOp op) { return success(); } -static void print(OpAsmPrinter *p, ForOp op) { - *p << op.getOperationName() << " " << *op.getInductionVar() << " = " - << *op.lowerBound() << " to " << *op.upperBound() << " step " - << *op.step(); - p->printRegion(op.region(), - /*printEntryBlockArgs=*/false, - /*printBlockTerminators=*/false); - p->printOptionalAttrDict(op.getAttrs()); +static void print(OpAsmPrinter &p, ForOp op) { + p << op.getOperationName() << " " << *op.getInductionVar() << " = " + << *op.lowerBound() << " to " << *op.upperBound() << " step " << *op.step(); + p.printRegion(op.region(), + /*printEntryBlockArgs=*/false, + /*printBlockTerminators=*/false); + p.printOptionalAttrDict(op.getAttrs()); } static ParseResult parseForOp(OpAsmParser &parser, OperationState &result) { @@ -182,22 +181,22 @@ static ParseResult parseIfOp(OpAsmParser &parser, OperationState &result) { return success(); } -static void print(OpAsmPrinter *p, IfOp op) { - *p << IfOp::getOperationName() << " " << *op.condition(); - p->printRegion(op.thenRegion(), - /*printEntryBlockArgs=*/false, - /*printBlockTerminators=*/false); +static void print(OpAsmPrinter &p, IfOp op) { + p << IfOp::getOperationName() << " " << *op.condition(); + p.printRegion(op.thenRegion(), + /*printEntryBlockArgs=*/false, + /*printBlockTerminators=*/false); // Print the 'else' regions if it exists and has a block. auto &elseRegion = op.elseRegion(); if (!elseRegion.empty()) { - *p << " else"; - p->printRegion(elseRegion, - /*printEntryBlockArgs=*/false, - /*printBlockTerminators=*/false); + p << " else"; + p.printRegion(elseRegion, + /*printEntryBlockArgs=*/false, + /*printBlockTerminators=*/false); } - p->printOptionalAttrDict(op.getAttrs()); + p.printOptionalAttrDict(op.getAttrs()); } //===----------------------------------------------------------------------===// |

