Skip to content

Commit b76a58a

Browse files
committed
[Mangler] Simplify the mangling into a stream. NFC.
This is a tiny cleanup that makes it easier to add the compression/decompression layers.
1 parent bfb1f9a commit b76a58a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

include/swift/AST/Mangle.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,8 @@ class Mangler {
9999
/// Finish the mangling of the symbol and write the mangled name into
100100
/// \p stream.
101101
void finalize(llvm::raw_ostream &stream) {
102-
assert(Storage.size() && "Mangling an empty name");
103-
stream.write(Storage.data(), Storage.size());
104-
Storage.clear();
102+
std::string result = finalize();
103+
stream.write(result.data(), result.size());
105104
}
106105

107106
void setModuleContext(ModuleDecl *M) { Mod = M; }

0 commit comments

Comments
 (0)