Skip to content

Commit 1c582bf

Browse files
committed
[IRGen] Manging: Add special entry points for underlying type/conformance strings
1 parent 128d6e1 commit 1c582bf

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

lib/IRGen/IRGenMangler.cpp

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,41 @@ std::string IRGenMangler::mangleSymbolNameForMangledConformanceAccessorString(
355355
return finalize();
356356
}
357357

358+
std::string IRGenMangler::mangleSymbolNameForUnderlyingTypeAccessorString(
359+
OpaqueTypeDecl *opaque, unsigned index) {
360+
beginManglingWithoutPrefix();
361+
Buffer << "get_underlying_type_ref ";
362+
363+
appendContextOf(opaque);
364+
appendOpaqueDeclName(opaque);
365+
366+
if (index == 0) {
367+
appendOperator("Qr");
368+
} else {
369+
appendOperator("QR", Index(index));
370+
}
371+
372+
return finalize();
373+
}
374+
375+
std::string
376+
IRGenMangler::mangleSymbolNameForUnderlyingWitnessTableAccessorString(
377+
OpaqueTypeDecl *opaque, const Requirement &req, ProtocolDecl *protocol) {
378+
beginManglingWithoutPrefix();
379+
Buffer << "get_underlying_witness ";
380+
381+
appendContextOf(opaque);
382+
appendOpaqueDeclName(opaque);
383+
384+
appendType(req.getFirstType()->getCanonicalType(), opaque->getGenericSignature());
385+
386+
appendProtocolName(protocol);
387+
388+
appendOperator("HC");
389+
390+
return finalize();
391+
}
392+
358393
std::string IRGenMangler::mangleSymbolNameForGenericEnvironment(
359394
CanGenericSignature genericSig) {
360395
beginManglingWithoutPrefix();

lib/IRGen/IRGenMangler.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,13 @@ class IRGenMangler : public Mangle::ASTMangler {
613613
CanType type,
614614
ProtocolConformanceRef conformance);
615615

616+
std::string
617+
mangleSymbolNameForUnderlyingTypeAccessorString(OpaqueTypeDecl *opaque,
618+
unsigned index);
619+
620+
std::string mangleSymbolNameForUnderlyingWitnessTableAccessorString(
621+
OpaqueTypeDecl *opaque, const Requirement &req, ProtocolDecl *protocol);
622+
616623
std::string mangleSymbolNameForGenericEnvironment(
617624
CanGenericSignature genericSig);
618625
protected:

0 commit comments

Comments
 (0)