xref: /minix3/external/bsd/llvm/dist/llvm/include/llvm-c/Linker.h (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1f4a2713aSLionel Sambuc /*===-- llvm-c/Linker.h - Module Linker C Interface -------------*- C++ -*-===*\
2f4a2713aSLionel Sambuc |*                                                                            *|
3f4a2713aSLionel Sambuc |*                     The LLVM Compiler Infrastructure                       *|
4f4a2713aSLionel Sambuc |*                                                                            *|
5f4a2713aSLionel Sambuc |* This file is distributed under the University of Illinois Open Source      *|
6f4a2713aSLionel Sambuc |* License. See LICENSE.TXT for details.                                      *|
7f4a2713aSLionel Sambuc |*                                                                            *|
8f4a2713aSLionel Sambuc |*===----------------------------------------------------------------------===*|
9f4a2713aSLionel Sambuc |*                                                                            *|
10f4a2713aSLionel Sambuc |* This file defines the C interface to the module/file/archive linker.       *|
11f4a2713aSLionel Sambuc |*                                                                            *|
12f4a2713aSLionel Sambuc \*===----------------------------------------------------------------------===*/
13f4a2713aSLionel Sambuc 
14f4a2713aSLionel Sambuc #ifndef LLVM_C_LINKER_H
15f4a2713aSLionel Sambuc #define LLVM_C_LINKER_H
16f4a2713aSLionel Sambuc 
17f4a2713aSLionel Sambuc #include "llvm-c/Core.h"
18f4a2713aSLionel Sambuc 
19f4a2713aSLionel Sambuc #ifdef __cplusplus
20f4a2713aSLionel Sambuc extern "C" {
21f4a2713aSLionel Sambuc #endif
22f4a2713aSLionel Sambuc 
23f4a2713aSLionel Sambuc 
24*0a6a1f1dSLionel Sambuc /* Note: LLVMLinkerPreserveSource has no effect. */
25f4a2713aSLionel Sambuc typedef enum {
26f4a2713aSLionel Sambuc   LLVMLinkerDestroySource = 0, /* Allow source module to be destroyed. */
27f4a2713aSLionel Sambuc   LLVMLinkerPreserveSource = 1 /* Preserve the source module. */
28f4a2713aSLionel Sambuc } LLVMLinkerMode;
29f4a2713aSLionel Sambuc 
30f4a2713aSLionel Sambuc 
31f4a2713aSLionel Sambuc /* Links the source module into the destination module, taking ownership
32f4a2713aSLionel Sambuc  * of the source module away from the caller. Optionally returns a
33f4a2713aSLionel Sambuc  * human-readable description of any errors that occurred in linking.
34f4a2713aSLionel Sambuc  * OutMessage must be disposed with LLVMDisposeMessage. The return value
35f4a2713aSLionel Sambuc  * is true if an error occurred, false otherwise. */
36f4a2713aSLionel Sambuc LLVMBool LLVMLinkModules(LLVMModuleRef Dest, LLVMModuleRef Src,
37f4a2713aSLionel Sambuc                          LLVMLinkerMode Mode, char **OutMessage);
38f4a2713aSLionel Sambuc 
39f4a2713aSLionel Sambuc #ifdef __cplusplus
40f4a2713aSLionel Sambuc }
41f4a2713aSLionel Sambuc #endif
42f4a2713aSLionel Sambuc 
43f4a2713aSLionel Sambuc #endif
44