Path: blob/main/contrib/llvm-project/llvm/include/llvm-c/BitReader.h
35233 views
/*===-- llvm-c/BitReader.h - BitReader Library C Interface ------*- C++ -*-===*\1|* *|2|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|3|* Exceptions. *|4|* See https://llvm.org/LICENSE.txt for license information. *|5|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|6|* *|7|*===----------------------------------------------------------------------===*|8|* *|9|* This header declares the C interface to libLLVMBitReader.a, which *|10|* implements input of the LLVM bitcode format. *|11|* *|12|* Many exotic languages can interoperate with C code but have a harder time *|13|* with C++ due to name mangling. So in addition to C, this interface enables *|14|* tools written in such languages. *|15|* *|16\*===----------------------------------------------------------------------===*/1718#ifndef LLVM_C_BITREADER_H19#define LLVM_C_BITREADER_H2021#include "llvm-c/ExternC.h"22#include "llvm-c/Types.h"2324LLVM_C_EXTERN_C_BEGIN2526/**27* @defgroup LLVMCBitReader Bit Reader28* @ingroup LLVMC29*30* @{31*/3233/* Builds a module from the bitcode in the specified memory buffer, returning a34reference to the module via the OutModule parameter. Returns 0 on success.35Optionally returns a human-readable error message via OutMessage.3637This is deprecated. Use LLVMParseBitcode2. */38LLVMBool LLVMParseBitcode(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutModule,39char **OutMessage);4041/* Builds a module from the bitcode in the specified memory buffer, returning a42reference to the module via the OutModule parameter. Returns 0 on success. */43LLVMBool LLVMParseBitcode2(LLVMMemoryBufferRef MemBuf,44LLVMModuleRef *OutModule);4546/* This is deprecated. Use LLVMParseBitcodeInContext2. */47LLVMBool LLVMParseBitcodeInContext(LLVMContextRef ContextRef,48LLVMMemoryBufferRef MemBuf,49LLVMModuleRef *OutModule, char **OutMessage);5051LLVMBool LLVMParseBitcodeInContext2(LLVMContextRef ContextRef,52LLVMMemoryBufferRef MemBuf,53LLVMModuleRef *OutModule);5455/** Reads a module from the specified path, returning via the OutMP parameter56a module provider which performs lazy deserialization. Returns 0 on success.57Optionally returns a human-readable error message via OutMessage.58This is deprecated. Use LLVMGetBitcodeModuleInContext2. */59LLVMBool LLVMGetBitcodeModuleInContext(LLVMContextRef ContextRef,60LLVMMemoryBufferRef MemBuf,61LLVMModuleRef *OutM, char **OutMessage);6263/** Reads a module from the given memory buffer, returning via the OutMP64* parameter a module provider which performs lazy deserialization.65*66* Returns 0 on success.67*68* Takes ownership of \p MemBuf if (and only if) the module was read69* successfully. */70LLVMBool LLVMGetBitcodeModuleInContext2(LLVMContextRef ContextRef,71LLVMMemoryBufferRef MemBuf,72LLVMModuleRef *OutM);7374/* This is deprecated. Use LLVMGetBitcodeModule2. */75LLVMBool LLVMGetBitcodeModule(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM,76char **OutMessage);7778LLVMBool LLVMGetBitcodeModule2(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM);7980/**81* @}82*/8384LLVM_C_EXTERN_C_END8586#endif878889