Skip to content

Commit 8fa5861

Browse files
committed
[Remote] Add protocol conformance demangling support.
MetadataReader should expose the builder's protocol conformance related types, and should provide a method to demangle a mangled protocol conformance. rdar://46280860
1 parent 67393a5 commit 8fa5861

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

include/swift/Remote/MetadataReader.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ class MetadataReader {
165165
using BuiltTypeDecl = typename BuilderType::BuiltTypeDecl;
166166
using BuiltProtocolDecl = typename BuilderType::BuiltProtocolDecl;
167167
using BuiltRequirement = typename BuilderType::BuiltRequirement;
168+
using BuiltProtocolConformance = typename BuilderType::BuiltProtocolConformance;
169+
using BuiltProtocolConformanceDecl =
170+
typename BuilderType::BuiltProtocolConformanceDecl;
168171
using StoredPointer = typename Runtime::StoredPointer;
169172
using StoredSignedPointer = typename Runtime::StoredSignedPointer;
170173
using StoredSize = typename Runtime::StoredSize;
@@ -472,6 +475,12 @@ class MetadataReader {
472475
return swift::Demangle::decodeMangledType(Builder, Node);
473476
}
474477

478+
/// Given a demangle tree, attempt to turn it into a protocol conformance
479+
TypeLookupErrorOr<typename BuilderType::BuiltProtocolConformance>
480+
decodeMangledProtocolConformance(NodePointer Node) {
481+
return swift::Demangle::decodeMangledProtocolConformance(Builder, Node);
482+
}
483+
475484
/// Get the remote process's swift_isaMask.
476485
llvm::Optional<StoredPointer> readIsaMask() {
477486
auto encoding = getIsaEncoding();

0 commit comments

Comments
 (0)