Skip to content

Commit abccbd8

Browse files
committed
runtime: make the old remangler allocation free.
Extract common code from the old and new remangler into a common base class. This lets the old remangler benefit from the changes I did recently in the new remangler.
1 parent 708b2ac commit abccbd8

File tree

6 files changed

+501
-509
lines changed

6 files changed

+501
-509
lines changed

include/swift/Demangling/Demangle.h

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -506,9 +506,20 @@ llvm::StringRef mangleNode(NodePointer root, SymbolicResolver resolver,
506506
/// Remangle in the old mangling scheme.
507507
///
508508
/// This is only used for objc-runtime names.
509-
/// If \p BorrowFrom is specified, the initial bump pointer memory is
510-
/// borrowed from the free memory of BorrowFrom.
511-
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);
512523

513524
/// Transform the node structure to a string.
514525
///

0 commit comments

Comments
 (0)