[llvm-commits] [llvm] r121385 - /llvm/trunk/utils/FileUpdate/FileUpdate.cpp

Michael J. Spencer bigcheesegs at gmail.com
Thu Dec 9 09:48:56 PST 2010


Author: mspencer
Date: Thu Dec  9 11:48:55 2010
New Revision: 121385

URL: http://llvm.org/viewvc/llvm-project?rev=121385&view=rev
Log:
Missed FileUpdate because CMake doesn't build it yet :(.

Modified:
    llvm/trunk/utils/FileUpdate/FileUpdate.cpp

Modified: llvm/trunk/utils/FileUpdate/FileUpdate.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/FileUpdate/FileUpdate.cpp?rev=121385&r1=121384&r2=121385&view=diff
==============================================================================
--- llvm/trunk/utils/FileUpdate/FileUpdate.cpp (original)
+++ llvm/trunk/utils/FileUpdate/FileUpdate.cpp Thu Dec  9 11:48:55 2010
@@ -18,6 +18,7 @@
 #include "llvm/Support/PrettyStackTrace.h"
 #include "llvm/Support/ToolOutputFile.h"
 #include "llvm/Support/Signals.h"
+#include "llvm/Support/system_error.h"
 using namespace llvm;
 
 static cl::opt<bool>
@@ -42,17 +43,17 @@
   }
 
   // Get the input data.
-  std::string ErrorStr;
+  error_code ec;
   MemoryBuffer *In =
-    MemoryBuffer::getFileOrSTDIN(InputFilename.c_str(), &ErrorStr);
+    MemoryBuffer::getFileOrSTDIN(InputFilename.c_str(), ec);
   if (In == 0) {
     errs() << argv[0] << ": error: Unable to get input '"
-           << InputFilename << "': " << ErrorStr << '\n';
+           << InputFilename << "': " << ec.message() << '\n';
     return 1;
   }
 
   // Get the output data.
-  MemoryBuffer *Out = MemoryBuffer::getFile(OutputFilename.c_str(), &ErrorStr);
+  MemoryBuffer *Out = MemoryBuffer::getFile(OutputFilename.c_str(), ec);
 
   // If the output exists and the contents match, we are done.
   if (Out && In->getBufferSize() == Out->getBufferSize() &&
@@ -70,6 +71,7 @@
   if (!Quiet)
     errs() << argv[0] << ": Updating '" << OutputFilename
            << "', contents changed.\n";
+  std::string ErrorStr;
   tool_output_file OutStream(OutputFilename.c_str(), ErrorStr,
                              raw_fd_ostream::F_Binary);
   if (!ErrorStr.empty()) {





More information about the llvm-commits mailing list