Path: blob/main/contrib/llvm-project/llvm/include/llvm-c/BitWriter.h
35233 views
/*===-- llvm-c/BitWriter.h - BitWriter 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 libLLVMBitWriter.a, which *|10|* implements output 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_BITWRITER_H19#define LLVM_C_BITWRITER_H2021#include "llvm-c/ExternC.h"22#include "llvm-c/Types.h"2324LLVM_C_EXTERN_C_BEGIN2526/**27* @defgroup LLVMCBitWriter Bit Writer28* @ingroup LLVMC29*30* @{31*/3233/*===-- Operations on modules ---------------------------------------------===*/3435/** Writes a module to the specified path. Returns 0 on success. */36int LLVMWriteBitcodeToFile(LLVMModuleRef M, const char *Path);3738/** Writes a module to an open file descriptor. Returns 0 on success. */39int LLVMWriteBitcodeToFD(LLVMModuleRef M, int FD, int ShouldClose,40int Unbuffered);4142/** Deprecated for LLVMWriteBitcodeToFD. Writes a module to an open file43descriptor. Returns 0 on success. Closes the Handle. */44int LLVMWriteBitcodeToFileHandle(LLVMModuleRef M, int Handle);4546/** Writes a module to a new memory buffer and returns it. */47LLVMMemoryBufferRef LLVMWriteBitcodeToMemoryBuffer(LLVMModuleRef M);4849/**50* @}51*/5253LLVM_C_EXTERN_C_END5455#endif565758