Support.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*===-- llvm-c/Support.h - Support C Interface --------------------*- C -*-===*\
  2. |* *|
  3. |* The LLVM Compiler Infrastructure *|
  4. |* *|
  5. |* This file is distributed under the University of Illinois Open Source *|
  6. |* License. See LICENSE.TXT for details. *|
  7. |* *|
  8. |*===----------------------------------------------------------------------===*|
  9. |* *|
  10. |* This file defines the C interface to the LLVM support library. *|
  11. |* *|
  12. \*===----------------------------------------------------------------------===*/
  13. #ifndef LLVM_C_SUPPORT_H
  14. #define LLVM_C_SUPPORT_H
  15. #include "llvm/Support/DataTypes.h"
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. /**
  20. * @defgroup LLVMCSupportTypes Types and Enumerations
  21. *
  22. * @{
  23. */
  24. typedef int LLVMBool;
  25. /**
  26. * Used to pass regions of memory through LLVM interfaces.
  27. *
  28. * @see llvm::MemoryBuffer
  29. */
  30. typedef struct LLVMOpaqueMemoryBuffer *LLVMMemoryBufferRef;
  31. /**
  32. * @}
  33. */
  34. /**
  35. * This function permanently loads the dynamic library at the given path.
  36. * It is safe to call this function multiple times for the same library.
  37. *
  38. * @see sys::DynamicLibrary::LoadLibraryPermanently()
  39. */
  40. LLVMBool LLVMLoadLibraryPermanently(const char* Filename);
  41. /**
  42. * This function parses the given arguments using the LLVM command line parser.
  43. * Note that the only stable thing about this function is its signature; you
  44. * cannot rely on any particular set of command line arguments being interpreted
  45. * the same way across LLVM versions.
  46. *
  47. * @see llvm::cl::ParseCommandLineOptions()
  48. */
  49. void LLVMParseCommandLineOptions(int argc, const char *const *argv,
  50. const char *Overview);
  51. /**
  52. * This function will search through all previously loaded dynamic
  53. * libraries for the symbol \p symbolName. If it is found, the address of
  54. * that symbol is returned. If not, null is returned.
  55. *
  56. * @see sys::DynamicLibrary::SearchForAddressOfSymbol()
  57. */
  58. void *LLVMSearchForAddressOfSymbol(const char *symbolName);
  59. /**
  60. * This functions permanently adds the symbol \p symbolName with the
  61. * value \p symbolValue. These symbols are searched before any
  62. * libraries.
  63. *
  64. * @see sys::DynamicLibrary::AddSymbol()
  65. */
  66. void LLVMAddSymbol(const char *symbolName, void *symbolValue);
  67. #ifdef __cplusplus
  68. }
  69. #endif
  70. #endif