summaryrefslogtreecommitdiff
path: root/include/llvm-c/lto.h
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2011-02-08 22:40:47 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2011-02-08 22:40:47 +0000
commitb4cc031a3e1306fea74c9211d50c5cde6d9a8cd5 (patch)
tree80f2d7365cd402e9040ed85abf3b06a17d59f423 /include/llvm-c/lto.h
parent971b83b67a9812556cdb97bb58aa96fb37af458d (diff)
downloadllvm-b4cc031a3e1306fea74c9211d50c5cde6d9a8cd5.tar.gz
llvm-b4cc031a3e1306fea74c9211d50c5cde6d9a8cd5.tar.bz2
llvm-b4cc031a3e1306fea74c9211d50c5cde6d9a8cd5.tar.xz
Don't open the file again in the gold plugin. To be able to do this, update
MemoryBuffer::getOpenFile to not close the file descriptor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125128 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm-c/lto.h')
-rw-r--r--include/llvm-c/lto.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/llvm-c/lto.h b/include/llvm-c/lto.h
index 08c12af40a..1c42ce0cec 100644
--- a/include/llvm-c/lto.h
+++ b/include/llvm-c/lto.h
@@ -18,6 +18,7 @@
#include <stdbool.h>
#include <stddef.h>
+#include <unistd.h>
#define LTO_API_VERSION 4
@@ -121,6 +122,13 @@ lto_module_create(const char* path);
extern lto_module_t
lto_module_create_from_memory(const void* mem, size_t length);
+/**
+ * Loads an object file from disk. The seek point of fd is not preserved.
+ * Returns NULL on error (check lto_get_error_message() for details).
+ */
+extern lto_module_t
+lto_module_create_from_fd(int fd, const char *path, off_t size);
+
/**
* Frees all memory internally allocated by the module.