Utils.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. /*===-- Utils.h - Transformation Utils 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 libLLVMTransformUtils.a, which *|
  16. |* implements various transformation utilities of the LLVM IR. *|
  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_TRANSFORMS_UTILS_H
  24. #define LLVM_C_TRANSFORMS_UTILS_H
  25. #include "llvm-c/ExternC.h"
  26. #include "llvm-c/Types.h"
  27. LLVM_C_EXTERN_C_BEGIN
  28. /**
  29. * @defgroup LLVMCTransformsUtils Transformation Utilities
  30. * @ingroup LLVMCTransforms
  31. *
  32. * @{
  33. */
  34. /** See llvm::createLowerSwitchPass function. */
  35. void LLVMAddLowerSwitchPass(LLVMPassManagerRef PM);
  36. /** See llvm::createPromoteMemoryToRegisterPass function. */
  37. void LLVMAddPromoteMemoryToRegisterPass(LLVMPassManagerRef PM);
  38. /** See llvm::createAddDiscriminatorsPass function. */
  39. void LLVMAddAddDiscriminatorsPass(LLVMPassManagerRef PM);
  40. /**
  41. * @}
  42. */
  43. LLVM_C_EXTERN_C_END
  44. #endif
  45. #ifdef __GNUC__
  46. #pragma GCC diagnostic pop
  47. #endif