r240984 - More range-based for loops. NFC

Douglas Katzman dougk at google.com
Mon Jun 29 12:12:57 PDT 2015


Author: dougk
Date: Mon Jun 29 14:12:56 2015
New Revision: 240984

URL: http://llvm.org/viewvc/llvm-project?rev=240984&view=rev
Log:
More range-based for loops. NFC

Modified:
    cfe/trunk/lib/Driver/Tools.cpp

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=240984&r1=240983&r2=240984&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Mon Jun 29 14:12:56 2015
@@ -1782,8 +1782,8 @@ static bool DecodeAArch64Features(const
   SmallVector<StringRef, 8> Split;
   text.split(Split, StringRef("+"), -1, false);
 
-  for (unsigned I = 0, E = Split.size(); I != E; ++I) {
-    const char *result = llvm::StringSwitch<const char *>(Split[I])
+  for (const StringRef Feature : Split) {
+    const char *result = llvm::StringSwitch<const char *>(Feature)
                              .Case("fp", "+fp-armv8")
                              .Case("simd", "+neon")
                              .Case("crc", "+crc")
@@ -1795,7 +1795,7 @@ static bool DecodeAArch64Features(const
                              .Default(nullptr);
     if (result)
       Features.push_back(result);
-    else if (Split[I] == "neon" || Split[I] == "noneon")
+    else if (Feature == "neon" || Feature == "noneon")
       D.Diag(diag::err_drv_no_neon_modifier);
     else
       return false;
@@ -5652,10 +5652,8 @@ static void constructHexagonLinkArgs(Com
     CmdArgs.push_back("--start-group");
 
     if (!buildingLib) {
-      for (std::vector<std::string>::iterator i = oslibs.begin(),
-                                              e = oslibs.end();
-           i != e; ++i)
-        CmdArgs.push_back(Args.MakeArgString("-l" + *i));
+      for (const std::string &Lib : oslibs)
+        CmdArgs.push_back(Args.MakeArgString("-l" + Lib));
       CmdArgs.push_back("-lc");
     }
     CmdArgs.push_back("-lgcc");





More information about the cfe-commits mailing list