LLVM API Documentation

BitWriter.h

Go to the documentation of this file.
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_BITCODEWRITER_H
00020 #define LLVM_C_BITCODEWRITER_H
00021 
00022 #include "llvm-c/Core.h"
00023 
00024 #ifdef __cplusplus
00025 extern "C" {
00026 #endif
00027 
00028 
00029 /*===-- Operations on modules ---------------------------------------------===*/
00030 
00031 /* Writes a module to an open file descriptor. Returns 0 on success.
00032    Closes the Handle. Use dup first if this is not what you want. */ 
00033 int LLVMWriteBitcodeToFileHandle(LLVMModuleRef M, int Handle);
00034 
00035 /* Writes a module to the specified path. Returns 0 on success. */ 
00036 int LLVMWriteBitcodeToFile(LLVMModuleRef M, const char *Path);
00037 
00038 
00039 #ifdef __cplusplus
00040 }
00041 #endif
00042 
00043 #endif