[llvm] [orc-rt] Add SPSSymbolLookupSet typedef, clean up users. (PR #230876)
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Sat Oct 10 18:14:16 PDT 2026
https://github.com/lhames created https://github.com/llvm/llvm-project/pull/230876
Existing deserializers of SymbolLookupSet were spelling out the SPS type in full (SPSSequence<SPSTuple<SPSString, bool>>). Define an SPSSymbolLookupSet typedef and use in instead so that deserialization points can pick up any future changes automatically.
>From 7ab68c1332dbbb9b7002cb068f8938d61d4dae0a Mon Sep 17 00:00:00 2001
From: Lang Hames <lhames at gmail.com>
Date: Sun, 11 Oct 2026 12:01:45 +1100
Subject: [PATCH] [orc-rt] Add SPSSymbolLookupSet typedef, clean up users.
Existing deserializers of SymbolLookupSet were spelling out the SPS type
in full (SPSSequence<SPSTuple<SPSString, bool>>). Define an
SPSSymbolLookupSet typedef and use in instead so that deserialization
points can pick up any future changes automatically.
---
orc-rt/include/orc-rt/support/sps/SPSSymbolLookupSet.h | 2 ++
orc-rt/lib/bedrock/sps/NativeDylibManagerSPSCI.cpp | 6 +++---
.../test/unit/bedrock/sps/NativeDylibManagerSPSCITest.cpp | 3 +--
orc-rt/test/unit/support/sps/SPSSymbolLookupSetTest.cpp | 5 ++---
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/orc-rt/include/orc-rt/support/sps/SPSSymbolLookupSet.h b/orc-rt/include/orc-rt/support/sps/SPSSymbolLookupSet.h
index 4fbda71b35d9c..138703572b9a7 100644
--- a/orc-rt/include/orc-rt/support/sps/SPSSymbolLookupSet.h
+++ b/orc-rt/include/orc-rt/support/sps/SPSSymbolLookupSet.h
@@ -19,6 +19,8 @@
namespace orc_rt {
+using SPSSymbolLookupSet = SPSSequence<SPSTuple<SPSString, bool>>;
+
/// SPS serialization for SymbolLookupFlags as a bool.
///
/// RequiredSymbol serializes as true, WeaklyReferencedSymbol as false. This
diff --git a/orc-rt/lib/bedrock/sps/NativeDylibManagerSPSCI.cpp b/orc-rt/lib/bedrock/sps/NativeDylibManagerSPSCI.cpp
index 6943bace6eda6..56f28bb1f1af9 100644
--- a/orc-rt/lib/bedrock/sps/NativeDylibManagerSPSCI.cpp
+++ b/orc-rt/lib/bedrock/sps/NativeDylibManagerSPSCI.cpp
@@ -23,9 +23,9 @@ ORC_RT_SPS_WRAPPER_IMPL(
ORC_RT_SPS_WRAPPER_IMPL(
orc_rt_ci_sps_NativeDylibManager_lookup,
- SPSExpected<SPSSequence<SPSOptional<SPSExecutorAddr>>>(
- SPSExecutorAddr, SPSExecutorAddr,
- SPSSequence<SPSTuple<SPSString, bool>>),
+ SPSExpected<SPSSequence<SPSOptional<SPSExecutorAddr>>>(SPSExecutorAddr,
+ SPSExecutorAddr,
+ SPSSymbolLookupSet),
WrapperFunction::handleWithAsyncMethod(&NativeDylibManager::lookup))
static std::pair<SymbolNameSpec, const void *>
diff --git a/orc-rt/test/unit/bedrock/sps/NativeDylibManagerSPSCITest.cpp b/orc-rt/test/unit/bedrock/sps/NativeDylibManagerSPSCITest.cpp
index d0018b4d91915..d6b78a6374583 100644
--- a/orc-rt/test/unit/bedrock/sps/NativeDylibManagerSPSCITest.cpp
+++ b/orc-rt/test/unit/bedrock/sps/NativeDylibManagerSPSCITest.cpp
@@ -71,8 +71,7 @@ class NativeDylibManagerSPSCITest : public ::testing::Test {
void spsLookup(OnCompleteFn &&OnComplete, void *Handle,
SymbolLookupSet Symbols) {
using SPSSig = SPSExpected<SPSSequence<SPSOptional<SPSExecutorAddr>>>(
- SPSExecutorAddr, SPSExecutorAddr,
- SPSSequence<SPSTuple<SPSString, bool>>);
+ SPSExecutorAddr, SPSExecutorAddr, SPSSymbolLookupSet);
SPSWrapperFunction<SPSSig>::call(
caller(orc_rt_ci_sps_NativeDylibManager_lookup),
std::forward<OnCompleteFn>(OnComplete), NDM.get(), Handle,
diff --git a/orc-rt/test/unit/support/sps/SPSSymbolLookupSetTest.cpp b/orc-rt/test/unit/support/sps/SPSSymbolLookupSetTest.cpp
index a057f566c07aa..9d1cc4045fc93 100644
--- a/orc-rt/test/unit/support/sps/SPSSymbolLookupSetTest.cpp
+++ b/orc-rt/test/unit/support/sps/SPSSymbolLookupSetTest.cpp
@@ -51,10 +51,9 @@ TEST(SPSSymbolLookupSetTest, SymbolLookupFlagsWireFormat) {
}
TEST(SPSSymbolLookupSetTest, SymbolLookupSetSerialization) {
- using SPSTag = SPSSequence<SPSTuple<SPSString, bool>>;
- blobSerializationRoundTrip<SPSTag, SymbolLookupSet>(
+ blobSerializationRoundTrip<SPSSymbolLookupSet, SymbolLookupSet>(
SymbolLookupSet(), seqEqual<SymbolLookupSet>);
- blobSerializationRoundTrip<SPSTag, SymbolLookupSet>(
+ blobSerializationRoundTrip<SPSSymbolLookupSet, SymbolLookupSet>(
SymbolLookupSet({{"foo", SymbolLookupFlags::RequiredSymbol},
{"bar", SymbolLookupFlags::WeaklyReferencedSymbol}}),
seqEqual<SymbolLookupSet>);
More information about the llvm-commits
mailing list