aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorJan Svoboda <jan_svoboda@apple.com>2023-08-03 10:15:01 -0700
committerJan Svoboda <jan_svoboda@apple.com>2023-08-03 11:12:05 -0700
commitefcb07bf6e5fb0ff12e5855ab0ad86cd534d5578 (patch)
tree2ed9ee5149d430bd46153f2ed0c11d342be37c85 /clang/lib/Frontend/CompilerInvocation.cpp
parent43dfe0f08ecaf50f986512d0548bd3ac84d1813b (diff)
downloadllvm-efcb07bf6e5fb0ff12e5855ab0ad86cd534d5578.zip
llvm-efcb07bf6e5fb0ff12e5855ab0ad86cd534d5578.tar.gz
llvm-efcb07bf6e5fb0ff12e5855ab0ad86cd534d5578.tar.bz2
[llvm][Support] Avoid intermediate heap allocations in `StringSaver`
The `Twine::str()` function currently always allocates heap memory via `std::string`. However, some instances of `Twine` don't need an intermediate buffer at all, and the rest can attempt to print into a stack buffer first. This is intentionally not making use of `Twine::isSingleStringLiteral()` from D157010 to skip saving the string in the bump-pointer allocator, since the `StringSaver` documentation suggests that MUST happen for every given string. Reviewed By: benlangmuir Differential Revision: https://reviews.llvm.org/D157015
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions