Page MenuHomePhabricator

[clangd] Extract Function: add hoisting support
Needs ReviewPublic

Authored by 5chmidti on Nov 22 2022, 7:28 AM.

Details

Reviewers
sammccall
Summary

Adds support to hoist variables declared inside the selected region
and used afterwards back out of the extraced function for later use.
Uses the explicit variable type if only one decl needs hoisting,
otherwise pair or tuple with auto return type deduction
(requires c++14) and a structured binding (requires c++17) or
explicitly unpacking the variables with get<>.

Diff Detail

Event Timeline

5chmidti created this revision.Nov 22 2022, 7:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 22 2022, 7:28 AM
5chmidti requested review of this revision.Nov 22 2022, 7:28 AM
5chmidti updated this revision to Diff 477184.Nov 22 2022, 7:33 AM

Fixup: rm added includes

5chmidti updated this revision to Diff 477204.Nov 22 2022, 8:08 AM

Fix windows build by setting the c++ standard for the hoisting tests explicitly to c++17.

nridge added a subscriber: nridge.Nov 26 2022, 10:50 PM