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