[PATCH] D69237: Refactor getDeclAtPosition() to use SelectionTree + targetDecl()
Nathan Ridge via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Oct 26 20:36:08 PDT 2019
nridge added a comment.
In D69237#1722399 <https://reviews.llvm.org/D69237#1722399>, @nridge wrote:
> So, to summarize my understanding of the way forward here:
>
> 1. Land the refactoring without any constructor targeting (i.e. the current patch, which is ready to review in this state).
> 2. In a follow-up patch: target constructor in cases where this can be accomplished by having SelectionTree expose the CXXConstructorExpr on the parenthesis.
While trying to implement #2, I realized that SelectionTree already has this behaviour (exposes CXXConstructorExpr on the parenthesis), we just weren't benefitting from it because `locateSymbolAt()` was passing in the beginning-of-identifier location to `getDeclAtPosition()`, so `Foo^(arg)` and `F^oo(arg)` would yield the same result.
The updated patch fixes this and updates the tests to reflect the constructor targeting in cases where it now works.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69237/new/
https://reviews.llvm.org/D69237
More information about the cfe-commits
mailing list