Comdat.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. typedef enum {
  24. LLVMAnyComdatSelectionKind, ///< The linker may choose any COMDAT.
  25. LLVMExactMatchComdatSelectionKind, ///< The data referenced by the COMDAT must
  26. ///< be the same.
  27. LLVMLargestComdatSelectionKind, ///< The linker will choose the largest
  28. ///< COMDAT.
  29. LLVMNoDuplicatesComdatSelectionKind, ///< No other Module may specify this
  30. ///< COMDAT.
  31. LLVMSameSizeComdatSelectionKind ///< The data referenced by the COMDAT must be
  32. ///< the same size.
  33. } LLVMComdatSelectionKind;
  34. /**
  35. * Return the Comdat in the module with the specified name. It is created
  36. * if it didn't already exist.
  37. *
  38. * @see llvm::Module::getOrInsertComdat()
  39. */
  40. LLVMComdatRef LLVMGetOrInsertComdat(LLVMModuleRef M, const char *Name);
  41. /**
  42. * Get the Comdat assigned to the given global object.
  43. *
  44. * @see llvm::GlobalObject::getComdat()
  45. */
  46. LLVMComdatRef LLVMGetComdat(LLVMValueRef V);
  47. /**
  48. * Assign the Comdat to the given global object.
  49. *
  50. * @see llvm::GlobalObject::setComdat()
  51. */
  52. void LLVMSetComdat(LLVMValueRef V, LLVMComdatRef C);
  53. /*
  54. * Get the conflict resolution selection kind for the Comdat.
  55. *
  56. * @see llvm::Comdat::getSelectionKind()
  57. */
  58. LLVMComdatSelectionKind LLVMGetComdatSelectionKind(LLVMComdatRef C);
  59. /*
  60. * Set the conflict resolution selection kind for the Comdat.
  61. *
  62. * @see llvm::Comdat::setSelectionKind()
  63. */
  64. void LLVMSetComdatSelectionKind(LLVMComdatRef C, LLVMComdatSelectionKind Kind);
  65. LLVM_C_EXTERN_C_END
  66. #endif
  67. #ifdef __GNUC__
  68. #pragma GCC diagnostic pop
  69. #endif