summaryrefslogtreecommitdiffstats
path: root/mlir/lib/IR/AsmPrinter.cpp
diff options
context:
space:
mode:
authorChris Lattner <clattner@google.com>2018-12-23 08:17:48 -0800
committerjpienaar <jpienaar@google.com>2019-03-29 14:35:19 -0700
commit1301f907a10e25e4a05483977a50c8b4f34b2ed4 (patch)
tree5d289f379659c4d458411958cf631e4d22ada678 /mlir/lib/IR/AsmPrinter.cpp
parent4eef795a1dbd7eafa9a45303f01c51921729f1f4 (diff)
downloadbcm5719-llvm-1301f907a10e25e4a05483977a50c8b4f34b2ed4.tar.gz
bcm5719-llvm-1301f907a10e25e4a05483977a50c8b4f34b2ed4.zip
Refactor ForStmt: having it contain a StmtBlock instead of subclassing
StmtBlock. This is more consistent with IfStmt and also conceptually makes more sense - a forstmt "isn't" its body, it contains its body. This is step 1/N towards merging BasicBlock and StmtBlock. This is required because in the new regime StmtBlock will have a use list (just like BasicBlock does) of operands, and ForStmt already has a use list for its induction variable. This is a mechanical patch, NFC. PiperOrigin-RevId: 226684158
Diffstat (limited to 'mlir/lib/IR/AsmPrinter.cpp')
-rw-r--r--mlir/lib/IR/AsmPrinter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/mlir/lib/IR/AsmPrinter.cpp b/mlir/lib/IR/AsmPrinter.cpp
index b798e3890a0..58f34af60f5 100644
--- a/mlir/lib/IR/AsmPrinter.cpp
+++ b/mlir/lib/IR/AsmPrinter.cpp
@@ -206,7 +206,7 @@ void ModuleState::visitForStmt(const ForStmt *forStmt) {
if (!hasShorthandForm(ubMap))
recordAffineMapReference(ubMap);
- for (auto &childStmt : *forStmt)
+ for (auto &childStmt : *forStmt->getBody())
visitStatement(&childStmt);
}
@@ -1447,7 +1447,7 @@ void MLFunctionPrinter::print(const ForStmt *stmt) {
os << " step " << stmt->getStep();
os << " {\n";
- print(static_cast<const StmtBlock *>(stmt));
+ print(stmt->getBody());
os.indent(numSpaces) << "}";
}
OpenPOWER on IntegriCloud