LLVM API Documentation
00001 /*===-- llvm-c/BitWriter.h - BitWriter Library C Interface ------*- C++ -*-===*\ 00002 |* *| 00003 |* The LLVM Compiler Infrastructure *| 00004 |* *| 00005 |* This file is distributed under the University of Illinois Open Source *| 00006 |* License. See LICENSE.TXT for details. *| 00007 |* *| 00008 |*===----------------------------------------------------------------------===*| 00009 |* *| 00010 |* This header declares the C interface to libLLVMBitWriter.a, which *| 00011 |* implements output of the LLVM bitcode format. *| 00012 |* *| 00013 |* Many exotic languages can interoperate with C code but have a harder time *| 00014 |* with C++ due to name mangling. So in addition to C, this interface enables *| 00015 |* tools written in such languages. *| 00016 |* *| 00017 \*===----------------------------------------------------------------------===*/ 00018 00019 #ifndef LLVM_C_BITWRITER_H 00020 #define LLVM_C_BITWRITER_H 00021 00022 #include "llvm-c/Core.h" 00023 00024 #ifdef __cplusplus 00025 extern "C" { 00026 #endif 00027 00028 /** 00029 * @defgroup LLVMCBitWriter Bit Writer 00030 * @ingroup LLVMC 00031 * 00032 * @{ 00033 */ 00034 00035 /*===-- Operations on modules ---------------------------------------------===*/ 00036 00037 /** Writes a module to the specified path. Returns 0 on success. */ 00038 int LLVMWriteBitcodeToFile(LLVMModuleRef M, const char *Path); 00039 00040 /** Writes a module to an open file descriptor. Returns 0 on success. */ 00041 int LLVMWriteBitcodeToFD(LLVMModuleRef M, int FD, int ShouldClose, 00042 int Unbuffered); 00043 00044 /** Deprecated for LLVMWriteBitcodeToFD. Writes a module to an open file 00045 descriptor. Returns 0 on success. Closes the Handle. */ 00046 int LLVMWriteBitcodeToFileHandle(LLVMModuleRef M, int Handle); 00047 00048 /** 00049 * @} 00050 */ 00051 00052 #ifdef __cplusplus 00053 } 00054 #endif 00055 00056 #endif