[PATCH] D64717: [Clangd] Fixed ExtractVariable for MemberExprs and Assignment Exprs

Shaurya Gupta via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 18 06:27:32 PDT 2019


SureYeaah marked 5 inline comments as done.
SureYeaah added inline comments.


================
Comment at: clang-tools-extra/clangd/refactor/tweaks/ExtractVariable.cpp:208
   const SelectionTree::Node *N = Inputs.ASTSelection.commonAncestor();
-  if (!N)
-    return false;
-  Target = llvm::make_unique<ExtractionContext>(N, SM, Ctx);
-  return Target->isExtractable();
+  computeExtractionContext(N, SM, Ctx);
+  return Target && Target->InsertionPoint;
----------------
kadircet wrote:
> maybe instead of checking internals like `Target` just make `computeExtractionContext` return an `llvm::Error` and check for success?
Should it instead return a bool since there's actually no error?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64717/new/

https://reviews.llvm.org/D64717





More information about the cfe-commits mailing list