X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm-c%2FBitReader.h;h=522803518398c681762431a65cb2b5e31ca76603;hb=c0fa31d51bdb255a481a287ab6492461ba5f2458;hp=ba77988a74381186bf193c35aafee2fdae1ec3cd;hpb=1ae6135fa37eb061499d079b9b33dc82dcc1283f;p=oota-llvm.git diff --git a/include/llvm-c/BitReader.h b/include/llvm-c/BitReader.h index ba77988a743..52280351839 100644 --- a/include/llvm-c/BitReader.h +++ b/include/llvm-c/BitReader.h @@ -2,8 +2,8 @@ |* *| |* The LLVM Compiler Infrastructure *| |* *| -|* This file was developed by Gordon Henriksen and is distributed under the *| -|* University of Illinois Open Source License. See LICENSE.TXT for details. *| +|* This file is distributed under the University of Illinois Open Source *| +|* License. See LICENSE.TXT for details. *| |* *| |*===----------------------------------------------------------------------===*| |* *| @@ -25,23 +25,49 @@ extern "C" { #endif +/** + * @defgroup LLVMCBitReader Bit Reader + * @ingroup LLVMC + * + * @{ + */ -/* Reads a module from the specified path, returning a reference to the module - via the OutModule parameter. Returns 0 on success. Optionally returns a - human-readable error message. */ -int LLVMReadBitcodeFromFile(const char *Path, LLVMModuleRef *OutModule, - char **OutMessage); +/* Builds a module from the bitcode in the specified memory buffer, returning a + reference to the module via the OutModule parameter. Returns 0 on success. + Optionally returns a human-readable error message via OutMessage. */ +LLVMBool LLVMParseBitcode(LLVMMemoryBufferRef MemBuf, + LLVMModuleRef *OutModule, char **OutMessage); -/* Reads a module from the specified path, returning a reference to a lazy - module provider via the OutModule parameter. Returns 0 on success. Optionally - returns a human-readable error message. */ -int LLVMCreateModuleProviderFromFile(const char *Path, - LLVMModuleProviderRef *OutMP, - char **OutMessage); +LLVMBool LLVMParseBitcodeInContext(LLVMContextRef ContextRef, + LLVMMemoryBufferRef MemBuf, + LLVMModuleRef *OutModule, char **OutMessage); -/* Disposes of the message allocated by the bitcode reader, if any. */ -void LLVMDisposeBitcodeReaderMessage(char *Message); +/** Reads a module from the specified path, returning via the OutMP parameter + a module provider which performs lazy deserialization. Returns 0 on success. + Optionally returns a human-readable error message via OutMessage. */ +LLVMBool LLVMGetBitcodeModuleInContext(LLVMContextRef ContextRef, + LLVMMemoryBufferRef MemBuf, + LLVMModuleRef *OutM, + char **OutMessage); +LLVMBool LLVMGetBitcodeModule(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM, + char **OutMessage); + + +/** Deprecated: Use LLVMGetBitcodeModuleInContext instead. */ +LLVMBool LLVMGetBitcodeModuleProviderInContext(LLVMContextRef ContextRef, + LLVMMemoryBufferRef MemBuf, + LLVMModuleProviderRef *OutMP, + char **OutMessage); + +/** Deprecated: Use LLVMGetBitcodeModule instead. */ +LLVMBool LLVMGetBitcodeModuleProvider(LLVMMemoryBufferRef MemBuf, + LLVMModuleProviderRef *OutMP, + char **OutMessage); + +/** + * @} + */ #ifdef __cplusplus }