mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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.
1.8 KiB
1.8 KiB