[all-commits] [llvm/llvm-project] 641dc5: [orc-rt] Refactor RTTI for cross-library support, ...

Lang Hames via All-commits all-commits at lists.llvm.org
Fri Sep 11 15:36:07 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 641dc586869b21dc42785aa72949ed57c408204e
      https://github.com/llvm/llvm-project/commit/641dc586869b21dc42785aa72949ed57c408204e
  Author: Lang Hames <lhames at gmail.com>
  Date:   2026-09-12 (Sat, 12 Sep 2026)

  Changed paths:
    M orc-rt/docs/CodingConventions.md
    M orc-rt/include/orc-rt-c/support/CoreTypes.h
    M orc-rt/include/orc-rt-c/support/Error.h
    A orc-rt/include/orc-rt-c/support/RTTI.h
    M orc-rt/include/orc-rt/support/Error.h
    M orc-rt/include/orc-rt/support/RTTI.h
    M orc-rt/lib/support/Error.cpp
    M orc-rt/lib/support/RTTI.cpp
    M orc-rt/test/unit/CMakeLists.txt
    A orc-rt/test/unit/Inputs/RTTICrossDylibTestError.h
    A orc-rt/test/unit/Inputs/RTTICrossDylibTestLib.cpp
    A orc-rt/test/unit/Inputs/RTTICrossDylibTestLib.h
    M orc-rt/test/unit/support/CAPICompileTest.c
    M orc-rt/test/unit/support/ErrorCAPITest.cpp
    M orc-rt/test/unit/support/ErrorExceptionInteropTest.cpp
    M orc-rt/test/unit/support/ErrorTest.cpp
    A orc-rt/test/unit/support/RTTICrossDylibTest.cpp
    M orc-rt/test/unit/support/RTTITest.cpp

  Log Message:
  -----------
  [orc-rt] Refactor RTTI for cross-library support, add C API (#222946)

Identify types by name rather than by the address of a per-type ID
object, so that a type's identity survives crossing a library boundary:
an object may be constructed by one library and have its type queried by
another, each with its own copy of orc-rt, where per-type addresses
would not agree. Participating classes now declare an RTTIName, which
must be unique across the process.

RTTIRoot records which library produced each value, so same-library
queries still resolve by pointer comparison, and only cross-library ones
fall back to strcmp.

Adds orc-rt-c/support/RTTI.h to expose this to C.
ORC_RT_RTTI_PARTICIPANT and ORC_RT_C_RTTI_IMPL declare and define a
per-type cast entry point, reached via ORC_RT_DYNCAST, alongside
orc_rt_RTTIRoot_getTypeName for logging. This replaces the
orc_rt_Error_TypeId API (orc_rt_Error_getTypeId,
orc_rt_StringError_getTypeId), which exposed ID addresses and so could
not work across libraries. orc_rt_ErrorRef moves from CoreTypes.h to
Error.h.

RTTICrossDylibTest checks identity across a real boundary: its helper
library links its own copy of orc-rt-bedrock, giving it a distinct
library ID.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list