mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -21,6 +21,7 @@
|
||||
#include "swift/AST/LinkLibrary.h"
|
||||
#include "swift/AST/Mangle.h"
|
||||
#include "swift/AST/ProtocolConformance.h"
|
||||
#include "swift/AST/ASTMangler.h"
|
||||
#include "swift/AST/RawComment.h"
|
||||
#include "swift/AST/USRGeneration.h"
|
||||
#include "swift/Basic/Dwarf.h"
|
||||
@@ -4197,10 +4198,8 @@ void Serializer::writeAST(ModuleOrSourceFile DC) {
|
||||
|
||||
for (auto TD : localTypeDecls) {
|
||||
hasLocalTypes = true;
|
||||
|
||||
Mangle::Mangler DebugMangler(false);
|
||||
DebugMangler.mangleType(TD->getDeclaredInterfaceType(), 0);
|
||||
auto MangledName = DebugMangler.finalize();
|
||||
std::string MangledName = NewMangling::mangleTypeAsUSR(
|
||||
TD->getDeclaredInterfaceType());
|
||||
assert(!MangledName.empty() && "Mangled type came back empty!");
|
||||
localTypeGenerator.insert(MangledName, {
|
||||
addDeclRef(TD), TD->getLocalDiscriminator()
|
||||
|
||||
Reference in New Issue
Block a user