[Mlir-commits] [mlir] [TypeID] Update private typeid definition in `DeferredLocInfo` (PR #128968)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Feb 26 15:46:50 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir-core

Author: Stef Lindall (bethebunny)

<details>
<summary>Changes</summary>

The parser's `DeferredLocInfo` uses an uncommon typeID setup, where it defines a private typeID for pointers to the struct.

When using the fallback TypeID mechanism introduced in https://github.com/llvm/llvm-project/pull/126999, the fallback type ID mechanism doesn't support anonymous namespaces, and the `INTERNAL_INLINE` mechanism doesn't support pointer types.

Explicitly use `SELF_OWNING_TYPE_ID` for this case.

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


1 Files Affected:

- (modified) mlir/lib/AsmParser/Parser.cpp (+2-2) 


``````````diff
diff --git a/mlir/lib/AsmParser/Parser.cpp b/mlir/lib/AsmParser/Parser.cpp
index c316f34d977e9..168231af9b410 100644
--- a/mlir/lib/AsmParser/Parser.cpp
+++ b/mlir/lib/AsmParser/Parser.cpp
@@ -839,8 +839,8 @@ class OperationParser : public Parser {
 };
 } // namespace
 
-MLIR_DECLARE_EXPLICIT_TYPE_ID(OperationParser::DeferredLocInfo *)
-MLIR_DEFINE_EXPLICIT_TYPE_ID(OperationParser::DeferredLocInfo *)
+MLIR_DECLARE_EXPLICIT_SELF_OWNING_TYPE_ID(OperationParser::DeferredLocInfo *)
+MLIR_DEFINE_EXPLICIT_SELF_OWNING_TYPE_ID(OperationParser::DeferredLocInfo *)
 
 OperationParser::OperationParser(ParserState &state, ModuleOp topLevelOp)
     : Parser(state), opBuilder(topLevelOp.getRegion()), topLevelOp(topLevelOp) {

``````````

</details>


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


More information about the Mlir-commits mailing list