summaryrefslogtreecommitdiffstats
path: root/mlir/include
diff options
context:
space:
mode:
authorHideto Ueno <uenoku.tokotoko@gmail.com>2019-12-25 14:50:56 +0900
committerHideto Ueno <uenoku.tokotoko@gmail.com>2019-12-25 15:51:26 +0900
commit1497a4350e266676d5b8371bf330c2cce6e5f643 (patch)
tree365cb6313a02ef26023c600ca5c0bb6eddc269d1 /mlir/include
parent1d5d074aef2a92e9db8f8dabf60281c1da8baa99 (diff)
downloadbcm5719-llvm-1497a4350e266676d5b8371bf330c2cce6e5f643.tar.gz
bcm5719-llvm-1497a4350e266676d5b8371bf330c2cce6e5f643.zip
[MLIR][NFC] Insert const_cast to avoid warning
Reviewers: rriddle Reviewed By: rriddle Subscribers: mehdi_amini Differential Revision: https://reviews.llvm.org/D71853
Diffstat (limited to 'mlir/include')
-rw-r--r--mlir/include/mlir/IR/Value.h2
-rw-r--r--mlir/include/mlir/Pass/PassOptions.h3
2 files changed, 3 insertions, 2 deletions
diff --git a/mlir/include/mlir/IR/Value.h b/mlir/include/mlir/IR/Value.h
index c4356b16840..85e23b6b756 100644
--- a/mlir/include/mlir/IR/Value.h
+++ b/mlir/include/mlir/IR/Value.h
@@ -109,7 +109,7 @@ public:
/// value-type.
/// TODO(riverriddle) Remove these when all usages have been removed.
Value operator*() const { return *this; }
- Value *operator->() const { return (Value *)this; }
+ Value *operator->() const { return const_cast<Value *>(this); }
operator bool() const { return impl; }
bool operator==(const Value &other) const { return impl == other.impl; }
diff --git a/mlir/include/mlir/Pass/PassOptions.h b/mlir/include/mlir/Pass/PassOptions.h
index 01a4b43a185..4513fc90f8d 100644
--- a/mlir/include/mlir/Pass/PassOptions.h
+++ b/mlir/include/mlir/Pass/PassOptions.h
@@ -176,7 +176,8 @@ public:
/// Copy the value from the given option into this one.
void copyValueFrom(const OptionBase &other) final {
- (*this) = ArrayRef<DataType>((ListOption<DataType> &)other);
+ (*this) = ArrayRef<DataType>(
+ (ListOption<DataType> &)(const_cast<OptionBase &>(other)));
}
};
OpenPOWER on IntegriCloud