[PATCH] D68245: [Clangd] ExtractFunction: Don't extract body of enclosing function.

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 1 02:36:02 PDT 2019


kadircet accepted this revision.
kadircet added a comment.
This revision is now accepted and ready to land.

LGTM, thanks



================
Comment at: clang-tools-extra/clangd/refactor/tweaks/ExtractFunction.cpp:231
+  if (const Stmt *S = Child->ASTNode.get<Stmt>())
+    if (EnclosingFunc->hasBody() && EnclosingFunc->getBody() == S)
+      return false;
----------------
I believe it is not possible to have an `EnclosingFunc` without a body at this point. Let's make it an assertion instead.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D68245





More information about the cfe-commits mailing list