Skip to content

Commit 55cb1e6

Browse files
authored
Merge pull request #6959 from eeckstein/remangle-new
2 parents e6c84d7 + e266466 commit 55cb1e6

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tools/swift-demangle/swift-demangle.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ static llvm::cl::opt<bool>
4848
RemangleMode("test-remangle",
4949
llvm::cl::desc("Remangle test mode (show the remangled string)"));
5050

51+
static llvm::cl::opt<bool>
52+
RemangleNew("remangle-new",
53+
llvm::cl::desc("Remangle the symbol with new mangling scheme"));
54+
5155
static llvm::cl::opt<bool>
5256
DisableSugar("no-sugar",
5357
llvm::cl::desc("No sugar mode (disable common language idioms such as ? and [] from the output)"));
@@ -104,6 +108,15 @@ static void demangle(llvm::raw_ostream &os, llvm::StringRef name,
104108
return;
105109
}
106110
if (!TreeOnly) {
111+
if (RemangleNew) {
112+
if (!pointer) {
113+
llvm::errs() << "Can't de-mangle " << name << '\n';
114+
exit(1);
115+
}
116+
std::string remangled = swift::Demangle::mangleNodeNew(pointer);
117+
llvm::outs() << remangled;
118+
return;
119+
}
107120
std::string string = swift::Demangle::nodeToString(pointer, options);
108121
if (!CompactMode)
109122
llvm::outs() << name << " ---> ";

0 commit comments

Comments
 (0)