LLVM API Documentation

BitReader.h

Go to the documentation of this file.
00001 /*===-- llvm-c/BitReader.h - BitReader 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 libLLVMBitReader.a, which          *|
00011 |* implements input 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_BITCODEREADER_H
00020 #define LLVM_C_BITCODEREADER_H
00021 
00022 #include "llvm-c/Core.h"
00023 
00024 #ifdef __cplusplus
00025 extern "C" {
00026 #endif
00027 
00028 
00029 /* Builds a module from the bitcode in the specified memory buffer, returning a
00030    reference to the module via the OutModule parameter. Returns 0 on success.
00031    Optionally returns a human-readable error message via OutMessage. */ 
00032 int LLVMParseBitcode(LLVMMemoryBufferRef MemBuf,
00033                      LLVMModuleRef *OutModule, char **OutMessage);
00034 
00035 /* Reads a module from the specified path, returning via the OutMP parameter
00036    a module provider which performs lazy deserialization. Returns 0 on success.
00037    Optionally returns a human-readable error message via OutMessage. */ 
00038 int LLVMGetBitcodeModuleProvider(LLVMMemoryBufferRef MemBuf,
00039                                  LLVMModuleProviderRef *OutMP,
00040                                  char **OutMessage);
00041 
00042 
00043 #ifdef __cplusplus
00044 }
00045 #endif
00046 
00047 #endif