[PATCH] D39706: [refactor][extract] Initial implementation of variable captures
Eric Liu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 10 10:13:06 PST 2017
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/CaptureVariables.h:36
+ explicit CapturedExtractedEntity(const VarDecl *VD)
+ : Kind(CapturedVarDecl), VD(VD) {}
+
----------------
arphaman wrote:
> ioeric wrote:
> > Maybe a `FIXME` here for `Kind`?
> I think this constructor will always set the same kind.
Then why do you need `Kind`? Is it changed somewhere else? Please document the behavior,
================
Comment at: lib/Tooling/Refactoring/Extract/CaptureVariables.h:28
+/// passed to the extracted function as an argument.
+class CapturedExtractedEntity {
+ enum EntityKind {
----------------
The name is a bit hard to parse. Maybe just `CapturedEntity` or simply `CapturedVar`?
Repository:
rL LLVM
https://reviews.llvm.org/D39706
More information about the cfe-commits
mailing list