mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
AST: Interface type mangling for protocol conformances.
Mangle the generic signature and interface type of the conforming type signature. Fix the demangler to reset the generic context between mangling a witness's conformance and requirement; they have independent generic contexts, and the bookkeeping for generic signatures notes the discrepancy. Swift SVN r28377
This commit is contained in:
@@ -348,6 +348,11 @@ public:
|
||||
unsigned(*_kind))); \
|
||||
} while (false)
|
||||
|
||||
void resetGenericContext() {
|
||||
ArchetypeCounts.clear();
|
||||
ArchetypeCount = 0;
|
||||
}
|
||||
|
||||
/// Attempt to demangle the source string. The root node will
|
||||
/// always be a Global. Extra characters at the end will be
|
||||
/// tolerated (and included as a Suffix node as a child of the
|
||||
@@ -368,8 +373,7 @@ public:
|
||||
// The Substitution header does not share state with the rest
|
||||
// of the mangling.
|
||||
Substitutions.clear();
|
||||
ArchetypeCounts.clear();
|
||||
ArchetypeCount = 0;
|
||||
resetGenericContext();
|
||||
} while (Mangled.nextIf("_TTS"));
|
||||
|
||||
// Then check that we have a global.
|
||||
@@ -642,6 +646,8 @@ private:
|
||||
if (Mangled.nextIf('W')) {
|
||||
NodePointer thunk = NodeFactory::create(Node::Kind::ProtocolWitness);
|
||||
DEMANGLE_CHILD_OR_RETURN(thunk, ProtocolConformance);
|
||||
// The entity is mangled in its own generic context.
|
||||
resetGenericContext();
|
||||
DEMANGLE_CHILD_OR_RETURN(thunk, Entity);
|
||||
return thunk;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user