1 /*===-- llvm-c/Comdat.h - Module Comdat C Interface -------------*- C++ -*-===*\
3 |* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|
5 |* See https://llvm.org/LICENSE.txt for license information. *|
6 |* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|
8 |*===----------------------------------------------------------------------===*|
10 |* This file defines the C interface to COMDAT. *|
12 \*===----------------------------------------------------------------------===*/
14 #ifndef LLVM_C_COMDAT_H
15 #define LLVM_C_COMDAT_H
17 #include "llvm-c/ExternC.h"
18 #include "llvm-c/Types.h"
23 LLVMAnyComdatSelectionKind, ///< The linker may choose any COMDAT.
24 LLVMExactMatchComdatSelectionKind, ///< The data referenced by the COMDAT must
26 LLVMLargestComdatSelectionKind, ///< The linker will choose the largest
28 LLVMNoDuplicatesComdatSelectionKind, ///< No other Module may specify this
30 LLVMSameSizeComdatSelectionKind ///< The data referenced by the COMDAT must be
32 } LLVMComdatSelectionKind;
35 * Return the Comdat in the module with the specified name. It is created
36 * if it didn't already exist.
38 * @see llvm::Module::getOrInsertComdat()
40 LLVMComdatRef LLVMGetOrInsertComdat(LLVMModuleRef M, const char *Name);
43 * Get the Comdat assigned to the given global object.
45 * @see llvm::GlobalObject::getComdat()
47 LLVMComdatRef LLVMGetComdat(LLVMValueRef V);
50 * Assign the Comdat to the given global object.
52 * @see llvm::GlobalObject::setComdat()
54 void LLVMSetComdat(LLVMValueRef V, LLVMComdatRef C);
57 * Get the conflict resolution selection kind for the Comdat.
59 * @see llvm::Comdat::getSelectionKind()
61 LLVMComdatSelectionKind LLVMGetComdatSelectionKind(LLVMComdatRef C);
64 * Set the conflict resolution selection kind for the Comdat.
66 * @see llvm::Comdat::setSelectionKind()
68 void LLVMSetComdatSelectionKind(LLVMComdatRef C, LLVMComdatSelectionKind Kind);