[clang-tools-extra] r209111 - Address review comments on r208954. No functional changes.

Daniel Jasper djasper at google.com
Mon May 19 00:23:03 PDT 2014


Author: djasper
Date: Mon May 19 02:23:03 2014
New Revision: 209111

URL: http://llvm.org/viewvc/llvm-project?rev=209111&view=rev
Log:
Address review comments on r208954. No functional changes.

Modified:
    clang-tools-extra/trunk/clang-tidy/misc/UseOverride.cpp

Modified: clang-tools-extra/trunk/clang-tidy/misc/UseOverride.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/UseOverride.cpp?rev=209111&r1=209110&r2=209111&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/UseOverride.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/UseOverride.cpp Mon May 19 02:23:03 2014
@@ -88,9 +88,9 @@ void UseOverride::check(const MatchFinde
     StringRef ReplacementText = "override ";
 
     if (Method->hasAttrs()) {
-      for (const clang::Attr *attr : Method->getAttrs()) {
-        if (!attr->isImplicit()) {
-          InsertLoc = Sources.getExpansionLoc(attr->getLocation());
+      for (const clang::Attr *A : Method->getAttrs()) {
+        if (!A->isImplicit()) {
+          InsertLoc = Sources.getExpansionLoc(A->getLocation());
           break;
         }
       }
@@ -117,11 +117,10 @@ void UseOverride::check(const MatchFinde
   }
 
   if (Method->isVirtualAsWritten()) {
-    for (unsigned i = 0, e = Tokens.size(); i != e; ++i) {
-      if (Tokens[i].is(tok::raw_identifier) &&
-          GetText(Tokens[i], Sources) == "virtual") {
+    for (Token Tok : Tokens) {
+      if (Tok.is(tok::raw_identifier) && GetText(Tok, Sources) == "virtual") {
         Diag << FixItHint::CreateRemoval(CharSourceRange::getTokenRange(
-            Tokens[i].getLocation(), Tokens[i].getLocation()));
+            Tok.getLocation(), Tok.getLocation()));
         break;
       }
     }





More information about the cfe-commits mailing list