diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2011-02-08 22:40:47 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2011-02-08 22:40:47 +0000 |
commit | 56e41f7f0b0a421ea1d236ed6496b8db26f803ef (patch) | |
tree | dfa62b21f25cc0c13652c66a40922a99e60bf42f /llvm/include/llvm-c/lto.h | |
parent | 4ebf471c9b8a30905692eda8908107aa5e08ce8e (diff) | |
download | bcm5719-llvm-56e41f7f0b0a421ea1d236ed6496b8db26f803ef.tar.gz bcm5719-llvm-56e41f7f0b0a421ea1d236ed6496b8db26f803ef.zip |
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.
llvm-svn: 125128
Diffstat (limited to 'llvm/include/llvm-c/lto.h')
-rw-r--r-- | llvm/include/llvm-c/lto.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/include/llvm-c/lto.h b/llvm/include/llvm-c/lto.h index 08c12af40ae..1c42ce0cec7 100644 --- a/llvm/include/llvm-c/lto.h +++ b/llvm/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. |