summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/python_api
diff options
context:
space:
mode:
authorSam McCall <sam.mccall@gmail.com>2019-11-20 23:25:17 +0100
committerSam McCall <sam.mccall@gmail.com>2019-11-29 15:21:13 +0100
commit19daa21f841ad45290c923689ee3d25198651a4c (patch)
treebbe19d3995ce29e08684ff1d7f9cb204fed2d1e4 /lldb/packages/Python/lldbsuite/test/python_api
parent45c843de4eb8a0d2aa42543b4fcfefcbca4191d8 (diff)
downloadbcm5719-llvm-19daa21f841ad45290c923689ee3d25198651a4c.tar.gz
bcm5719-llvm-19daa21f841ad45290c923689ee3d25198651a4c.zip
[clangd] Rethink how SelectionTree deals with macros and #includes.
Summary: The exclusive-claim model is successful at resolving conflicts over tokens between parent/child or siblings. However claims at the spelled-token level do the wrong thing for macro expansions, where siblings can be equally associated with the macro invocation. Moreover, any model that only uses the endpoints in a range can fail when a macro invocation occurs inside the node. To address this, we use the existing TokenBuffer in more depth. Claims are expressed in terms of expanded tokens, so there is no need to worry about macros, includes etc. Once we know which expanded tokens were claimed, they are mapped onto spelled tokens for hit-testing. This mapping is fairly flexible, currently the handling of macros is pretty simple (map macro args onto spellings, other macro expansions onto the macro name token). This mapping is in principle token-by-token for correctness (though there's some batching for performance). The aggregation of the selection enum is now more principled as we need to be able to aggregate several hit-test results together. For simplicity i removed the ability to determine selectedness of TUDecl. (That was originally implemented in 90a5bf92ff97b1, but doesn't seem to be very important or worth the complexity any longer). The expandedTokens(SourceLocation) helper could be added locally, but seems to make sense on TokenBuffer. Fixes https://github.com/clangd/clangd/issues/202 Fixes https://github.com/clangd/clangd/issues/126 Reviewers: hokein Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits, ilya-biryukov Tags: #clang Differential Revision: https://reviews.llvm.org/D70512
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/python_api')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud