[cfe-commits] r138674 - in /cfe/trunk: lib/ARCMigrate/FileRemapper.cpp test/ARCMT/migrate-space-in-path.m

Argyrios Kyrtzidis akyrtzi at gmail.com
Fri Aug 26 16:20:23 PDT 2011


Author: akirtzidis
Date: Fri Aug 26 18:20:23 2011
New Revision: 138674

URL: http://llvm.org/viewvc/llvm-project?rev=138674&view=rev
Log:
[arcmt] Add a test case for r138671 and improve the loop.

Added:
    cfe/trunk/test/ARCMT/migrate-space-in-path.m
Modified:
    cfe/trunk/lib/ARCMigrate/FileRemapper.cpp

Modified: cfe/trunk/lib/ARCMigrate/FileRemapper.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/FileRemapper.cpp?rev=138674&r1=138673&r2=138674&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/FileRemapper.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/FileRemapper.cpp Fri Aug 26 18:20:23 2011
@@ -68,8 +68,7 @@
   SmallVector<StringRef, 64> lines;
   fileBuf->getBuffer().split(lines, "\n");
 
-  unsigned idx = 0;
-  while (idx+3 <= lines.size()) {
+  for (unsigned idx = 0; idx+3 <= lines.size(); idx += 3) {
     std::string fromFilename = lines[idx];
     uint64_t timeModified;
     lines[idx+1].getAsInteger(10, timeModified);
@@ -95,8 +94,6 @@
     }
 
     pairs.push_back(std::make_pair(origFE, newFE));
-
-    idx += 3;
   }
 
   for (unsigned i = 0, e = pairs.size(); i != e; ++i)

Added: cfe/trunk/test/ARCMT/migrate-space-in-path.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/migrate-space-in-path.m?rev=138674&view=auto
==============================================================================
--- cfe/trunk/test/ARCMT/migrate-space-in-path.m (added)
+++ cfe/trunk/test/ARCMT/migrate-space-in-path.m Fri Aug 26 18:20:23 2011
@@ -0,0 +1,7 @@
+// RUN: mkdir -p %t/"with space"
+// RUN: cp %S/Inputs/* %t/"with space"
+// RUN: %clang_cc1 -arcmt-migrate -arcmt-migrate-directory %t.migrate %t/"with space"/test1.m.in -x objective-c -fobjc-nonfragile-abi
+// RUN: %clang_cc1 -arcmt-migrate -arcmt-migrate-directory %t.migrate %t/"with space"/test2.m.in -x objective-c -fobjc-nonfragile-abi
+// RUN: c-arcmt-test -arcmt-migrate-directory %t.migrate | arcmt-test -verify-transformed-files %t/"with space"/test1.m.in.result %t/"with space"/test2.m.in.result %t/"with space"/test.h.result
+// RUN: rm -rf %t.migrate
+// RUN: rm -rf %t





More information about the cfe-commits mailing list