aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/MemoryBuffer.cpp
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-11-29 18:16:10 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-11-29 18:16:10 +0000
commit447762da858c1705c5fce5288f874797dc4b1135 (patch)
treeaa93dd9d52efdac9dc7f9560dc3054ef82375fbc /llvm/lib/Support/MemoryBuffer.cpp
parent8aaf49959c209561a223ecf869af096730412389 (diff)
downloadllvm-447762da858c1705c5fce5288f874797dc4b1135.zip
llvm-447762da858c1705c5fce5288f874797dc4b1135.tar.gz
llvm-447762da858c1705c5fce5288f874797dc4b1135.tar.bz2
Merge System into Support.
llvm-svn: 120298
Diffstat (limited to 'llvm/lib/Support/MemoryBuffer.cpp')
-rw-r--r--llvm/lib/Support/MemoryBuffer.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/llvm/lib/Support/MemoryBuffer.cpp b/llvm/lib/Support/MemoryBuffer.cpp
index 5b701a5..07a5ed4 100644
--- a/llvm/lib/Support/MemoryBuffer.cpp
+++ b/llvm/lib/Support/MemoryBuffer.cpp
@@ -15,10 +15,10 @@
#include "llvm/ADT/OwningPtr.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/MathExtras.h"
-#include "llvm/System/Errno.h"
-#include "llvm/System/Path.h"
-#include "llvm/System/Process.h"
-#include "llvm/System/Program.h"
+#include "llvm/Support/Errno.h"
+#include "llvm/Support/Path.h"
+#include "llvm/Support/Process.h"
+#include "llvm/Support/Program.h"
#include <cassert>
#include <cstdio>
#include <cstring>
@@ -203,14 +203,14 @@ MemoryBuffer *MemoryBuffer::getFile(const char *Filename, std::string *ErrStr,
if (ErrStr) *ErrStr = sys::StrError();
return 0;
}
-
+
return getOpenFile(FD, Filename, ErrStr, FileSize);
}
-
+
MemoryBuffer *MemoryBuffer::getOpenFile(int FD, const char *Filename,
std::string *ErrStr, int64_t FileSize) {
FileCloser FC(FD); // Close FD on return.
-
+
// If we don't know the file size, use fstat to find out. fstat on an open
// file descriptor is cheaper than stat on a random path.
if (FileSize == -1) {
@@ -222,8 +222,8 @@ MemoryBuffer *MemoryBuffer::getOpenFile(int FD, const char *Filename,
}
FileSize = FileInfo.st_size;
}
-
-
+
+
// If the file is large, try to use mmap to read it in. We don't use mmap
// for small files, because this can severely fragment our address space. Also
// don't try to map files that are exactly a multiple of the system page size,