[Mlir-commits] [mlir] [LLVMIR] Migrate away from PointerUnion::{is, get} (NFC) (PR #120530)

Kazu Hirata llvmlistbot at llvm.org
Thu Dec 19 08:41:01 PST 2024


================
@@ -280,7 +280,7 @@ getPointerDataLayoutEntry(DataLayoutEntryListRef params, LLVMPointerType type,
   for (DataLayoutEntryInterface entry : params) {
     if (!entry.isTypeEntry())
       continue;
-    if (cast<LLVMPointerType>(entry.getKey().get<Type>()).getAddressSpace() ==
+    if (cast<LLVMPointerType>(cast<Type>(entry.getKey())).getAddressSpace() ==
----------------
kazutakahirata wrote:

Yeah.  If I drop `llvm::`, the host compiler tries (but fails) to bind to:

```
template <typename U>
U Type::cast() const {
  return llvm::cast<U>(*this);
}
```

in `mlir/include/mlir/IR/Types.h`.

Perhaps, we should get rid of `Type::cast` and its friends, and solely rely on:

```
using llvm::cast;
```

`mlir/include/mlir/Support/LLVM.h`.

I'm happy to address this in a subsequent patch.


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


More information about the Mlir-commits mailing list