kadircet added inline comments.

================
Comment at: clang-tools-extra/clangd/refactor/tweaks/ExtractFunction.cpp:611
+  // (Others are possible if there are conversions, but this seems clearest).
+  if (CapturedInfo.HasReturnStmt) {
+    // If the return is conditional, neither replacing the code with
----------------
sammccall wrote:
> kadircet wrote:
> > nit: early exits
> I'm not sure what this comment means, can you elaborate?
> (I do mean "sometimes returns and sometimes doesn't". Early-exits aren't a 
> problem, e.g. `if (x) return 1; return 2;` can be extracted.)
ah sorry, i was trying to imply usage of early exits in the code, i.e:

```
ExtractedFunc.ReturnType = EnclosingFunc.getParentASTContext().VoidTy;
if not HasReturnStmt
  return true;
if not AlwaysReturn
  return false;
.
.
.
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70569



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to