aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert David <lrdx@google.com>2021-06-16 15:31:20 -0700
committerFangrui Song <i@maskray.me>2021-06-16 15:31:20 -0700
commit7cfb7a67c57dfb40518a0873137a21b0a8def503 (patch)
tree30041b492874ef2eee4276895f14d4c03b6643b2
parenta127dffc49e5031b7780b3c747e8970a6f2ce0ee (diff)
downloadllvm-7cfb7a67c57dfb40518a0873137a21b0a8def503.zip
llvm-7cfb7a67c57dfb40518a0873137a21b0a8def503.tar.gz
llvm-7cfb7a67c57dfb40518a0873137a21b0a8def503.tar.bz2
[mlir] Make Type::print and Type::dump const
-rw-r--r--mlir/include/mlir/IR/Types.h4
-rw-r--r--mlir/lib/IR/AsmPrinter.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/mlir/include/mlir/IR/Types.h b/mlir/include/mlir/IR/Types.h
index 9aeff14..3b714ab 100644
--- a/mlir/include/mlir/IR/Types.h
+++ b/mlir/include/mlir/IR/Types.h
@@ -156,8 +156,8 @@ public:
bool isIntOrIndexOrFloat() const;
/// Print the current type.
- void print(raw_ostream &os);
- void dump();
+ void print(raw_ostream &os) const;
+ void dump() const;
friend ::llvm::hash_code hash_value(Type arg);
diff --git a/mlir/lib/IR/AsmPrinter.cpp b/mlir/lib/IR/AsmPrinter.cpp
index 7936964..7bc9bec 100644
--- a/mlir/lib/IR/AsmPrinter.cpp
+++ b/mlir/lib/IR/AsmPrinter.cpp
@@ -2697,9 +2697,9 @@ void Attribute::dump() const {
llvm::errs() << "\n";
}
-void Type::print(raw_ostream &os) { ModulePrinter(os).printType(*this); }
+void Type::print(raw_ostream &os) const { ModulePrinter(os).printType(*this); }
-void Type::dump() { print(llvm::errs()); }
+void Type::dump() const { print(llvm::errs()); }
void AffineMap::dump() const {
print(llvm::errs());