summaryrefslogtreecommitdiffstats
path: root/llvm/include/llvm-c
diff options
context:
space:
mode:
authorManman Ren <manman.ren@gmail.com>2015-02-24 00:45:56 +0000
committerManman Ren <manman.ren@gmail.com>2015-02-24 00:45:56 +0000
commit6487ce955a0227f24a0958997ca4785e6b343734 (patch)
tree1f1ad8070bad10d0f86c241619bdcd5aace5c50b /llvm/include/llvm-c
parent8bc61df9f261f200039c30d053a205273e5c7906 (diff)
downloadbcm5719-llvm-6487ce955a0227f24a0958997ca4785e6b343734.tar.gz
bcm5719-llvm-6487ce955a0227f24a0958997ca4785e6b343734.zip
[LTO API] add lto_codegen_set_module to set the destination module.
When debugging LTO issues with ld64, we use -save-temps to save the merged optimized bitcode file, then invoke ld64 again on the single bitcode file to speed up debugging code generation passes and ld64 stuff after code generation. llvm linking a single bitcode file via lto_codegen_add_module will generate a different bitcode file from the single input. With the newly-added lto_codegen_set_module, we can make sure the destination module is the same as the input. lto_codegen_set_module will transfer the ownship of the module to code generator. rdar://19024554 llvm-svn: 230290
Diffstat (limited to 'llvm/include/llvm-c')
-rw-r--r--llvm/include/llvm-c/lto.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/llvm/include/llvm-c/lto.h b/llvm/include/llvm-c/lto.h
index 1fe0cd5c75d..c6acdaddca5 100644
--- a/llvm/include/llvm-c/lto.h
+++ b/llvm/include/llvm-c/lto.h
@@ -40,7 +40,7 @@ typedef bool lto_bool_t;
* @{
*/
-#define LTO_API_VERSION 12
+#define LTO_API_VERSION 13
/**
* \since prior to LTO_API_VERSION=3
@@ -396,6 +396,17 @@ extern lto_bool_t
lto_codegen_add_module(lto_code_gen_t cg, lto_module_t mod);
/**
+ * Sets the object module for code generation. This will transfer the ownship of
+ * the module to code generator.
+ *
+ * \c cg and \c mod must both be in the same context.
+ *
+ * \since prior to LTO_API_VERSION=13
+ */
+extern void
+lto_codegen_set_module(lto_code_gen_t cg, lto_module_t mod);
+
+/**
* Sets if debug info should be generated.
* Returns true on error (check lto_get_error_message() for details).
*
OpenPOWER on IntegriCloud