[clang] [CIR][NFC] Remove redundant pointer casts (PR #139898)

via cfe-commits cfe-commits at lists.llvm.org
Wed May 14 06:31:39 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clangir

Author: Henrich Lauko (xlauko)

<details>
<summary>Changes</summary>

This mirrors incubator changes from https://github.com/llvm/clangir/pull/1609

---
Full diff: https://github.com/llvm/llvm-project/pull/139898.diff


1 Files Affected:

- (modified) clang/include/clang/CIR/Dialect/IR/CIROps.td (+2-2) 


``````````diff
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();
     }
   }];
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/139898


More information about the cfe-commits mailing list