diff options
| author | Feng Liu <fengliuai@google.com> | 2018-10-19 09:07:58 -0700 |
|---|---|---|
| committer | jpienaar <jpienaar@google.com> | 2019-03-29 13:33:41 -0700 |
| commit | 34927e2474bfec5c3f50a9694432816096f2df1c (patch) | |
| tree | 2c52801aa596509193ae422a05c9a33dfcbd7de3 /mlir/lib/IR/AsmPrinter.cpp | |
| parent | 8c7478d10ce588c562992415bcaf21287b7f4686 (diff) | |
| download | bcm5719-llvm-34927e2474bfec5c3f50a9694432816096f2df1c.tar.gz bcm5719-llvm-34927e2474bfec5c3f50a9694432816096f2df1c.zip | |
Rename Operation::getAs to Operation::dyn_cast
Also rename Operation::is to Operation::isa
Introduce Operation::cast
All of these are for consistency with global dyn_cast/cast/isa operators.
PiperOrigin-RevId: 217878786
Diffstat (limited to 'mlir/lib/IR/AsmPrinter.cpp')
| -rw-r--r-- | mlir/lib/IR/AsmPrinter.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mlir/lib/IR/AsmPrinter.cpp b/mlir/lib/IR/AsmPrinter.cpp index ada8f1cebd8..e70dcae2936 100644 --- a/mlir/lib/IR/AsmPrinter.cpp +++ b/mlir/lib/IR/AsmPrinter.cpp @@ -977,16 +977,16 @@ protected: // Give constant integers special names. if (auto *op = value->getDefiningOperation()) { - if (auto intOp = op->getAs<ConstantIntOp>()) { + if (auto intOp = op->dyn_cast<ConstantIntOp>()) { // i1 constants get special names. if (intOp->getType()->isInteger(1)) { specialName << (intOp->getValue() ? "true" : "false"); } else { specialName << 'c' << intOp->getValue() << '_' << *intOp->getType(); } - } else if (auto intOp = op->getAs<ConstantIndexOp>()) { + } else if (auto intOp = op->dyn_cast<ConstantIndexOp>()) { specialName << 'c' << intOp->getValue(); - } else if (auto constant = op->getAs<ConstantOp>()) { + } else if (auto constant = op->dyn_cast<ConstantOp>()) { if (isa<FunctionAttr>(constant->getValue())) specialName << 'f'; else |

