diff options
author | Sam McCall <sam.mccall@gmail.com> | 2022-01-11 00:09:58 +0100 |
---|---|---|
committer | Sam McCall <sam.mccall@gmail.com> | 2022-01-13 13:58:42 +0100 |
commit | 2b2dbe6126f8c016e0cbef45a6d22e1359ce39fd (patch) | |
tree | bf988fc5a13d35bbedf1b3ac49ec1a41d0f40deb /llvm/lib/Object/TapiFile.cpp | |
parent | a9bf32763d3929672fe243f84e6a103c91260ef0 (diff) | |
download | llvm-2b2dbe6126f8c016e0cbef45a6d22e1359ce39fd.zip llvm-2b2dbe6126f8c016e0cbef45a6d22e1359ce39fd.tar.gz llvm-2b2dbe6126f8c016e0cbef45a6d22e1359ce39fd.tar.bz2 |
[clangd] Selection: Prune gtest TEST()s earlier
When searching for AST nodes that may overlap the selection, mayHit() was only
attempting to prune nodes whose begin/end are both in the main file.
While failing to prune never gives wrong results, it hurts performance.
In GTest unit-tests, `TEST()` macros at the top level declare classes.
These were never pruned and we traversed *every* such class for any selection.
We fix this by reasoning about what tokens such a node might claim.
They must lie within its ultimate macro expansion range, so if this doesn't
overlap with the selection, we can prune the node.
Differential Revision: https://reviews.llvm.org/D116978
Diffstat (limited to 'llvm/lib/Object/TapiFile.cpp')
0 files changed, 0 insertions, 0 deletions