[clang] [CIR] Simplify ConstantOp accesses and its getDefiningOp (PR #151216)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 1 09:56:32 PDT 2025


================
@@ -291,6 +291,21 @@ def CIR_ConstantOp : CIR_Op<"const", [
         return ptrAttr.isNullValue();
       return false;
     }
+
+    template <typename T>
+    T getValueAttr() { return mlir::dyn_cast<T>(getValue()); }
+
+    llvm::APInt getIntValue() {
----------------
andykaylor wrote:

These look good, but are they used anywhere?

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


More information about the cfe-commits mailing list