[Mlir-commits] [mlir] 9926619 - [mlir] Make TypedValue::getType() const (#76568)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Jan 1 12:43:22 PST 2024


Author: Andrei Golubev
Date: 2024-01-01T21:43:18+01:00
New Revision: 992661922a39e16d068f7aac940da4919bde9b92

URL: https://github.com/llvm/llvm-project/commit/992661922a39e16d068f7aac940da4919bde9b92
DIFF: https://github.com/llvm/llvm-project/commit/992661922a39e16d068f7aac940da4919bde9b92.diff

LOG: [mlir] Make TypedValue::getType() const (#76568)

The TypedValue::getType() essentially forwards the return value of
Value::getType() which is a const method. Somehow, at TypedValue level
the method's constness is lost, so restore it.

Originally done by: Nikita Kudriavtsev <nikita.kudriavtsev at intel.com>

Added: 
    

Modified: 
    mlir/include/mlir/IR/Value.h

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/IR/Value.h b/mlir/include/mlir/IR/Value.h
index 1c5bf09c1aeb87..fff3b87faff669 100644
--- a/mlir/include/mlir/IR/Value.h
+++ b/mlir/include/mlir/IR/Value.h
@@ -443,7 +443,7 @@ struct TypedValue : Value {
   static bool classof(Value value) { return llvm::isa<Ty>(value.getType()); }
 
   /// Return the known Type
-  Ty getType() { return llvm::cast<Ty>(Value::getType()); }
+  Ty getType() const { return llvm::cast<Ty>(Value::getType()); }
   void setType(Ty ty) { Value::setType(ty); }
 };
 


        


More information about the Mlir-commits mailing list