[all-commits] [llvm/llvm-project] 96f5cc: [clangd] Handle declarators more consistently in S...
Sam McCall via All-commits
all-commits at lists.llvm.org
Wed Jan 5 06:41:07 PST 2022
Author: Sam McCall <sam.mccall at gmail.com>
Date: 2022-01-05 (Wed, 05 Jan 2022)
[clangd] Handle declarators more consistently in Selection.
Because declarators nest inside-out, we logically need to claim tokens for
parent declarators logically before child ones.
This is the ultimate reason we had problems with DeclaratorDecl, ArrayType etc.
However actually changing the order of traversal is hard, especially for nodes
that have both declarator and non-declarator children.
Since there's only a few TypeLocs corresponding to declarators, we just
have them claim the exact tokens rather than rely on nesting.
This fixes handling of complex declarators, like
This avoids the need for the DeclaratorDecl early-claim hack, which is
Unfortunately the DeclaratorDecl early-claims were covering up an AST
anomaly around CXXConstructExpr, so we need to fix that up too.
Based on D116623 and D116618
Differential Revision: https://reviews.llvm.org/D116630
More information about the All-commits