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