Support.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. * This function permanently loads the dynamic library at the given path.
  26. * It is safe to call this function multiple times for the same library.
  27. *
  28. * @see sys::DynamicLibrary::LoadLibraryPermanently()
  29. */
  30. LLVMBool LLVMLoadLibraryPermanently(const char* Filename);
  31. /**
  32. * This function parses the given arguments using the LLVM command line parser.
  33. * Note that the only stable thing about this function is its signature; you
  34. * cannot rely on any particular set of command line arguments being interpreted
  35. * the same way across LLVM versions.
  36. *
  37. * @see llvm::cl::ParseCommandLineOptions()
  38. */
  39. void LLVMParseCommandLineOptions(int argc, const char *const *argv,
  40. const char *Overview);
  41. /**
  42. * This function will search through all previously loaded dynamic
  43. * libraries for the symbol \p symbolName. If it is found, the address of
  44. * that symbol is returned. If not, null is returned.
  45. *
  46. * @see sys::DynamicLibrary::SearchForAddressOfSymbol()
  47. */
  48. void *LLVMSearchForAddressOfSymbol(const char *symbolName);
  49. /**
  50. * This functions permanently adds the symbol \p symbolName with the
  51. * value \p symbolValue. These symbols are searched before any
  52. * libraries.
  53. *
  54. * @see sys::DynamicLibrary::AddSymbol()
  55. */
  56. void LLVMAddSymbol(const char *symbolName, void *symbolValue);
  57. LLVM_C_EXTERN_C_END
  58. #endif
  59. #ifdef __GNUC__
  60. #pragma GCC diagnostic pop
  61. #endif