summaryrefslogtreecommitdiff
path: root/utils/FileUpdate
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-12-09 17:48:55 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-12-09 17:48:55 +0000
commit7a8aab3997e48aabe819de43b369d441ec4f533a (patch)
tree3abcd8fc7b76a6d9c92af8fc018e81d6c56e36d9 /utils/FileUpdate
parent924aa23b743ab482665e16e6339d46d713d11478 (diff)
downloadllvm-7a8aab3997e48aabe819de43b369d441ec4f533a.tar.gz
llvm-7a8aab3997e48aabe819de43b369d441ec4f533a.tar.bz2
llvm-7a8aab3997e48aabe819de43b369d441ec4f533a.tar.xz
Missed FileUpdate because CMake doesn't build it yet :(.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121385 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/FileUpdate')
-rw-r--r--utils/FileUpdate/FileUpdate.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/utils/FileUpdate/FileUpdate.cpp b/utils/FileUpdate/FileUpdate.cpp
index 616bcbe206..3514d0f215 100644
--- a/utils/FileUpdate/FileUpdate.cpp
+++ b/utils/FileUpdate/FileUpdate.cpp
@@ -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 @@ int main(int argc, char **argv) {
}
// 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 @@ int main(int argc, char **argv) {
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()) {