[PATCH] D157010: [llvm][ADT] Make `Twine` aware of `StringLiteral`
Jan Svoboda via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 3 10:10:49 PDT 2023
jansvoboda11 added a comment.
I don't think so. The use-case I'm thinking of is having a bunch of `const Twine &` objects and wanting to create a `SmallVector<const char *>` with lifetime that's independent from the strings referenced by the `Twine` objects (using `StringSaver` for example). Knowing that the `Twine` refers to single `const char *` with static lifetime would allow you to safely skip saving/allocating the string buffer. You can't skip that for `std::string`, since that might deallocate its buffer. Does that make sense?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D157010/new/
https://reviews.llvm.org/D157010
More information about the llvm-commits
mailing list