xref: /freebsd/contrib/llvm-project/llvm/include/llvm-c/Linker.h (revision 0b57cec536236d46e3dba9bd041533462f33dbb7)
1*0b57cec5SDimitry Andric /*===-- llvm-c/Linker.h - Module Linker C Interface -------------*- C++ -*-===*\
2*0b57cec5SDimitry Andric |*                                                                            *|
3*0b57cec5SDimitry Andric |* Part of the LLVM Project, under the Apache License v2.0 with LLVM          *|
4*0b57cec5SDimitry Andric |* Exceptions.                                                                *|
5*0b57cec5SDimitry Andric |* See https://llvm.org/LICENSE.txt for license information.                  *|
6*0b57cec5SDimitry Andric |* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception                    *|
7*0b57cec5SDimitry Andric |*                                                                            *|
8*0b57cec5SDimitry Andric |*===----------------------------------------------------------------------===*|
9*0b57cec5SDimitry Andric |*                                                                            *|
10*0b57cec5SDimitry Andric |* This file defines the C interface to the module/file/archive linker.       *|
11*0b57cec5SDimitry Andric |*                                                                            *|
12*0b57cec5SDimitry Andric \*===----------------------------------------------------------------------===*/
13*0b57cec5SDimitry Andric 
14*0b57cec5SDimitry Andric #ifndef LLVM_C_LINKER_H
15*0b57cec5SDimitry Andric #define LLVM_C_LINKER_H
16*0b57cec5SDimitry Andric 
17*0b57cec5SDimitry Andric #include "llvm-c/Types.h"
18*0b57cec5SDimitry Andric 
19*0b57cec5SDimitry Andric #ifdef __cplusplus
20*0b57cec5SDimitry Andric extern "C" {
21*0b57cec5SDimitry Andric #endif
22*0b57cec5SDimitry Andric 
23*0b57cec5SDimitry Andric /* This enum is provided for backwards-compatibility only. It has no effect. */
24*0b57cec5SDimitry Andric typedef enum {
25*0b57cec5SDimitry Andric   LLVMLinkerDestroySource = 0, /* This is the default behavior. */
26*0b57cec5SDimitry Andric   LLVMLinkerPreserveSource_Removed = 1 /* This option has been deprecated and
27*0b57cec5SDimitry Andric                                           should not be used. */
28*0b57cec5SDimitry Andric } LLVMLinkerMode;
29*0b57cec5SDimitry Andric 
30*0b57cec5SDimitry Andric /* Links the source module into the destination module. The source module is
31*0b57cec5SDimitry Andric  * destroyed.
32*0b57cec5SDimitry Andric  * The return value is true if an error occurred, false otherwise.
33*0b57cec5SDimitry Andric  * Use the diagnostic handler to get any diagnostic message.
34*0b57cec5SDimitry Andric */
35*0b57cec5SDimitry Andric LLVMBool LLVMLinkModules2(LLVMModuleRef Dest, LLVMModuleRef Src);
36*0b57cec5SDimitry Andric 
37*0b57cec5SDimitry Andric #ifdef __cplusplus
38*0b57cec5SDimitry Andric }
39*0b57cec5SDimitry Andric #endif
40*0b57cec5SDimitry Andric 
41*0b57cec5SDimitry Andric #endif
42