Skip to content

Commit 0cd7e12

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 0b1f984 commit 0cd7e12

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
@@ -907,6 +907,7 @@ swift::_swift_buildDemanglingForMetadata(const Metadata *type,
907907
/// \returns the demangled name. Returns nullptr if the input String is not a
908908
/// Swift mangled name.
909909
SWIFT_RUNTIME_EXPORT
910+
SWIFT_CC(swift)
910911
char *swift_demangle(const char *mangledName,
911912
size_t mangledNameLength,
912913
char *outputBuffer,

0 commit comments

Comments
 (0)