IPO.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. /*===-- IPO.h - Interprocedural Transformations 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 libLLVMIPO.a, which implements *|
  16. |* various interprocedural transformations of the LLVM IR. *|
  17. |* *|
  18. \*===----------------------------------------------------------------------===*/
  19. #ifndef LLVM_C_TRANSFORMS_IPO_H
  20. #define LLVM_C_TRANSFORMS_IPO_H
  21. #include "llvm-c/ExternC.h"
  22. #include "llvm-c/Types.h"
  23. LLVM_C_EXTERN_C_BEGIN
  24. /**
  25. * @defgroup LLVMCTransformsIPO Interprocedural transformations
  26. * @ingroup LLVMCTransforms
  27. *
  28. * @{
  29. */
  30. /** See llvm::createConstantMergePass function. */
  31. void LLVMAddConstantMergePass(LLVMPassManagerRef PM);
  32. /** See llvm::createMergeFunctionsPass function. */
  33. void LLVMAddMergeFunctionsPass(LLVMPassManagerRef PM);
  34. /** See llvm::createCalledValuePropagationPass function. */
  35. void LLVMAddCalledValuePropagationPass(LLVMPassManagerRef PM);
  36. /** See llvm::createDeadArgEliminationPass function. */
  37. void LLVMAddDeadArgEliminationPass(LLVMPassManagerRef PM);
  38. /** See llvm::createFunctionAttrsPass function. */
  39. void LLVMAddFunctionAttrsPass(LLVMPassManagerRef PM);
  40. /** See llvm::createFunctionInliningPass function. */
  41. void LLVMAddFunctionInliningPass(LLVMPassManagerRef PM);
  42. /** See llvm::createAlwaysInlinerPass function. */
  43. void LLVMAddAlwaysInlinerPass(LLVMPassManagerRef PM);
  44. /** See llvm::createGlobalDCEPass function. */
  45. void LLVMAddGlobalDCEPass(LLVMPassManagerRef PM);
  46. /** See llvm::createGlobalOptimizerPass function. */
  47. void LLVMAddGlobalOptimizerPass(LLVMPassManagerRef PM);
  48. /** See llvm::createIPSCCPPass function. */
  49. void LLVMAddIPSCCPPass(LLVMPassManagerRef PM);
  50. /** See llvm::createInternalizePass function. */
  51. void LLVMAddInternalizePass(LLVMPassManagerRef, unsigned AllButMain);
  52. /**
  53. * Create and add the internalize pass to the given pass manager with the
  54. * provided preservation callback.
  55. *
  56. * The context parameter is forwarded to the callback on each invocation.
  57. * As such, it is the responsibility of the caller to extend its lifetime
  58. * until execution of this pass has finished.
  59. *
  60. * @see llvm::createInternalizePass function.
  61. */
  62. void LLVMAddInternalizePassWithMustPreservePredicate(
  63. LLVMPassManagerRef PM,
  64. void *Context,
  65. LLVMBool (*MustPreserve)(LLVMValueRef, void *));
  66. /** See llvm::createStripDeadPrototypesPass function. */
  67. void LLVMAddStripDeadPrototypesPass(LLVMPassManagerRef PM);
  68. /** See llvm::createStripSymbolsPass function. */
  69. void LLVMAddStripSymbolsPass(LLVMPassManagerRef PM);
  70. /**
  71. * @}
  72. */
  73. LLVM_C_EXTERN_C_END
  74. #endif
  75. #ifdef __GNUC__
  76. #pragma GCC diagnostic pop
  77. #endif