[cfe-commits] [PATCH] Update users of RefactoringTool

Edwin Vane edwin.vane at intel.com
Thu Jan 10 06:41:59 PST 2013


Hi klimek,

RefactoringTool::run() no longer writes changes to disk automatically. Updating users of RefactoringTool to explicitly perform the write.

http://llvm-reviews.chandlerc.com/D279

Files:
  cpp11-migrate/LoopConvert/LoopConvert.cpp
  remove-cstr-calls/RemoveCStrCalls.cpp

Index: cpp11-migrate/LoopConvert/LoopConvert.cpp
===================================================================
--- cpp11-migrate/LoopConvert/LoopConvert.cpp
+++ cpp11-migrate/LoopConvert/LoopConvert.cpp
@@ -58,6 +58,11 @@
     return result;
   }
 
+  if (int result = LoopTool.saveRewrittenFiles()) {
+    llvm::errs() << "Failed to write results to disk.\n";
+    return result;
+  }
+
   if (AcceptedChanges > 0) {
     setChangesMade();
   }
Index: remove-cstr-calls/RemoveCStrCalls.cpp
===================================================================
--- remove-cstr-calls/RemoveCStrCalls.cpp
+++ remove-cstr-calls/RemoveCStrCalls.cpp
@@ -232,5 +232,10 @@
                   callee(methodDecl(hasName(StringCStrMethod))),
                   on(id("arg", expr())))))),
       &Callback);
-  return Tool.run(newFrontendActionFactory(&Finder));
+  if (Tool.run(newFrontendActionFactory(&Finder)) != 0) {
+    return 1;
+  }
+  if (Tool.saveRewrittenFiles() != 0) {
+    return 1;
+  }
 }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D279.1.patch
Type: text/x-patch
Size: 999 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130110/7b757dc2/attachment.bin>


More information about the cfe-commits mailing list