BitWriter.h revision 234353
1193323Sed/*===-- llvm-c/BitWriter.h - BitWriter Library C Interface ------*- C++ -*-===*\ 2193323Sed|* *| 3193323Sed|* The LLVM Compiler Infrastructure *| 4193323Sed|* *| 5193323Sed|* This file is distributed under the University of Illinois Open Source *| 6193323Sed|* License. See LICENSE.TXT for details. *| 7193323Sed|* *| 8193323Sed|*===----------------------------------------------------------------------===*| 9193323Sed|* *| 10193323Sed|* This header declares the C interface to libLLVMBitWriter.a, which *| 11193323Sed|* implements output of the LLVM bitcode format. *| 12193323Sed|* *| 13193323Sed|* Many exotic languages can interoperate with C code but have a harder time *| 14193323Sed|* with C++ due to name mangling. So in addition to C, this interface enables *| 15193323Sed|* tools written in such languages. *| 16193323Sed|* *| 17193323Sed\*===----------------------------------------------------------------------===*/ 18193323Sed 19193323Sed#ifndef LLVM_C_BITCODEWRITER_H 20193323Sed#define LLVM_C_BITCODEWRITER_H 21193323Sed 22193323Sed#include "llvm-c/Core.h" 23193323Sed 24193323Sed#ifdef __cplusplus 25193323Sedextern "C" { 26193323Sed#endif 27193323Sed 28234353Sdim/** 29234353Sdim * @defgroup LLVMCBitWriter Bit Writer 30234353Sdim * @ingroup LLVMC 31234353Sdim * 32234353Sdim * @{ 33234353Sdim */ 34193323Sed 35193323Sed/*===-- Operations on modules ---------------------------------------------===*/ 36193323Sed 37204792Srdivacky/** Writes a module to the specified path. Returns 0 on success. */ 38193323Sedint LLVMWriteBitcodeToFile(LLVMModuleRef M, const char *Path); 39193323Sed 40204792Srdivacky/** Writes a module to an open file descriptor. Returns 0 on success. */ 41204792Srdivackyint LLVMWriteBitcodeToFD(LLVMModuleRef M, int FD, int ShouldClose, 42204792Srdivacky int Unbuffered); 43193323Sed 44204792Srdivacky/** Deprecated for LLVMWriteBitcodeToFD. Writes a module to an open file 45204792Srdivacky descriptor. Returns 0 on success. Closes the Handle. */ 46204792Srdivackyint LLVMWriteBitcodeToFileHandle(LLVMModuleRef M, int Handle); 47204792Srdivacky 48234353Sdim/** 49234353Sdim * @} 50234353Sdim */ 51234353Sdim 52193323Sed#ifdef __cplusplus 53193323Sed} 54193323Sed#endif 55193323Sed 56193323Sed#endif 57