summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/FileUtilities.cpp
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-12-16 03:29:14 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-12-16 03:29:14 +0000
commit39a0ffc3949a746d0a09c9a3e01c183c9216da04 (patch)
treed045dd753f87830314c4fede77145544f5650b6a /llvm/lib/Support/FileUtilities.cpp
parent716d01a612022608467fb7071ef4669dd326e007 (diff)
downloadbcm5719-llvm-39a0ffc3949a746d0a09c9a3e01c183c9216da04.tar.gz
bcm5719-llvm-39a0ffc3949a746d0a09c9a3e01c183c9216da04.zip
MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> via an out parm.
llvm-svn: 121958
Diffstat (limited to 'llvm/lib/Support/FileUtilities.cpp')
-rw-r--r--llvm/lib/Support/FileUtilities.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Support/FileUtilities.cpp b/llvm/lib/Support/FileUtilities.cpp
index c9e42e9b38f..5dbabee7a7e 100644
--- a/llvm/lib/Support/FileUtilities.cpp
+++ b/llvm/lib/Support/FileUtilities.cpp
@@ -201,14 +201,14 @@ int llvm::DiffFilesWithTolerance(const sys::PathWithStatus &FileA,
// Now its safe to mmap the files into memory becasue both files
// have a non-zero size.
error_code ec;
- OwningPtr<MemoryBuffer> F1(MemoryBuffer::getFile(FileA.c_str(), ec));
- if (F1 == 0) {
+ OwningPtr<MemoryBuffer> F1;
+ if (error_code ec = MemoryBuffer::getFile(FileA.c_str(), F1)) {
if (Error)
*Error = ec.message();
return 2;
}
- OwningPtr<MemoryBuffer> F2(MemoryBuffer::getFile(FileB.c_str(), ec));
- if (F2 == 0) {
+ OwningPtr<MemoryBuffer> F2;
+ if (error_code ec = MemoryBuffer::getFile(FileB.c_str(), F2)) {
if (Error)
*Error = ec.message();
return 2;
OpenPOWER on IntegriCloud