-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[CIR][NFC] Remove redundant pointer casts #139898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This mirrors incubator changes from llvm/clangir#1609
@llvm/pr-subscribers-clangir Author: Henrich Lauko (xlauko) ChangesThis mirrors incubator changes from llvm/clangir#1609 Full diff: https://github.com/llvm/llvm-project/pull/139898.diff 1 Files Affected:
diff --git a/clang/include/clang/CIR/Dialect/IR/CIROps.td b/clang/include/clang/CIR/Dialect/IR/CIROps.td
index 9f5fa266742e8..e08f372450285 100644
--- a/clang/include/clang/CIR/Dialect/IR/CIROps.td
+++ b/clang/include/clang/CIR/Dialect/IR/CIROps.td
@@ -269,7 +269,7 @@ def PtrStrideOp : CIR_Op<"ptr_stride",
let extraClassDeclaration = [{
// Get type pointed by the base pointer.
mlir::Type getElementTy() {
- return mlir::cast<cir::PointerType>(getBase().getType()).getPointee();
+ return getBase().getType().getPointee();
}
}];
}
@@ -1710,7 +1710,7 @@ def GetMemberOp : CIR_Op<"get_member"> {
/// Return the result type.
cir::PointerType getResultTy() {
- return mlir::cast<cir::PointerType>(getResult().getType());
+ return getResult().getType();
}
}];
|
@llvm/pr-subscribers-clang Author: Henrich Lauko (xlauko) ChangesThis mirrors incubator changes from llvm/clangir#1609 Full diff: https://github.com/llvm/llvm-project/pull/139898.diff 1 Files Affected:
diff --git a/clang/include/clang/CIR/Dialect/IR/CIROps.td b/clang/include/clang/CIR/Dialect/IR/CIROps.td
index 9f5fa266742e8..e08f372450285 100644
--- a/clang/include/clang/CIR/Dialect/IR/CIROps.td
+++ b/clang/include/clang/CIR/Dialect/IR/CIROps.td
@@ -269,7 +269,7 @@ def PtrStrideOp : CIR_Op<"ptr_stride",
let extraClassDeclaration = [{
// Get type pointed by the base pointer.
mlir::Type getElementTy() {
- return mlir::cast<cir::PointerType>(getBase().getType()).getPointee();
+ return getBase().getType().getPointee();
}
}];
}
@@ -1710,7 +1710,7 @@ def GetMemberOp : CIR_Op<"get_member"> {
/// Return the result type.
cir::PointerType getResultTy() {
- return mlir::cast<cir::PointerType>(getResult().getType());
+ return getResult().getType();
}
}];
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/51/builds/16150 Here is the relevant piece of the build log for the reference
|
This mirrors incubator changes from llvm/clangir#1609