|
24 | 24 | #include <cassert>
|
25 | 25 | #include <cstdint>
|
26 | 26 | #include "llvm/ADT/StringRef.h"
|
| 27 | +#include "swift/Runtime/Config.h" |
27 | 28 |
|
28 | 29 | namespace llvm {
|
29 | 30 | class raw_ostream;
|
@@ -528,4 +529,30 @@ llvm::StringRef makeSymbolicMangledNameStringRef(const char *base);
|
528 | 529 | } // end namespace Demangle
|
529 | 530 | } // end namespace swift
|
530 | 531 |
|
| 532 | +// NB: This function is not used directly in the Swift codebase, but is |
| 533 | +// exported for Xcode support and is used by the sanitizers. Please coordinate |
| 534 | +// before changing. |
| 535 | +// |
| 536 | +/// Demangles a Swift symbol name. |
| 537 | +/// |
| 538 | +/// \param mangledName is the symbol name that needs to be demangled. |
| 539 | +/// \param mangledNameLength is the length of the string that should be |
| 540 | +/// demangled. |
| 541 | +/// \param outputBuffer is the user provided buffer where the demangled name |
| 542 | +/// will be placed. If nullptr, a new buffer will be malloced. In that case, |
| 543 | +/// the user of this API is responsible for freeing the returned buffer. |
| 544 | +/// \param outputBufferSize is the size of the output buffer. If the demangled |
| 545 | +/// name does not fit into the outputBuffer, the output will be truncated and |
| 546 | +/// the size will be updated, indicating how large the buffer should be. |
| 547 | +/// \param flags can be used to select the demangling style. TODO: We should |
| 548 | +//// define what these will be. |
| 549 | +/// \returns the demangled name. Returns nullptr if the input String is not a |
| 550 | +/// Swift mangled name. |
| 551 | +SWIFT_RUNTIME_EXPORT |
| 552 | +char *swift_demangle(const char *mangledName, |
| 553 | + size_t mangledNameLength, |
| 554 | + char *outputBuffer, |
| 555 | + size_t *outputBufferSize, |
| 556 | + uint32_t flags); |
| 557 | + |
531 | 558 | #endif // SWIFT_DEMANGLING_DEMANGLE_H
|
0 commit comments