Skip to content

Commit 0d89f02

Browse files
kateinoigakukunrunner
authored andcommitted
[test] Fix calling convention mismatch for swift_demangle
`test/stdlib/Runtime.swift.gyb` calls `swift_demangle` with the Swift calling convention, but the functions is defined with the C calling convention. But this does not cause a problem other than testing, and ideal fix would be to put `@_cdecl` on the function declared in Swift-side to choose the correct calling convention. `@cdecl` without body is not supported yet but discussed in https://forums.swift.org/t/formalizing-cdecl/40677
1 parent 5a79260 commit 0d89f02

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

stdlib/public/runtime/Demangle.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,7 @@ swift::_swift_buildDemanglingForMetadata(const Metadata *type,
829829
/// \returns the demangled name. Returns nullptr if the input String is not a
830830
/// Swift mangled name.
831831
SWIFT_RUNTIME_EXPORT
832+
SWIFT_CC(swift)
832833
char *swift_demangle(const char *mangledName,
833834
size_t mangledNameLength,
834835
char *outputBuffer,

0 commit comments

Comments
 (0)