[Mlir-commits] [mlir] [mlir] Make TypedValue::getType() const (PR #76568)
Andrei Golubev
llvmlistbot at llvm.org
Fri Dec 29 06:53:37 PST 2023
https://github.com/andrey-golubev created https://github.com/llvm/llvm-project/pull/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>
>From 99c86e637d32ac0b76ec6d80e58fb438a0adebfc Mon Sep 17 00:00:00 2001
From: Andrei Golubev <andrey.golubev at intel.com>
Date: Fri, 29 Dec 2023 15:50:26 +0100
Subject: [PATCH] [mlir] Make TypedValue::getType() const
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>
---
mlir/include/mlir/IR/Value.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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