BitWriter.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. /*===-- llvm-c/BitWriter.h - BitWriter 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 libLLVMBitWriter.a, which *|
  16. |* implements output 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_BITWRITER_H
  24. #define LLVM_C_BITWRITER_H
  25. #include "llvm-c/ExternC.h"
  26. #include "llvm-c/Types.h"
  27. LLVM_C_EXTERN_C_BEGIN
  28. /**
  29. * @defgroup LLVMCBitWriter Bit Writer
  30. * @ingroup LLVMC
  31. *
  32. * @{
  33. */
  34. /*===-- Operations on modules ---------------------------------------------===*/
  35. /** Writes a module to the specified path. Returns 0 on success. */
  36. int LLVMWriteBitcodeToFile(LLVMModuleRef M, const char *Path);
  37. /** Writes a module to an open file descriptor. Returns 0 on success. */
  38. int LLVMWriteBitcodeToFD(LLVMModuleRef M, int FD, int ShouldClose,
  39. int Unbuffered);
  40. /** Deprecated for LLVMWriteBitcodeToFD. Writes a module to an open file
  41. descriptor. Returns 0 on success. Closes the Handle. */
  42. int LLVMWriteBitcodeToFileHandle(LLVMModuleRef M, int Handle);
  43. /** Writes a module to a new memory buffer and returns it. */
  44. LLVMMemoryBufferRef LLVMWriteBitcodeToMemoryBuffer(LLVMModuleRef M);
  45. /**
  46. * @}
  47. */
  48. LLVM_C_EXTERN_C_END
  49. #endif
  50. #ifdef __GNUC__
  51. #pragma GCC diagnostic pop
  52. #endif