2007-12-11 01:20:48 +01:00
|
|
|
/*===-- llvm-c/BitReader.h - BitReader Library C Interface ------*- C++ -*-===*\
|
|
|
|
|* *|
|
2019-01-19 09:50:56 +01:00
|
|
|
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|
|
|
|
|
|* Exceptions. *|
|
|
|
|
|* See https://llvm.org/LICENSE.txt for license information. *|
|
|
|
|
|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|
|
2007-12-11 01:20:48 +01:00
|
|
|
|* *|
|
|
|
|
|*===----------------------------------------------------------------------===*|
|
|
|
|
|* *|
|
|
|
|
|* This header declares the C interface to libLLVMBitReader.a, which *|
|
|
|
|
|* implements input of the LLVM bitcode format. *|
|
|
|
|
|* *|
|
|
|
|
|* Many exotic languages can interoperate with C code but have a harder time *|
|
|
|
|
|* with C++ due to name mangling. So in addition to C, this interface enables *|
|
|
|
|
|* tools written in such languages. *|
|
|
|
|
|* *|
|
|
|
|
\*===----------------------------------------------------------------------===*/
|
|
|
|
|
2014-08-13 18:26:38 +02:00
|
|
|
#ifndef LLVM_C_BITREADER_H
|
|
|
|
#define LLVM_C_BITREADER_H
|
2007-12-11 01:20:48 +01:00
|
|
|
|
2019-11-14 22:57:57 +01:00
|
|
|
#include "llvm-c/ExternC.h"
|
2015-12-18 02:46:52 +01:00
|
|
|
#include "llvm-c/Types.h"
|
2007-12-11 01:20:48 +01:00
|
|
|
|
2019-11-14 22:57:57 +01:00
|
|
|
LLVM_C_EXTERN_C_BEGIN
|
2007-12-11 01:20:48 +01:00
|
|
|
|
2012-03-21 04:54:29 +01:00
|
|
|
/**
|
|
|
|
* @defgroup LLVMCBitReader Bit Reader
|
|
|
|
* @ingroup LLVMC
|
|
|
|
*
|
|
|
|
* @{
|
|
|
|
*/
|
2007-12-11 01:20:48 +01:00
|
|
|
|
2007-12-19 23:30:40 +01:00
|
|
|
/* 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.
|
2015-12-19 00:46:42 +01:00
|
|
|
Optionally returns a human-readable error message via OutMessage.
|
|
|
|
|
|
|
|
This is deprecated. Use LLVMParseBitcode2. */
|
2015-12-18 04:04:52 +01:00
|
|
|
LLVMBool LLVMParseBitcode(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutModule,
|
|
|
|
char **OutMessage);
|
2007-12-19 23:30:40 +01:00
|
|
|
|
2015-12-19 00:46:42 +01:00
|
|
|
/* 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. */
|
|
|
|
LLVMBool LLVMParseBitcode2(LLVMMemoryBufferRef MemBuf,
|
|
|
|
LLVMModuleRef *OutModule);
|
|
|
|
|
|
|
|
/* This is deprecated. Use LLVMParseBitcodeInContext2. */
|
2010-01-09 23:27:07 +01:00
|
|
|
LLVMBool LLVMParseBitcodeInContext(LLVMContextRef ContextRef,
|
|
|
|
LLVMMemoryBufferRef MemBuf,
|
|
|
|
LLVMModuleRef *OutModule, char **OutMessage);
|
2009-07-02 09:17:57 +02:00
|
|
|
|
2015-12-19 00:46:42 +01:00
|
|
|
LLVMBool LLVMParseBitcodeInContext2(LLVMContextRef ContextRef,
|
|
|
|
LLVMMemoryBufferRef MemBuf,
|
|
|
|
LLVMModuleRef *OutModule);
|
|
|
|
|
2010-03-03 00:58:54 +01:00
|
|
|
/** Reads a module from the specified path, returning via the OutMP parameter
|
|
|
|
a module provider which performs lazy deserialization. Returns 0 on success.
|
2015-12-19 00:46:42 +01:00
|
|
|
Optionally returns a human-readable error message via OutMessage.
|
|
|
|
This is deprecated. Use LLVMGetBitcodeModuleInContext2. */
|
2010-03-03 00:58:54 +01:00
|
|
|
LLVMBool LLVMGetBitcodeModuleInContext(LLVMContextRef ContextRef,
|
|
|
|
LLVMMemoryBufferRef MemBuf,
|
2015-12-18 04:04:52 +01:00
|
|
|
LLVMModuleRef *OutM, char **OutMessage);
|
2010-03-03 00:58:54 +01:00
|
|
|
|
2015-12-19 00:46:42 +01:00
|
|
|
/** Reads a module from the specified path, returning via the OutMP parameter a
|
|
|
|
* module provider which performs lazy deserialization. Returns 0 on success. */
|
|
|
|
LLVMBool LLVMGetBitcodeModuleInContext2(LLVMContextRef ContextRef,
|
|
|
|
LLVMMemoryBufferRef MemBuf,
|
|
|
|
LLVMModuleRef *OutM);
|
|
|
|
|
|
|
|
/* This is deprecated. Use LLVMGetBitcodeModule2. */
|
2010-03-03 00:58:54 +01:00
|
|
|
LLVMBool LLVMGetBitcodeModule(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM,
|
|
|
|
char **OutMessage);
|
2010-01-09 23:27:07 +01:00
|
|
|
|
2015-12-19 00:46:42 +01:00
|
|
|
LLVMBool LLVMGetBitcodeModule2(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM);
|
|
|
|
|
2012-03-21 04:54:29 +01:00
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
2019-11-14 22:57:57 +01:00
|
|
|
LLVM_C_EXTERN_C_END
|
2007-12-11 01:20:48 +01:00
|
|
|
|
|
|
|
#endif
|