BitWriter.h revision 285830
1132720Skan/*===-- llvm-c/BitWriter.h - BitWriter Library C Interface ------*- C++ -*-===*\
2132720Skan|*                                                                            *|
3169691Skan|*                     The LLVM Compiler Infrastructure                       *|
4132720Skan|*                                                                            *|
5132720Skan|* This file is distributed under the University of Illinois Open Source      *|
6132720Skan|* License. See LICENSE.TXT for details.                                      *|
7132720Skan|*                                                                            *|
8132720Skan|*===----------------------------------------------------------------------===*|
9132720Skan|*                                                                            *|
10132720Skan|* This header declares the C interface to libLLVMBitWriter.a, which          *|
11132720Skan|* implements output of the LLVM bitcode format.                              *|
12132720Skan|*                                                                            *|
13132720Skan|* Many exotic languages can interoperate with C code but have a harder time  *|
14132720Skan|* with C++ due to name mangling. So in addition to C, this interface enables *|
15132720Skan|* tools written in such languages.                                           *|
16132720Skan|*                                                                            *|
17132720Skan\*===----------------------------------------------------------------------===*/
18169691Skan
19132720Skan#ifndef LLVM_C_BITCODEWRITER_H
20132720Skan#define LLVM_C_BITCODEWRITER_H
21132720Skan
22132720Skan#include "llvm-c/Core.h"
23132720Skan
24132720Skan#ifdef __cplusplus
25132720Skanextern "C" {
26132720Skan#endif
27132720Skan
28132720Skan/**
29132720Skan * @defgroup LLVMCBitWriter Bit Writer
30169691Skan * @ingroup LLVMC
31169691Skan *
32169691Skan * @{
33169691Skan */
34132720Skan
35132720Skan/*===-- Operations on modules ---------------------------------------------===*/
36132720Skan
37132720Skan/** Writes a module to the specified path. Returns 0 on success. */
38132720Skanint LLVMWriteBitcodeToFile(LLVMModuleRef M, const char *Path);
39132720Skan
40132720Skan/** Writes a module to an open file descriptor. Returns 0 on success. */
41132720Skanint LLVMWriteBitcodeToFD(LLVMModuleRef M, int FD, int ShouldClose,
42169691Skan                         int Unbuffered);
43169691Skan
44169691Skan/** Deprecated for LLVMWriteBitcodeToFD. Writes a module to an open file
45169691Skan    descriptor. Returns 0 on success. Closes the Handle. */
46169691Skanint LLVMWriteBitcodeToFileHandle(LLVMModuleRef M, int Handle);
47169691Skan
48169691Skan/**
49132720Skan * @}
50132720Skan */
51132720Skan
52169691Skan#ifdef __cplusplus
53169691Skan}
54169691Skan#endif
55169691Skan
56169691Skan#endif
57132720Skan