Mangling: prepare for using new mangling for USR and debug-info type generation.

Select between old and new mangling as we already do in other places in the compiler.
NFC as long as the new mangling is not enabled yet.
This commit is contained in:
Erik Eckstein
2016-12-05 09:53:05 -08:00
parent 8730f9d5fb
commit a56a97c89f
9 changed files with 58 additions and 37 deletions

View File

@@ -18,7 +18,7 @@
//
//===----------------------------------------------------------------------===//
#include "swift/AST/Mangle.h"
#include "swift/AST/ASTMangler.h"
#include "swift/SIL/SILDefaultWitnessTable.h"
#include "swift/SIL/SILModule.h"
#include "llvm/ADT/SmallString.h"
@@ -100,12 +100,8 @@ convertToDefinition(ArrayRef<Entry> entries) {
}
Identifier SILDefaultWitnessTable::getIdentifier() const {
std::string name;
{
Mangle::Mangler mangler;
mangler.mangleType(getProtocol()->getDeclaredType(), /*uncurry*/ 0);
name = mangler.finalize();
}
std::string name = NewMangling::mangleTypeAsUSR(
getProtocol()->getDeclaredType());
return Mod.getASTContext().getIdentifier(name);
}