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

Stef Lindall llvmlistbot at llvm.org
Wed Feb 26 15:46:16 PST 2025


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

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.

>From 7f056577ca8f9f8e584e9eb33b4a97f814b02dc0 Mon Sep 17 00:00:00 2001
From: Stef <stef at modular.com>
Date: Wed, 26 Feb 2025 23:42:15 +0000
Subject: [PATCH] [TypeID] Update private typeid definition

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.
---
 mlir/lib/AsmParser/Parser.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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) {



More information about the Mlir-commits mailing list