Skip to content

Commit 5e6c5a7

Browse files
committed
Mangling: Let the demangler handle the new mangling scheme
1 parent 9f8b68a commit 5e6c5a7

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

lib/Basic/Demangle.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616

1717
#include "swift/Basic/Demangle.h"
1818
#include "swift/Basic/Fallthrough.h"
19+
#ifndef NO_NEW_DEMANGLING
20+
#include "swift/Basic/Demangler.h"
21+
#include "swift/Basic/ManglingMacros.h"
22+
#endif
1923
#include "swift/Strings.h"
2024
#include "swift/Basic/LLVM.h"
2125
#include "swift/Basic/Punycode.h"

stdlib/public/Reflection/Demangle.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
#define NO_NEW_DEMANGLING
14+
1315
#include "../../../lib/Basic/Demangle.cpp"
16+
#include "../../../lib/Basic/ManglingUtils.cpp"
1417
#include "../../../lib/Basic/Punycode.cpp"
1518
#include "../../../lib/Basic/PunycodeUTF8.cpp"

stdlib/public/runtime/Demangle.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
#define NO_NEW_DEMANGLING
14+
1315
#include "../../../lib/Basic/Demangle.cpp"
16+
#include "../../../lib/Basic/ManglingUtils.cpp"
1417
#include "../../../lib/Basic/Punycode.cpp"
1518
#include "swift/Runtime/Metadata.h"
1619
#include "Private.h"

tools/swift-demangle/swift-demangle.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
//===----------------------------------------------------------------------===//
1616

1717
#include "swift/Basic/DemangleWrappers.h"
18+
#include "swift/Basic/ManglingMacros.h"
1819
#include "llvm/ADT/SmallString.h"
1920
#include "llvm/Support/CommandLine.h"
2021
#include "llvm/Support/MemoryBuffer.h"
@@ -104,7 +105,7 @@ static void demangle(llvm::raw_ostream &os, llvm::StringRef name,
104105

105106
static int demangleSTDIN(const swift::Demangle::DemangleOptions &options) {
106107
// This doesn't handle Unicode symbols, but maybe that's okay.
107-
llvm::Regex maybeSymbol("_T[_a-zA-Z0-9$]+");
108+
llvm::Regex maybeSymbol("(_T|" MANGLING_PREFIX_STR ")[_a-zA-Z0-9$]+");
108109

109110
while (true) {
110111
char *inputLine = NULL;

0 commit comments

Comments
 (0)