diff options
author | Michael J. Spencer <bigcheesegs@gmail.com> | 2010-12-09 17:48:55 +0000 |
---|---|---|
committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2010-12-09 17:48:55 +0000 |
commit | 5078434ff3e5a74b6e4b7a3e921df64f5ccf7d0e (patch) | |
tree | 93661ae39a5ef98c862f63bb901a39c614881704 /llvm/utils/FileUpdate/FileUpdate.cpp | |
parent | ae7de7e2f9b7cb0370671fa8ae7da537a7aacf40 (diff) | |
download | bcm5719-llvm-5078434ff3e5a74b6e4b7a3e921df64f5ccf7d0e.tar.gz bcm5719-llvm-5078434ff3e5a74b6e4b7a3e921df64f5ccf7d0e.zip |
Missed FileUpdate because CMake doesn't build it yet :(.
llvm-svn: 121385
Diffstat (limited to 'llvm/utils/FileUpdate/FileUpdate.cpp')
-rw-r--r-- | llvm/utils/FileUpdate/FileUpdate.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/utils/FileUpdate/FileUpdate.cpp b/llvm/utils/FileUpdate/FileUpdate.cpp index 616bcbe2068..3514d0f2157 100644 --- a/llvm/utils/FileUpdate/FileUpdate.cpp +++ b/llvm/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()) { |