[PATCH] D39706: [refactor][extract] Initial implementation of variable captures

2017-11-27 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added a comment. This revision is now accepted and ready to land. Lg (Sorry for losing track of this and the delay!) Repository: rL LLVM https://reviews.llvm.org/D39706 ___ cfe-commits mailing list cfe-commi

[PATCH] D39706: [refactor][extract] Initial implementation of variable captures

2017-11-10 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 122565. arphaman marked 3 inline comments as done. arphaman added a comment. Address review comments Repository: rL LLVM https://reviews.llvm.org/D39706 Files: lib/Tooling/Refactoring/CMakeLists.txt lib/Tooling/Refactoring/Extract/CaptureVariables.c

[PATCH] D39706: [refactor][extract] Initial implementation of variable captures

2017-11-10 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: lib/Tooling/Refactoring/Extract/CaptureVariables.h:36 + explicit CapturedExtractedEntity(const VarDecl *VD) + : Kind(CapturedVarDecl), VD(VD) {} + ioeric wrote: > arphaman wrote: > > ioeric wrote: > > > Maybe a `F

[PATCH] D39706: [refactor][extract] Initial implementation of variable captures

2017-11-10 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: lib/Tooling/Refactoring/Extract/CaptureVariables.cpp:97 + } + llvm_unreachable("invalid kind!"); +} A more informative message would be better. Comment at: lib/Tooling/Refactoring/Extract/CaptureVaria

[PATCH] D39706: [refactor][extract] Initial implementation of variable captures

2017-11-09 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 122270. arphaman marked 5 inline comments as done. arphaman added a comment. Address review comments Repository: rL LLVM https://reviews.llvm.org/D39706 Files: lib/Tooling/Refactoring/CMakeLists.txt lib/Tooling/Refactoring/Extract/CaptureVariables.c

[PATCH] D39706: [refactor][extract] Initial implementation of variable captures

2017-11-09 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: lib/Tooling/Refactoring/Extract/CaptureVariables.cpp:36 + return true; +// FIXME: Capture 'self'. +if (!VD->isLocalVarDeclOrParm()) ioeric wrote: > and `this`? This is a different kind of expression that wo

[PATCH] D39706: [refactor][extract] Initial implementation of variable captures

2017-11-08 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Implementation looks good. Just some nits. Comment at: lib/Tooling/Refactoring/Extract/CaptureVariables.cpp:36 + return true; +// FIXME: Capture 'self'. +if (!VD->isLocalVarDeclOrParm()) and `this`? Commen

[PATCH] D39706: [refactor][extract] Initial implementation of variable captures

2017-11-06 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman created this revision. Herald added a subscriber: mgorny. This patch adds an initial rudimentary support for capturing variables that should be passed to the extracted function. The variables are passed to the extracted function if they're used in the extracted code. If they're defined