Skip to content

Commit

Permalink
Merge pull request #23249 from eeckstein/runtime-malloc-removal2
Browse files Browse the repository at this point in the history
Avoid malloc allocations in the runtime, part 2
  • Loading branch information
eeckstein authored Mar 14, 2019
2 parents 875cd65 + c6abbfa commit ece3634
Show file tree
Hide file tree
Showing 6 changed files with 579 additions and 728 deletions.
22 changes: 14 additions & 8 deletions include/swift/Demangling/Demangle.h
Original file line number Diff line number Diff line change
Expand Up @@ -484,11 +484,6 @@ enum class OperatorKind {
Infix,
};

/// Mangle an identifier using Swift's mangling rules.
void mangleIdentifier(const char *data, size_t length,
OperatorKind operatorKind, std::string &out,
bool usePunycode = true);

/// Remangle a demangled parse tree.
std::string mangleNode(NodePointer root);

Expand All @@ -511,9 +506,20 @@ llvm::StringRef mangleNode(NodePointer root, SymbolicResolver resolver,
/// Remangle in the old mangling scheme.
///
/// This is only used for objc-runtime names.
/// If \p BorrowFrom is specified, the initial bump pointer memory is
/// borrowed from the free memory of BorrowFrom.
std::string mangleNodeOld(NodePointer root, NodeFactory *BorrowFrom = nullptr);
std::string mangleNodeOld(NodePointer root);

/// Remangle in the old mangling scheme.
///
/// This is only used for objc-runtime names.
/// The returned string is owned by \p Factory. This means \p Factory must stay
/// alive as long as the returned string is used.
llvm::StringRef mangleNodeOld(NodePointer node, NodeFactory &Factory);

/// Remangle in the old mangling scheme and embed the name in "_Tt<name>_".
///
/// The returned string is null terminated and owned by \p Factory. This means
/// \p Factory must stay alive as long as the returned string is used.
const char *mangleNodeAsObjcCString(NodePointer node, NodeFactory &Factory);

/// Transform the node structure to a string.
///
Expand Down
Loading

0 comments on commit ece3634

Please sign in to comment.