1239310Sdim/*===-- llvm-c/Linker.h - Module Linker C Interface -------------*- C++ -*-===*\
2239310Sdim|*                                                                            *|
3239310Sdim|*                     The LLVM Compiler Infrastructure                       *|
4239310Sdim|*                                                                            *|
5239310Sdim|* This file is distributed under the University of Illinois Open Source      *|
6239310Sdim|* License. See LICENSE.TXT for details.                                      *|
7239310Sdim|*                                                                            *|
8239310Sdim|*===----------------------------------------------------------------------===*|
9239310Sdim|*                                                                            *|
10239310Sdim|* This file defines the C interface to the module/file/archive linker.       *|
11239310Sdim|*                                                                            *|
12239310Sdim\*===----------------------------------------------------------------------===*/
13239310Sdim
14239310Sdim#ifndef LLVM_C_LINKER_H
15239310Sdim#define LLVM_C_LINKER_H
16239310Sdim
17239310Sdim#include "llvm-c/Core.h"
18239310Sdim
19239310Sdim#ifdef __cplusplus
20239310Sdimextern "C" {
21239310Sdim#endif
22239310Sdim
23239310Sdim
24239310Sdimtypedef enum {
25239310Sdim  LLVMLinkerDestroySource = 0, /* Allow source module to be destroyed. */
26239310Sdim  LLVMLinkerPreserveSource = 1 /* Preserve the source module. */
27239310Sdim} LLVMLinkerMode;
28239310Sdim
29239310Sdim
30239310Sdim/* Links the source module into the destination module, taking ownership
31239310Sdim * of the source module away from the caller. Optionally returns a
32239310Sdim * human-readable description of any errors that occurred in linking.
33239310Sdim * OutMessage must be disposed with LLVMDisposeMessage. The return value
34239310Sdim * is true if an error occurred, false otherwise. */
35239310SdimLLVMBool LLVMLinkModules(LLVMModuleRef Dest, LLVMModuleRef Src,
36239310Sdim                         LLVMLinkerMode Mode, char **OutMessage);
37239310Sdim
38239310Sdim#ifdef __cplusplus
39239310Sdim}
40239310Sdim#endif
41239310Sdim
42239310Sdim#endif
43