[PATCH] D12734: Another patch for modernize-loop-convert.

Manuel Klimek via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 10 03:07:41 PDT 2015


klimek added inline comments.

================
Comment at: clang-tidy/modernize/LoopConvertUtils.cpp:765-766
@@ -764,2 +764,4 @@
       // exactly one usage.
-      addUsage(Usage(nullptr, false, C->getLocation()));
+      // We are using the 'IsArrow' field of Usage to store if we have to add
+      // a '&' to capture the element by reference.
+      addUsage(
----------------
I think when the comment is on the Usage member, it's fine to delete it here, as it'll only get out of sync.

================
Comment at: clang-tidy/modernize/LoopConvertUtils.h:203-206
@@ -200,2 +202,6 @@
   const Expr *Expression;
+  // Indicates whether this is an access to a member through the arrow operator
+  // on pointers or iterators. In case of lambda captures, it indicates whether
+  // the capture was done by value.
   bool IsArrow;
+  // Range that covers this usage.
----------------
I think this now really needs a different name, or we should put it into an enum if we can't find a good bool name that fits both the lambda capture and member expression case.


http://reviews.llvm.org/D12734





More information about the cfe-commits mailing list