summaryrefslogtreecommitdiffstats
path: root/llvm/include/llvm-c
diff options
context:
space:
mode:
authorShuxin Yang <shuxin.llvm@gmail.com>2013-08-12 18:29:43 +0000
committerShuxin Yang <shuxin.llvm@gmail.com>2013-08-12 18:29:43 +0000
commit76d082b5cdc8108af80ec89c51d17295728a1acb (patch)
tree2fbe8c47c3078935f3f5371d4e80a30d987e05d2 /llvm/include/llvm-c
parent43e5fd224a861871bf6b3648e7b0a190fbeea50e (diff)
downloadbcm5719-llvm-76d082b5cdc8108af80ec89c51d17295728a1acb.tar.gz
bcm5719-llvm-76d082b5cdc8108af80ec89c51d17295728a1acb.zip
Misc enhancements to LTO:
1. Add some helper classes for partitions. They are designed in a way such that the top-level LTO driver will not see much difference with or without partitioning. 2. Introduce work-dir. Now all intermediate files generated during LTO phases will be saved under work-dir. User can specify the workdir via -lto-workdir=/path/to/dir. By default the work-dir will be erased before linker exit. To keep the workdir, do -lto-keep, or -lto-keep=1. TODO: Erase the workdir, if the linker exit prematurely. We are currently not able to remove directory on signal. The support routines simply ignore directory. 3. Add one new API lto_codegen_get_files_need_remove(). Linker and LTO plugin will communicate via this API about which files (including directories) need to removed before linker exit. llvm-svn: 188188
Diffstat (limited to 'llvm/include/llvm-c')
-rw-r--r--llvm/include/llvm-c/lto.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/include/llvm-c/lto.h b/llvm/include/llvm-c/lto.h
index 40110fddfc1..a7a942d2b34 100644
--- a/llvm/include/llvm-c/lto.h
+++ b/llvm/include/llvm-c/lto.h
@@ -284,6 +284,18 @@ lto_codegen_compile(lto_code_gen_t cg, size_t* length);
extern bool
lto_codegen_compile_to_file(lto_code_gen_t cg, const char** name);
+/**
+ * Get intermediate files that need to be removed before linker exit. Upon
+ * return, the paths of the files need to be removed is written to "paths". The
+ * paths are separated by a single '\0', and the last path is ended by double
+ * '\0's. A file could be a directory; in this case, the entire directory needs
+ * to be removed recursively.
+ *
+ * It is only necessary to call this function after \p lto_codegen_compile was
+ * successfully called.
+ */
+extern void
+lto_codegen_get_files_need_remove(lto_code_gen_t cg, const char **paths);
/**
* Sets options to help debug codegen bugs.
OpenPOWER on IntegriCloud