Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:43:00

0001 /*===-- llvm-c/BitReader.h - BitReader Library C Interface ------*- C++ -*-===*\
0002 |*                                                                            *|
0003 |* Part of the LLVM Project, under the Apache License v2.0 with LLVM          *|
0004 |* Exceptions.                                                                *|
0005 |* See https://llvm.org/LICENSE.txt for license information.                  *|
0006 |* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception                    *|
0007 |*                                                                            *|
0008 |*===----------------------------------------------------------------------===*|
0009 |*                                                                            *|
0010 |* This header declares the C interface to libLLVMBitReader.a, which          *|
0011 |* implements input of the LLVM bitcode format.                               *|
0012 |*                                                                            *|
0013 |* Many exotic languages can interoperate with C code but have a harder time  *|
0014 |* with C++ due to name mangling. So in addition to C, this interface enables *|
0015 |* tools written in such languages.                                           *|
0016 |*                                                                            *|
0017 \*===----------------------------------------------------------------------===*/
0018 
0019 #ifndef LLVM_C_BITREADER_H
0020 #define LLVM_C_BITREADER_H
0021 
0022 #include "llvm-c/ExternC.h"
0023 #include "llvm-c/Types.h"
0024 
0025 LLVM_C_EXTERN_C_BEGIN
0026 
0027 /**
0028  * @defgroup LLVMCBitReader Bit Reader
0029  * @ingroup LLVMC
0030  *
0031  * @{
0032  */
0033 
0034 /* Builds a module from the bitcode in the specified memory buffer, returning a
0035    reference to the module via the OutModule parameter. Returns 0 on success.
0036    Optionally returns a human-readable error message via OutMessage.
0037 
0038    This is deprecated. Use LLVMParseBitcode2. */
0039 LLVMBool LLVMParseBitcode(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutModule,
0040                           char **OutMessage);
0041 
0042 /* Builds a module from the bitcode in the specified memory buffer, returning a
0043    reference to the module via the OutModule parameter. Returns 0 on success. */
0044 LLVMBool LLVMParseBitcode2(LLVMMemoryBufferRef MemBuf,
0045                            LLVMModuleRef *OutModule);
0046 
0047 /* This is deprecated. Use LLVMParseBitcodeInContext2. */
0048 LLVMBool LLVMParseBitcodeInContext(LLVMContextRef ContextRef,
0049                                    LLVMMemoryBufferRef MemBuf,
0050                                    LLVMModuleRef *OutModule, char **OutMessage);
0051 
0052 LLVMBool LLVMParseBitcodeInContext2(LLVMContextRef ContextRef,
0053                                     LLVMMemoryBufferRef MemBuf,
0054                                     LLVMModuleRef *OutModule);
0055 
0056 /** Reads a module from the specified path, returning via the OutMP parameter
0057     a module provider which performs lazy deserialization. Returns 0 on success.
0058     Optionally returns a human-readable error message via OutMessage.
0059     This is deprecated. Use LLVMGetBitcodeModuleInContext2. */
0060 LLVMBool LLVMGetBitcodeModuleInContext(LLVMContextRef ContextRef,
0061                                        LLVMMemoryBufferRef MemBuf,
0062                                        LLVMModuleRef *OutM, char **OutMessage);
0063 
0064 /** Reads a module from the given memory buffer, returning via the OutMP
0065  * parameter a module provider which performs lazy deserialization.
0066  *
0067  * Returns 0 on success.
0068  *
0069  * Takes ownership of \p MemBuf if (and only if) the module was read
0070  * successfully. */
0071 LLVMBool LLVMGetBitcodeModuleInContext2(LLVMContextRef ContextRef,
0072                                         LLVMMemoryBufferRef MemBuf,
0073                                         LLVMModuleRef *OutM);
0074 
0075 /* This is deprecated. Use LLVMGetBitcodeModule2. */
0076 LLVMBool LLVMGetBitcodeModule(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM,
0077                               char **OutMessage);
0078 
0079 LLVMBool LLVMGetBitcodeModule2(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM);
0080 
0081 /**
0082  * @}
0083  */
0084 
0085 LLVM_C_EXTERN_C_END
0086 
0087 #endif