Comdat.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. /*===-- llvm-c/Comdat.h - Module Comdat 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 COMDAT. *|
  16. |* *|
  17. \*===----------------------------------------------------------------------===*/
  18. #ifndef LLVM_C_COMDAT_H
  19. #define LLVM_C_COMDAT_H
  20. #include "llvm-c/ExternC.h"
  21. #include "llvm-c/Types.h"
  22. LLVM_C_EXTERN_C_BEGIN
  23. /**
  24. * @defgroup LLVMCCoreComdat Comdats
  25. * @ingroup LLVMCCore
  26. *
  27. * @{
  28. */
  29. typedef enum {
  30. LLVMAnyComdatSelectionKind, ///< The linker may choose any COMDAT.
  31. LLVMExactMatchComdatSelectionKind, ///< The data referenced by the COMDAT must
  32. ///< be the same.
  33. LLVMLargestComdatSelectionKind, ///< The linker will choose the largest
  34. ///< COMDAT.
  35. LLVMNoDeduplicateComdatSelectionKind, ///< No deduplication is performed.
  36. LLVMSameSizeComdatSelectionKind ///< The data referenced by the COMDAT must be
  37. ///< the same size.
  38. } LLVMComdatSelectionKind;
  39. /**
  40. * Return the Comdat in the module with the specified name. It is created
  41. * if it didn't already exist.
  42. *
  43. * @see llvm::Module::getOrInsertComdat()
  44. */
  45. LLVMComdatRef LLVMGetOrInsertComdat(LLVMModuleRef M, const char *Name);
  46. /**
  47. * Get the Comdat assigned to the given global object.
  48. *
  49. * @see llvm::GlobalObject::getComdat()
  50. */
  51. LLVMComdatRef LLVMGetComdat(LLVMValueRef V);
  52. /**
  53. * Assign the Comdat to the given global object.
  54. *
  55. * @see llvm::GlobalObject::setComdat()
  56. */
  57. void LLVMSetComdat(LLVMValueRef V, LLVMComdatRef C);
  58. /*
  59. * Get the conflict resolution selection kind for the Comdat.
  60. *
  61. * @see llvm::Comdat::getSelectionKind()
  62. */
  63. LLVMComdatSelectionKind LLVMGetComdatSelectionKind(LLVMComdatRef C);
  64. /*
  65. * Set the conflict resolution selection kind for the Comdat.
  66. *
  67. * @see llvm::Comdat::setSelectionKind()
  68. */
  69. void LLVMSetComdatSelectionKind(LLVMComdatRef C, LLVMComdatSelectionKind Kind);
  70. /**
  71. * @}
  72. */
  73. LLVM_C_EXTERN_C_END
  74. #endif
  75. #ifdef __GNUC__
  76. #pragma GCC diagnostic pop
  77. #endif