This revision was automatically updated to reflect the committed changes.
Closed by commit rGe09aa0d192e0: [clangd][Tweak] Make sure enclosing function
doesnt have invalid children (authored by kadircet).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D135257/new/
https://reviews.llvm.org/D135257
Files:
clang-tools-extra/clangd/refactor/tweaks/ExtractFunction.cpp
Index: clang-tools-extra/clangd/refactor/tweaks/ExtractFunction.cpp
===================================================================
--- clang-tools-extra/clangd/refactor/tweaks/ExtractFunction.cpp
+++ clang-tools-extra/clangd/refactor/tweaks/ExtractFunction.cpp
@@ -248,6 +248,13 @@
// FIXME: Support extraction from templated functions.
if (Func->isTemplated())
return nullptr;
+ for (const auto *S : Func->getBody()->children()) {
+ // During apply phase, we perform semantic analysis (e.g. figure out
+ // what variables requires hoisting). We cannot perform those when the
+ // body has invalid statements, so fail up front.
+ if (!S)
+ return nullptr;
+ }
return Func;
}
}
Index: clang-tools-extra/clangd/refactor/tweaks/ExtractFunction.cpp
===================================================================
--- clang-tools-extra/clangd/refactor/tweaks/ExtractFunction.cpp
+++ clang-tools-extra/clangd/refactor/tweaks/ExtractFunction.cpp
@@ -248,6 +248,13 @@
// FIXME: Support extraction from templated functions.
if (Func->isTemplated())
return nullptr;
+ for (const auto *S : Func->getBody()->children()) {
+ // During apply phase, we perform semantic analysis (e.g. figure out
+ // what variables requires hoisting). We cannot perform those when the
+ // body has invalid statements, so fail up front.
+ if (!S)
+ return nullptr;
+ }
return Func;
}
}
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits