Skip to content

Commit a27822d

Browse files
committed
ASTMangler: add a little utility function to create a mangled name for _typeName constant propagation.
1 parent b42bce4 commit a27822d

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

include/swift/AST/ASTMangler.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,9 @@ class ASTMangler : public Mangler {
213213

214214
std::string mangleTypeForDebugger(Type decl, const DeclContext *DC);
215215

216+
/// Create a mangled name to be used for _typeName constant propagation.
217+
std::string mangleTypeForTypeName(Type type);
218+
216219
std::string mangleOpaqueTypeDescriptor(const OpaqueTypeDecl *decl);
217220

218221
std::string mangleDeclType(const ValueDecl *decl);

lib/AST/ASTMangler.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,12 @@ std::string ASTMangler::mangleTypeForDebugger(Type Ty, const DeclContext *DC) {
533533
return finalize();
534534
}
535535

536+
std::string ASTMangler::mangleTypeForTypeName(Type type) {
537+
beginMangling();
538+
appendType(type);
539+
return finalize();
540+
}
541+
536542
std::string ASTMangler::mangleDeclType(const ValueDecl *decl) {
537543
DWARFMangling = true;
538544
beginMangling();

0 commit comments

Comments
 (0)