summaryrefslogtreecommitdiffstats
path: root/llvm/lib/LTO
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2014-07-03 23:28:00 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2014-07-03 23:28:00 +0000
commit63086fe166933942b38a3cc68af3094b973cb275 (patch)
tree467591066107c39282123e3f9aaf81bf29a9aaa7 /llvm/lib/LTO
parent30f37f5fc426824899632e2a329adaeccddf3065 (diff)
downloadbcm5719-llvm-63086fe166933942b38a3cc68af3094b973cb275.tar.gz
bcm5719-llvm-63086fe166933942b38a3cc68af3094b973cb275.zip
LTO: rename the various makeLTOModule overloads.
This rename makes it easier to identify the specific overload being called in each particular case and makes future refactorings easier. Differential Revision: http://reviews.llvm.org/D4370 llvm-svn: 212302
Diffstat (limited to 'llvm/lib/LTO')
-rw-r--r--llvm/lib/LTO/LTOModule.cpp29
1 files changed, 13 insertions, 16 deletions
diff --git a/llvm/lib/LTO/LTOModule.cpp b/llvm/lib/LTO/LTOModule.cpp
index cda41dcf65d..7d3446ebc17 100644
--- a/llvm/lib/LTO/LTOModule.cpp
+++ b/llvm/lib/LTO/LTOModule.cpp
@@ -94,10 +94,8 @@ bool LTOModule::isTargetMatch(MemoryBuffer *buffer, const char *triplePrefix) {
return strncmp(Triple.c_str(), triplePrefix, strlen(triplePrefix)) == 0;
}
-/// makeLTOModule - Create an LTOModule. N.B. These methods take ownership of
-/// the buffer.
-LTOModule *LTOModule::makeLTOModule(const char *path, TargetOptions options,
- std::string &errMsg) {
+LTOModule *LTOModule::createFromFile(const char *path, TargetOptions options,
+ std::string &errMsg) {
std::unique_ptr<MemoryBuffer> buffer;
if (std::error_code ec = MemoryBuffer::getFile(path, buffer)) {
errMsg = ec.message();
@@ -106,17 +104,16 @@ LTOModule *LTOModule::makeLTOModule(const char *path, TargetOptions options,
return makeLTOModule(std::move(buffer), options, errMsg);
}
-LTOModule *LTOModule::makeLTOModule(int fd, const char *path,
- size_t size, TargetOptions options,
- std::string &errMsg) {
- return makeLTOModule(fd, path, size, 0, options, errMsg);
+LTOModule *LTOModule::createFromOpenFile(int fd, const char *path, size_t size,
+ TargetOptions options,
+ std::string &errMsg) {
+ return createFromOpenFileSlice(fd, path, size, 0, options, errMsg);
}
-LTOModule *LTOModule::makeLTOModule(int fd, const char *path,
- size_t map_size,
- off_t offset,
- TargetOptions options,
- std::string &errMsg) {
+LTOModule *LTOModule::createFromOpenFileSlice(int fd, const char *path,
+ size_t map_size, off_t offset,
+ TargetOptions options,
+ std::string &errMsg) {
std::unique_ptr<MemoryBuffer> buffer;
if (std::error_code ec =
MemoryBuffer::getOpenFileSlice(fd, path, buffer, map_size, offset)) {
@@ -126,9 +123,9 @@ LTOModule *LTOModule::makeLTOModule(int fd, const char *path,
return makeLTOModule(std::move(buffer), options, errMsg);
}
-LTOModule *LTOModule::makeLTOModule(const void *mem, size_t length,
- TargetOptions options,
- std::string &errMsg, StringRef path) {
+LTOModule *LTOModule::createFromBuffer(const void *mem, size_t length,
+ TargetOptions options,
+ std::string &errMsg, StringRef path) {
std::unique_ptr<MemoryBuffer> buffer(makeBuffer(mem, length, path));
if (!buffer)
return nullptr;
OpenPOWER on IntegriCloud