BitWriter.h revision 208954
197203Sgordon/*===-- llvm-c/BitWriter.h - BitWriter Library C Interface ------*- C++ -*-===*\ 297203Sgordon|* *| 3231129Semaste|* The LLVM Compiler Infrastructure *| 4230812Semaste|* *| 597203Sgordon|* This file is distributed under the University of Illinois Open Source *| 6231129Semaste|* License. See LICENSE.TXT for details. *| 7231129Semaste|* *| 8231129Semaste|*===----------------------------------------------------------------------===*| 9231129Semaste|* *| 10231129Semaste|* This header declares the C interface to libLLVMBitWriter.a, which *| 11231129Semaste|* implements output of the LLVM bitcode format. *| 12231129Semaste|* *| 13231129Semaste|* Many exotic languages can interoperate with C code but have a harder time *| 14231129Semaste|* with C++ due to name mangling. So in addition to C, this interface enables *| 15231129Semaste|* tools written in such languages. *| 16231129Semaste|* *| 17231129Semaste\*===----------------------------------------------------------------------===*/ 18231129Semaste 19231129Semaste#ifndef LLVM_C_BITCODEWRITER_H 20231129Semaste#define LLVM_C_BITCODEWRITER_H 21231129Semaste 22231129Semaste#include "llvm-c/Core.h" 23231129Semaste 24231129Semaste#ifdef __cplusplus 25231129Semasteextern "C" { 26231129Semaste#endif 2797203Sgordon 2897203Sgordon 2997203Sgordon/*===-- Operations on modules ---------------------------------------------===*/ 30230812Semaste 3197203Sgordon/** Writes a module to the specified path. Returns 0 on success. */ 3297203Sgordonint LLVMWriteBitcodeToFile(LLVMModuleRef M, const char *Path); 3397203Sgordon 34230812Semaste/** Writes a module to an open file descriptor. Returns 0 on success. */ 35230812Semasteint LLVMWriteBitcodeToFD(LLVMModuleRef M, int FD, int ShouldClose, 36230812Semaste int Unbuffered); 37230812Semaste 38230812Semaste/** Deprecated for LLVMWriteBitcodeToFD. Writes a module to an open file 39230812Semaste descriptor. Returns 0 on success. Closes the Handle. */ 40230812Semasteint LLVMWriteBitcodeToFileHandle(LLVMModuleRef M, int Handle); 41230812Semaste 42230812Semaste#ifdef __cplusplus 43230812Semaste} 44230812Semaste#endif 45230812Semaste 46230812Semaste#endif 47230812Semaste