summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/gold/gold-plugin.cpp5
-rw-r--r--tools/llvm-ar/llvm-ar.cpp6
-rw-r--r--tools/lto/LTOModule.cpp7
-rw-r--r--tools/lto/LTOModule.h1
-rw-r--r--tools/lto/lto.cpp3
5 files changed, 9 insertions, 13 deletions
diff --git a/tools/gold/gold-plugin.cpp b/tools/gold/gold-plugin.cpp
index 133eca48e5..77717098d6 100644
--- a/tools/gold/gold-plugin.cpp
+++ b/tools/gold/gold-plugin.cpp
@@ -252,9 +252,8 @@ static ld_plugin_status claim_file_hook(const ld_plugin_input_file *file,
if (file->offset) {
offset = file->offset;
}
- if (error_code ec =
- MemoryBuffer::getOpenFile(file->fd, file->name, buffer, -1,
- file->filesize, offset, false)) {
+ if (error_code ec = MemoryBuffer::getOpenFileSlice(
+ file->fd, file->name, buffer, file->filesize, offset)) {
(*message)(LDPL_ERROR, ec.message().c_str());
return LDPS_ERR;
}
diff --git a/tools/llvm-ar/llvm-ar.cpp b/tools/llvm-ar/llvm-ar.cpp
index 116143e168..261446cc78 100644
--- a/tools/llvm-ar/llvm-ar.cpp
+++ b/tools/llvm-ar/llvm-ar.cpp
@@ -770,9 +770,9 @@ static void performWriteOperation(ArchiveOperation Operation,
failIfError(sys::fs::status(FD, Status), FileName);
OwningPtr<MemoryBuffer> File;
- failIfError(
- MemoryBuffer::getOpenFile(FD, FileName, File, Status.getSize()),
- FileName);
+ failIfError(MemoryBuffer::getOpenFile(FD, FileName, File,
+ Status.getSize(), false),
+ FileName);
StringRef Name = sys::path::filename(FileName);
if (Name.size() < 16)
diff --git a/tools/lto/LTOModule.cpp b/tools/lto/LTOModule.cpp
index 5ee43ba022..6626eaac47 100644
--- a/tools/lto/LTOModule.cpp
+++ b/tools/lto/LTOModule.cpp
@@ -209,17 +209,16 @@ LTOModule *LTOModule::makeLTOModule(const char *path, std::string &errMsg) {
LTOModule *LTOModule::makeLTOModule(int fd, const char *path,
size_t size, std::string &errMsg) {
- return makeLTOModule(fd, path, size, size, 0, errMsg);
+ return makeLTOModule(fd, path, size, 0, errMsg);
}
LTOModule *LTOModule::makeLTOModule(int fd, const char *path,
- size_t file_size,
size_t map_size,
off_t offset,
std::string &errMsg) {
OwningPtr<MemoryBuffer> buffer;
- if (error_code ec = MemoryBuffer::getOpenFile(fd, path, buffer, file_size,
- map_size, offset, false)) {
+ if (error_code ec =
+ MemoryBuffer::getOpenFileSlice(fd, path, buffer, map_size, offset)) {
errMsg = ec.message();
return NULL;
}
diff --git a/tools/lto/LTOModule.h b/tools/lto/LTOModule.h
index 83f3a7def1..902e9c5438 100644
--- a/tools/lto/LTOModule.h
+++ b/tools/lto/LTOModule.h
@@ -82,7 +82,6 @@ public:
static LTOModule *makeLTOModule(int fd, const char *path,
size_t size, std::string &errMsg);
static LTOModule *makeLTOModule(int fd, const char *path,
- size_t file_size,
size_t map_size,
off_t offset,
std::string& errMsg);
diff --git a/tools/lto/lto.cpp b/tools/lto/lto.cpp
index 11ad532be8..e0df81ab20 100644
--- a/tools/lto/lto.cpp
+++ b/tools/lto/lto.cpp
@@ -78,8 +78,7 @@ lto_module_t lto_module_create_from_fd_at_offset(int fd, const char *path,
size_t file_size,
size_t map_size,
off_t offset) {
- return LTOModule::makeLTOModule(fd, path, file_size, map_size,
- offset, sLastErrorString);
+ return LTOModule::makeLTOModule(fd, path, map_size, offset, sLastErrorString);
}
/// lto_module_create_from_memory - Loads an object file from memory. Returns