[PATCH] D63773: [clangd] dummy variable extraction on a function scope
Shaurya Gupta via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 27 10:54:03 PDT 2019
SureYeaah marked 14 inline comments as done.
SureYeaah added inline comments.
================
Comment at: clang-tools-extra/clangd/refactor/tweaks/ExtractVariable.cpp:173
+ // give up if extraction will take a variable out of scope
+ if (!extractionAllowed(ParStmt, N, M))
+ break;
----------------
sammccall wrote:
> here you're traversing the whole Expr to find the referenced decls at each iteration of this loop.
> Can you analyse the expr just once, and reuse the list of decls?
I thought it'll only be analyzed once but actually it's at max twice in the case where the selected expression is a part of a DeclStmt in the <Init> of a ForStmt.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D63773/new/
https://reviews.llvm.org/D63773
More information about the cfe-commits
mailing list