[mlir] Make Type::print and Type::dump const
authorRobert David <lrdx@google.com>
Wed, 16 Jun 2021 22:31:20 +0000 (15:31 -0700)
committerFangrui Song <i@maskray.me>
Wed, 16 Jun 2021 22:31:20 +0000 (15:31 -0700)
mlir/include/mlir/IR/Types.h
mlir/lib/IR/AsmPrinter.cpp

index 9aeff14..3b714ab 100644 (file)
@@ -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);
 
index 7936964..7bc9bec 100644 (file)
@@ -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());