[llvm] [SandboxIR] Implement ConstantExpr (PR #109491)

via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 20 16:34:30 PDT 2024


================
@@ -1661,6 +1663,19 @@ class ConstantPtrAuth final : public Constant {
   }
 };
 
+class ConstantExpr : public Constant {
+  ConstantExpr(llvm::ConstantExpr *C, Context &Ctx)
+      : Constant(ClassID::ConstantExpr, C, Ctx) {}
+  friend class Context; // For constructor.
+
+public:
+  /// For isa/dyn_cast.
+  static bool classof(const sandboxir::Value *From) {
+    return From->getSubclassID() == ClassID::ConstantExpr;
+  }
+  // TODO: Missing functions.
----------------
vporpo wrote:

I think ConstExpr is being phased out gradually, or parts of it? I don't think we really need it for now.

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


More information about the llvm-commits mailing list