Skip to content

Commit ec9aa79

Browse files
authored
Merge pull request #39172 from akyrtzi/move-swift_demangle-off-header
[Demangle.h] Remove the `swift_demangle` declaration from `Demangle.h` since it's not needed there
2 parents dd32711 + 325d8b3 commit ec9aa79

File tree

2 files changed

+17
-27
lines changed

2 files changed

+17
-27
lines changed

include/swift/Demangling/Demangle.h

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include <cassert>
2525
#include <cstdint>
2626
#include "llvm/ADT/StringRef.h"
27-
#include "swift/Runtime/Config.h"
2827
#include "swift/Demangling/NamespaceMacros.h"
2928

3029
namespace llvm {
@@ -645,30 +644,4 @@ SWIFT_END_INLINE_NAMESPACE
645644
} // end namespace Demangle
646645
} // end namespace swift
647646

648-
// NB: This function is not used directly in the Swift codebase, but is
649-
// exported for Xcode support and is used by the sanitizers. Please coordinate
650-
// before changing.
651-
//
652-
/// Demangles a Swift symbol name.
653-
///
654-
/// \param mangledName is the symbol name that needs to be demangled.
655-
/// \param mangledNameLength is the length of the string that should be
656-
/// demangled.
657-
/// \param outputBuffer is the user provided buffer where the demangled name
658-
/// will be placed. If nullptr, a new buffer will be malloced. In that case,
659-
/// the user of this API is responsible for freeing the returned buffer.
660-
/// \param outputBufferSize is the size of the output buffer. If the demangled
661-
/// name does not fit into the outputBuffer, the output will be truncated and
662-
/// the size will be updated, indicating how large the buffer should be.
663-
/// \param flags can be used to select the demangling style. TODO: We should
664-
//// define what these will be.
665-
/// \returns the demangled name. Returns nullptr if the input String is not a
666-
/// Swift mangled name.
667-
SWIFT_RUNTIME_EXPORT
668-
char *swift_demangle(const char *mangledName,
669-
size_t mangledNameLength,
670-
char *outputBuffer,
671-
size_t *outputBufferSize,
672-
uint32_t flags);
673-
674647
#endif // SWIFT_DEMANGLING_DEMANGLE_H

stdlib/public/runtime/Demangle.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,23 @@ swift::_swift_buildDemanglingForMetadata(const Metadata *type,
684684
// NB: This function is not used directly in the Swift codebase, but is
685685
// exported for Xcode support and is used by the sanitizers. Please coordinate
686686
// before changing.
687+
//
688+
/// Demangles a Swift symbol name.
689+
///
690+
/// \param mangledName is the symbol name that needs to be demangled.
691+
/// \param mangledNameLength is the length of the string that should be
692+
/// demangled.
693+
/// \param outputBuffer is the user provided buffer where the demangled name
694+
/// will be placed. If nullptr, a new buffer will be malloced. In that case,
695+
/// the user of this API is responsible for freeing the returned buffer.
696+
/// \param outputBufferSize is the size of the output buffer. If the demangled
697+
/// name does not fit into the outputBuffer, the output will be truncated and
698+
/// the size will be updated, indicating how large the buffer should be.
699+
/// \param flags can be used to select the demangling style. TODO: We should
700+
//// define what these will be.
701+
/// \returns the demangled name. Returns nullptr if the input String is not a
702+
/// Swift mangled name.
703+
SWIFT_RUNTIME_EXPORT
687704
char *swift_demangle(const char *mangledName,
688705
size_t mangledNameLength,
689706
char *outputBuffer,

0 commit comments

Comments
 (0)