[lit] Add argument check: --timeout must be non-negative integer
[llvm-core.git] / include / llvm-c / BitReader.h
blobb307ee979f8a3986eb1553288cd6017fe7c906cb
1 /*===-- llvm-c/BitReader.h - BitReader Library C Interface ------*- C++ -*-===*\
2 |* *|
3 |* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|
4 |* Exceptions. *|
5 |* See https://llvm.org/LICENSE.txt for license information. *|
6 |* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|
7 |* *|
8 |*===----------------------------------------------------------------------===*|
9 |* *|
10 |* This header declares the C interface to libLLVMBitReader.a, which *|
11 |* implements input of the LLVM bitcode format. *|
12 |* *|
13 |* Many exotic languages can interoperate with C code but have a harder time *|
14 |* with C++ due to name mangling. So in addition to C, this interface enables *|
15 |* tools written in such languages. *|
16 |* *|
17 \*===----------------------------------------------------------------------===*/
19 #ifndef LLVM_C_BITREADER_H
20 #define LLVM_C_BITREADER_H
22 #include "llvm-c/Types.h"
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
28 /**
29 * @defgroup LLVMCBitReader Bit Reader
30 * @ingroup LLVMC
32 * @{
35 /* Builds a module from the bitcode in the specified memory buffer, returning a
36 reference to the module via the OutModule parameter. Returns 0 on success.
37 Optionally returns a human-readable error message via OutMessage.
39 This is deprecated. Use LLVMParseBitcode2. */
40 LLVMBool LLVMParseBitcode(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutModule,
41 char **OutMessage);
43 /* Builds a module from the bitcode in the specified memory buffer, returning a
44 reference to the module via the OutModule parameter. Returns 0 on success. */
45 LLVMBool LLVMParseBitcode2(LLVMMemoryBufferRef MemBuf,
46 LLVMModuleRef *OutModule);
48 /* This is deprecated. Use LLVMParseBitcodeInContext2. */
49 LLVMBool LLVMParseBitcodeInContext(LLVMContextRef ContextRef,
50 LLVMMemoryBufferRef MemBuf,
51 LLVMModuleRef *OutModule, char **OutMessage);
53 LLVMBool LLVMParseBitcodeInContext2(LLVMContextRef ContextRef,
54 LLVMMemoryBufferRef MemBuf,
55 LLVMModuleRef *OutModule);
57 /** Reads a module from the specified path, returning via the OutMP parameter
58 a module provider which performs lazy deserialization. Returns 0 on success.
59 Optionally returns a human-readable error message via OutMessage.
60 This is deprecated. Use LLVMGetBitcodeModuleInContext2. */
61 LLVMBool LLVMGetBitcodeModuleInContext(LLVMContextRef ContextRef,
62 LLVMMemoryBufferRef MemBuf,
63 LLVMModuleRef *OutM, char **OutMessage);
65 /** Reads a module from the specified path, returning via the OutMP parameter a
66 * module provider which performs lazy deserialization. Returns 0 on success. */
67 LLVMBool LLVMGetBitcodeModuleInContext2(LLVMContextRef ContextRef,
68 LLVMMemoryBufferRef MemBuf,
69 LLVMModuleRef *OutM);
71 /* This is deprecated. Use LLVMGetBitcodeModule2. */
72 LLVMBool LLVMGetBitcodeModule(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM,
73 char **OutMessage);
75 LLVMBool LLVMGetBitcodeModule2(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM);
77 /**
78 * @}
81 #ifdef __cplusplus
83 #endif
85 #endif