Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / include / llvm-c / Comdat.h
blob8002bc0581af758ad7489ab81dd3030b1d8b2252
1 /*===-- llvm-c/Comdat.h - Module Comdat C Interface -------------*- C++ -*-===*\
2 |* *|
3 |* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|
4 |* Exceptions. *|
5 |* See https://llvm.org/LICENSE.txt for license information. *|
6 |* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|
7 |* *|
8 |*===----------------------------------------------------------------------===*|
9 |* *|
10 |* This file defines the C interface to COMDAT. *|
11 |* *|
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"
20 LLVM_C_EXTERN_C_BEGIN
22 /**
23 * @defgroup LLVMCCoreComdat Comdats
24 * @ingroup LLVMCCore
26 * @{
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;
40 /**
41 * Return the Comdat in the module with the specified name. It is created
42 * if it didn't already exist.
44 * @see llvm::Module::getOrInsertComdat()
46 LLVMComdatRef LLVMGetOrInsertComdat(LLVMModuleRef M, const char *Name);
48 /**
49 * Get the Comdat assigned to the given global object.
51 * @see llvm::GlobalObject::getComdat()
53 LLVMComdatRef LLVMGetComdat(LLVMValueRef V);
55 /**
56 * Assign the Comdat to the given global object.
58 * @see llvm::GlobalObject::setComdat()
60 void LLVMSetComdat(LLVMValueRef V, LLVMComdatRef C);
63 * Get the conflict resolution selection kind for the Comdat.
65 * @see llvm::Comdat::getSelectionKind()
67 LLVMComdatSelectionKind LLVMGetComdatSelectionKind(LLVMComdatRef C);
70 * Set the conflict resolution selection kind for the Comdat.
72 * @see llvm::Comdat::setSelectionKind()
74 void LLVMSetComdatSelectionKind(LLVMComdatRef C, LLVMComdatSelectionKind Kind);
76 /**
77 * @}
80 LLVM_C_EXTERN_C_END
82 #endif