Skip to content

Commit 71015c6

Browse files
authored
Merge pull request #78980 from eeckstein/fix-swift-demangle
swift-demangle: don't require the $-prefix for embedded symbols
2 parents aa0e3dc + 1f36fa5 commit 71015c6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

test/Demangle/demangle-embedded.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
; This is not really a Swift source file: -*- Text -*-
22

33
; RUN: echo '$e4main8MyStructV3fooyyFAA1XV_Tg5' | swift-demangle | %FileCheck %s
4+
; RUN: swift-demangle '$e4main8MyStructV3fooyyFAA1XV_Tg5' | %FileCheck %s
5+
; RUN: swift-demangle e4main8MyStructV3fooyyFAA1XV_Tg5 | %FileCheck %s
6+
47
; CHECK: generic specialization <main.X> of main.MyStruct.foo() -> ()

tools/swift-demangle/swift-demangle.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ int main(int argc, char **argv) {
441441
"is quoted or escaped.\n";
442442
continue;
443443
}
444-
if (!DemangleType && (name.starts_with("S") || name.starts_with("s"))) {
444+
if (!DemangleType && (name.starts_with("S") || name.starts_with("s") || name.starts_with("e"))) {
445445
std::string correctedName = std::string("$") + name.str();
446446
demangle(llvm::outs(), correctedName, DCtx, options);
447447
} else {

0 commit comments

Comments
 (0)