Support.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. /*===-- llvm-c/Support.h - Support 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 file defines the C interface to the LLVM support library. *|
  16. |* *|
  17. \*===----------------------------------------------------------------------===*/
  18. #ifndef LLVM_C_SUPPORT_H
  19. #define LLVM_C_SUPPORT_H
  20. #include "llvm-c/DataTypes.h"
  21. #include "llvm-c/ExternC.h"
  22. #include "llvm-c/Types.h"
  23. LLVM_C_EXTERN_C_BEGIN
  24. /**
  25. * @addtogroup LLVMCCore
  26. *
  27. * @{
  28. */
  29. /**
  30. * This function permanently loads the dynamic library at the given path.
  31. * It is safe to call this function multiple times for the same library.
  32. *
  33. * @see sys::DynamicLibrary::LoadLibraryPermanently()
  34. */
  35. LLVMBool LLVMLoadLibraryPermanently(const char* Filename);
  36. /**
  37. * This function parses the given arguments using the LLVM command line parser.
  38. * Note that the only stable thing about this function is its signature; you
  39. * cannot rely on any particular set of command line arguments being interpreted
  40. * the same way across LLVM versions.
  41. *
  42. * @see llvm::cl::ParseCommandLineOptions()
  43. */
  44. void LLVMParseCommandLineOptions(int argc, const char *const *argv,
  45. const char *Overview);
  46. /**
  47. * This function will search through all previously loaded dynamic
  48. * libraries for the symbol \p symbolName. If it is found, the address of
  49. * that symbol is returned. If not, null is returned.
  50. *
  51. * @see sys::DynamicLibrary::SearchForAddressOfSymbol()
  52. */
  53. void *LLVMSearchForAddressOfSymbol(const char *symbolName);
  54. /**
  55. * This functions permanently adds the symbol \p symbolName with the
  56. * value \p symbolValue. These symbols are searched before any
  57. * libraries.
  58. *
  59. * @see sys::DynamicLibrary::AddSymbol()
  60. */
  61. void LLVMAddSymbol(const char *symbolName, void *symbolValue);
  62. /**
  63. * @}
  64. */
  65. LLVM_C_EXTERN_C_END
  66. #endif
  67. #ifdef __GNUC__
  68. #pragma GCC diagnostic pop
  69. #endif