[LTO API] add lto_codegen_set_module to set the destination module.
[oota-llvm.git] / include / llvm-c / lto.h
index 1fe0cd5c75d27d6aee047e4d30b90a6501103e6e..c6acdaddca535e3a1cae32ddd451a3272a3cccc3 100644 (file)
@@ -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
@@ -395,6 +395,17 @@ lto_codegen_dispose(lto_code_gen_t);
 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).