Mangling: wire up the new mangling in various places in the compiler, but still use the old mangling.

The purpose of this change is to test if the new mangling is equivalent to the old mangling.
Both mangling strings are created, de-mangled and checked if the de-mangle trees are equivalent.
This commit is contained in:
Erik Eckstein
2016-12-05 09:34:16 -08:00
parent e7489462de
commit 5ac0c5b9b7
18 changed files with 558 additions and 104 deletions

View File

@@ -198,7 +198,12 @@ static bool extendedTypeIsPrivate(TypeLoc inheritedType) {
static std::string mangleTypeAsContext(const NominalTypeDecl *type) {
Mangle::Mangler mangler(/*debug style=*/false, /*Unicode=*/true);
mangler.mangleContext(type);
return mangler.finalize();
std::string Old = mangler.finalize();
NewMangling::ASTMangler NewMangler(/*debug style=*/false, /*Unicode=*/true);
std::string New = NewMangler.mangleTypeAsContextUSR(type);
return NewMangling::selectMangling(Old, New);
}
/// Emits a Swift-style dependencies file.