swift
446b7cc3 - [libSyntax] Add a reference counted version of OwnedString

Commit
7 years ago
[libSyntax] Add a reference counted version of OwnedString We cannot use unowned strings for token texts of incrementally parsed syntax trees since the source buffer to which reused nodes refer will have been freed for reused nodes. Always copying the token text whenever OwnedString is passed is too expensive. A reference counted copy of the string allows us to keep the token's string alive across incremental parses while eliminating unnecessary copies.
Author
Committer
Parents
Loading