TermiNexus 1860259659 fix(mlir): 具名结构体统一按模块登记定义渲染(同名同体)
mlir-opt 报:
  error: identified type already used with a different body
      %110 = llvm.getelementptr %109[0, 1] : (!llvm.ptr) -> !llvm.ptr,
             !llvm.struct<"0ba5c56e78e3ff23.ParamNode", ()>

同一具名结构体在模块内出现两种体:多数处是 `(!llvm.ptr, !llvm.ptr)`(2 字段),
两处是 `()`(0 字段)。MLIR 的 identified type 要求**同名同体**。

根因:跨模块 stub 构造的**0 字段占位类型对象**被 TypePrint 内联成 `()` 体;
而 `_MlirTypeAppend` 对 `!` 前缀文本(`!llvm.struct<"name", …>`)原样直通,
也不回查登记表。

修复:新增 `_MlirNamedBodyFromTable`(按名字回查登记表,用**模块登记定义**渲染),
两条路径都先回查:
- `_MlirTypeAppend`:`!llvm.struct<"name", …>` 文本命中登记表则改用登记定义重渲;
- `TypePrint` 的 Struct 分支:命中登记表则用登记字段(含 packed 标记)替代自身字段。
未登记(独立 TypePrint / 外在类型)保持原行为(按自身字段内联)。

README §2.10 补"同名同体"硬性约束说明。
2026-10-03 22:18:29 +08:00
2026-09-30 00:25:55 +08:00
2026-08-17 11:01:35 +08:00
2026-09-29 17:00:36 +08:00
2026-09-29 17:00:20 +08:00
2026-09-29 16:59:46 +08:00
2026-09-29 16:59:21 +08:00
2026-09-29 16:47:50 +08:00
2026-09-29 16:47:20 +08:00
S
Description
GVSDS(TM) Viper SE Runtime Environment and Library (VRTE)
15 MiB
0 Stars 1 Watchers 0 Forks
Languages
C++ 76.8%
C 22%
CMake 1.2%