Skip to content

Commit ece3634

Browse files
authored
Merge pull request #23249 from eeckstein/runtime-malloc-removal2
Avoid malloc allocations in the runtime, part 2
2 parents 875cd65 + c6abbfa commit ece3634

File tree

6 files changed

+579
-728
lines changed

6 files changed

+579
-728
lines changed

include/swift/Demangling/Demangle.h

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -484,11 +484,6 @@ enum class OperatorKind {
484484
Infix,
485485
};
486486

487-
/// Mangle an identifier using Swift's mangling rules.
488-
void mangleIdentifier(const char *data, size_t length,
489-
OperatorKind operatorKind, std::string &out,
490-
bool usePunycode = true);
491-
492487
/// Remangle a demangled parse tree.
493488
std::string mangleNode(NodePointer root);
494489

@@ -511,9 +506,20 @@ llvm::StringRef mangleNode(NodePointer root, SymbolicResolver resolver,
511506
/// Remangle in the old mangling scheme.
512507
///
513508
/// This is only used for objc-runtime names.
514-
/// If \p BorrowFrom is specified, the initial bump pointer memory is
515-
/// borrowed from the free memory of BorrowFrom.
516-
std::string mangleNodeOld(NodePointer root, NodeFactory *BorrowFrom = nullptr);
509+
std::string mangleNodeOld(NodePointer root);
510+
511+
/// Remangle in the old mangling scheme.
512+
///
513+
/// This is only used for objc-runtime names.
514+
/// The returned string is owned by \p Factory. This means \p Factory must stay
515+
/// alive as long as the returned string is used.
516+
llvm::StringRef mangleNodeOld(NodePointer node, NodeFactory &Factory);
517+
518+
/// Remangle in the old mangling scheme and embed the name in "_Tt<name>_".
519+
///
520+
/// The returned string is null terminated and owned by \p Factory. This means
521+
/// \p Factory must stay alive as long as the returned string is used.
522+
const char *mangleNodeAsObjcCString(NodePointer node, NodeFactory &Factory);
517523

518524
/// Transform the node structure to a string.
519525
///

0 commit comments

Comments
 (0)