BitReader.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. /*===-- llvm-c/BitReader.h - BitReader Library C Interface ------*- C++ -*-===*\
  7. |* *|
  8. |* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|
  9. |* Exceptions. *|
  10. |* See https://llvm.org/LICENSE.txt for license information. *|
  11. |* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|
  12. |* *|
  13. |*===----------------------------------------------------------------------===*|
  14. |* *|
  15. |* This header declares the C interface to libLLVMBitReader.a, which *|
  16. |* implements input of the LLVM bitcode format. *|
  17. |* *|
  18. |* Many exotic languages can interoperate with C code but have a harder time *|
  19. |* with C++ due to name mangling. So in addition to C, this interface enables *|
  20. |* tools written in such languages. *|
  21. |* *|
  22. \*===----------------------------------------------------------------------===*/
  23. #ifndef LLVM_C_BITREADER_H
  24. #define LLVM_C_BITREADER_H
  25. #include "llvm-c/ExternC.h"
  26. #include "llvm-c/Types.h"
  27. LLVM_C_EXTERN_C_BEGIN
  28. /**
  29. * @defgroup LLVMCBitReader Bit Reader
  30. * @ingroup LLVMC
  31. *
  32. * @{
  33. */
  34. /* Builds a module from the bitcode in the specified memory buffer, returning a
  35. reference to the module via the OutModule parameter. Returns 0 on success.
  36. Optionally returns a human-readable error message via OutMessage.
  37. This is deprecated. Use LLVMParseBitcode2. */
  38. LLVMBool LLVMParseBitcode(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutModule,
  39. char **OutMessage);
  40. /* Builds a module from the bitcode in the specified memory buffer, returning a
  41. reference to the module via the OutModule parameter. Returns 0 on success. */
  42. LLVMBool LLVMParseBitcode2(LLVMMemoryBufferRef MemBuf,
  43. LLVMModuleRef *OutModule);
  44. /* This is deprecated. Use LLVMParseBitcodeInContext2. */
  45. LLVMBool LLVMParseBitcodeInContext(LLVMContextRef ContextRef,
  46. LLVMMemoryBufferRef MemBuf,
  47. LLVMModuleRef *OutModule, char **OutMessage);
  48. LLVMBool LLVMParseBitcodeInContext2(LLVMContextRef ContextRef,
  49. LLVMMemoryBufferRef MemBuf,
  50. LLVMModuleRef *OutModule);
  51. /** Reads a module from the specified path, returning via the OutMP parameter
  52. a module provider which performs lazy deserialization. Returns 0 on success.
  53. Optionally returns a human-readable error message via OutMessage.
  54. This is deprecated. Use LLVMGetBitcodeModuleInContext2. */
  55. LLVMBool LLVMGetBitcodeModuleInContext(LLVMContextRef ContextRef,
  56. LLVMMemoryBufferRef MemBuf,
  57. LLVMModuleRef *OutM, char **OutMessage);
  58. /** Reads a module from the specified path, returning via the OutMP parameter a
  59. * module provider which performs lazy deserialization. Returns 0 on success. */
  60. LLVMBool LLVMGetBitcodeModuleInContext2(LLVMContextRef ContextRef,
  61. LLVMMemoryBufferRef MemBuf,
  62. LLVMModuleRef *OutM);
  63. /* This is deprecated. Use LLVMGetBitcodeModule2. */
  64. LLVMBool LLVMGetBitcodeModule(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM,
  65. char **OutMessage);
  66. LLVMBool LLVMGetBitcodeModule2(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM);
  67. /**
  68. * @}
  69. */
  70. LLVM_C_EXTERN_C_END
  71. #endif
  72. #ifdef __GNUC__
  73. #pragma GCC diagnostic pop
  74. #endif