[PATCH] D12631: Avoid repeated replacements on loop-convert check.

Manuel Klimek via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 4 09:08:27 PDT 2015


klimek added inline comments.

================
Comment at: clang-tidy/modernize/LoopConvertUtils.cpp:465
@@ +464,3 @@
+  SourceLocation Begin = U.Range.getBegin();
+  while (Begin.isMacroID())
+    Begin = Context->getSourceManager().getExpansionLoc(Begin);
----------------
There should be no need for a while() getExpansionLoc should always go to the most expanded location location.

================
Comment at: clang-tidy/modernize/LoopConvertUtils.h:280-281
@@ -279,1 +279,4 @@
 
+  /// \brief Returns true and adds the Usage if it was not added before.
+  bool addUsage(const Usage &U);
+
----------------
The result seems to be never used?

================
Comment at: clang-tidy/modernize/LoopConvertUtils.h:342
@@ -338,2 +341,3 @@
   UsageResult Usages;
+  llvm::SmallSet<SourceLocation, 8> UsageSet;
   bool OnlyUsedAsIndex;
----------------
I don't think putting Set into the name helps. UsageLocations perhaps?


http://reviews.llvm.org/D12631





More information about the cfe-commits mailing list