diff options
author | Utkarsh Saxena <usx@google.com> | 2024-11-13 11:07:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-13 11:07:20 +0100 |
commit | 3e20bae827c0a314142fea74aa3d7ead039fab3d (patch) | |
tree | 746771e7e881f92e5cbcdf511bb2abbca1d4186e /libcxx/src/filesystem/path.cpp | |
parent | 2a1586dfb5a304830301cfcce8bd7d520b9d5a49 (diff) | |
download | llvm-3e20bae827c0a314142fea74aa3d7ead039fab3d.zip llvm-3e20bae827c0a314142fea74aa3d7ead039fab3d.tar.gz llvm-3e20bae827c0a314142fea74aa3d7ead039fab3d.tar.bz2 |
Reapply "[clang] Introduce [[clang::lifetime_capture_by(X)]] (#115823)
Fix compile time regression and memory leak
In the previous change, we saw:
- Memory leak: https://lab.llvm.org/buildbot/#/builders/169/builds/5193
- 0.5% Compile time regression
[link](https://llvm-compile-time-tracker.com/compare.php?from=4a68e4cbd2423dcacada8162ab7c4bb8d7f7e2cf&to=8c4331c1abeb33eabf3cdbefa7f2b6e0540e7f4f&stat=instructions:u)
For compile time regression, we make the Param->Idx `StringMap` for
**all** functions. This `StringMap` is expensive and should not be
computed when none of the params are annotated with
`[[clang::lifetime_capture_by(X)]]`.
For the memory leak, the small vectors used in Attribute are not
destroyed because the attributes are allocated through ASTContext's
allocator. We therefore need a raw array in this case.
Diffstat (limited to 'libcxx/src/filesystem/path.cpp')
0 files changed, 0 insertions, 0 deletions