Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.0 KiB

  1. //===-- llvm/LinkTimeOptimizer.h - LTO Public 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 header provides a C API to use the LLVM link time optimization
  11. // library. This is intended to be used by linkers which are C-only in
  12. // their implementation for performing LTO.
  13. //
  14. //===----------------------------------------------------------------------===//
  15. #ifndef LLVM_C_LINKTIMEOPTIMIZER_H
  16. #define LLVM_C_LINKTIMEOPTIMIZER_H
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. /**
  21. * @defgroup LLVMCLinkTimeOptimizer Link Time Optimization
  22. * @ingroup LLVMC
  23. *
  24. * @{
  25. */
  26. /// This provides a dummy type for pointers to the LTO object.
  27. typedef void* llvm_lto_t;
  28. /// This provides a C-visible enumerator to manage status codes.
  29. /// This should map exactly onto the C++ enumerator LTOStatus.
  30. typedef enum llvm_lto_status {
  31. LLVM_LTO_UNKNOWN,
  32. LLVM_LTO_OPT_SUCCESS,
  33. LLVM_LTO_READ_SUCCESS,
  34. LLVM_LTO_READ_FAILURE,
  35. LLVM_LTO_WRITE_FAILURE,
  36. LLVM_LTO_NO_TARGET,
  37. LLVM_LTO_NO_WORK,
  38. LLVM_LTO_MODULE_MERGE_FAILURE,
  39. LLVM_LTO_ASM_FAILURE,
  40. // Added C-specific error codes
  41. LLVM_LTO_NULL_OBJECT
  42. } llvm_lto_status_t;
  43. /// This provides C interface to initialize link time optimizer. This allows
  44. /// linker to use dlopen() interface to dynamically load LinkTimeOptimizer.
  45. /// extern "C" helps, because dlopen() interface uses name to find the symbol.
  46. extern llvm_lto_t llvm_create_optimizer(void);
  47. extern void llvm_destroy_optimizer(llvm_lto_t lto);
  48. extern llvm_lto_status_t llvm_read_object_file
  49. (llvm_lto_t lto, const char* input_filename);
  50. extern llvm_lto_status_t llvm_optimize_modules
  51. (llvm_lto_t lto, const char* output_filename);
  52. /**
  53. * @}
  54. */
  55. #ifdef __cplusplus
  56. }
  57. #endif
  58. #endif