[llvm-branch-commits] [mlir] [mlir][ptr] Add translations to LLVMIR for ptr ops. (PR #156355)
Christian Ulmann via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Sep 1 21:52:49 PDT 2025
================
@@ -33,21 +219,33 @@ class PtrDialectLLVMIRTranslationInterface
LogicalResult
convertOperation(Operation *op, llvm::IRBuilderBase &builder,
LLVM::ModuleTranslation &moduleTranslation) const final {
- // Translation for ptr dialect operations to LLVM IR is currently
- // unimplemented.
- return op->emitError("Translation for ptr dialect operations to LLVM IR is "
- "not implemented.");
+
+ return llvm::TypeSwitch<Operation *, LogicalResult>(op)
+ .Case<PtrAddOp>([&](PtrAddOp ptrAddOp) {
----------------
Dinistro wrote:
```suggestion
.Case([&](PtrAddOp ptrAddOp) {
```
Nit: The template parameter cab automatically be inferred from the lambda.
https://github.com/llvm/llvm-project/pull/156355
More information about the llvm-branch-commits
mailing list