This is an archive of the discontinued LLVM Phabricator instance.

[Clangd] ExtractFunction Added checks for broken control flow
ClosedPublic

Authored by SureYeaah on Aug 26 2019, 4:20 AM.

Event Timeline

SureYeaah created this revision.Aug 26 2019, 4:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 26 2019, 4:20 AM
SureYeaah updated this revision to Diff 217865.Aug 29 2019, 6:57 AM

Removed selectionTree Visitor

SureYeaah edited the summary of this revision. (Show Details)Aug 29 2019, 6:58 AM
SureYeaah updated this revision to Diff 217881.Aug 29 2019, 7:50 AM

Added null statement check in TraverseStmt

sammccall accepted this revision.Aug 30 2019, 1:22 AM
sammccall added inline comments.
clang-tools-extra/clangd/refactor/tweaks/ExtractFunction.cpp
437

rather than writing this twice, take an int Increment parameter?

462

(NumberOfLoops > 0 || NumberOfSwitch = 0)

479

NestedLoops would be clearer I think

clang-tools-extra/clangd/unittests/TweakTests.cpp
523

please add these to a new test case e.g. TEST_F(ExtractFunctionTest, ControlFlow) to avoid each getting too long

This revision is now accepted and ready to land.Aug 30 2019, 1:22 AM
SureYeaah updated this revision to Diff 218053.Aug 30 2019, 2:56 AM
SureYeaah marked 4 inline comments as done.

Addressed review comments

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptAug 30 2019, 2:56 AM