LLVM 22.0.0git
Comdat.h
Go to the documentation of this file.
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\*===----------------------------------------------------------------------===*/
13
14#ifndef LLVM_C_COMDAT_H
15#define LLVM_C_COMDAT_H
16
17#include "llvm-c/ExternC.h"
18#include "llvm-c/Types.h"
19#include "llvm-c/Visibility.h"
20
22
23/**
24 * @defgroup LLVMCCoreComdat Comdats
25 * @ingroup LLVMCCore
26 *
27 * @{
28 */
29
30typedef enum {
31 LLVMAnyComdatSelectionKind, ///< The linker may choose any COMDAT.
32 LLVMExactMatchComdatSelectionKind, ///< The data referenced by the COMDAT must
33 ///< be the same.
34 LLVMLargestComdatSelectionKind, ///< The linker will choose the largest
35 ///< COMDAT.
36 LLVMNoDeduplicateComdatSelectionKind, ///< No deduplication is performed.
37 LLVMSameSizeComdatSelectionKind ///< The data referenced by the COMDAT must be
38 ///< the same size.
40
41/**
42 * Return the Comdat in the module with the specified name. It is created
43 * if it didn't already exist.
44 *
45 * @see llvm::Module::getOrInsertComdat()
46 */
48 const char *Name);
49
50/**
51 * Get the Comdat assigned to the given global object.
52 *
53 * @see llvm::GlobalObject::getComdat()
54 */
56
57/**
58 * Assign the Comdat to the given global object.
59 *
60 * @see llvm::GlobalObject::setComdat()
61 */
63
64/*
65 * Get the conflict resolution selection kind for the Comdat.
66 *
67 * @see llvm::Comdat::getSelectionKind()
68 */
70
71/*
72 * Set the conflict resolution selection kind for the Comdat.
73 *
74 * @see llvm::Comdat::setSelectionKind()
75 */
78
79/**
80 * @}
81 */
82
84
85#endif
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
std::string Name
#define LLVM_C_EXTERN_C_BEGIN
Definition: ExternC.h:35
#define LLVM_C_EXTERN_C_END
Definition: ExternC.h:36
#define LLVM_C_ABI
LLVM_C_ABI is the export/visibility macro used to mark symbols declared in llvm-c as exported when bu...
Definition: Visibility.h:40
LLVM_C_ABI void LLVMSetComdat(LLVMValueRef V, LLVMComdatRef C)
Assign the Comdat to the given global object.
Definition: Comdat.cpp:43
LLVM_C_ABI LLVMComdatSelectionKind LLVMGetComdatSelectionKind(LLVMComdatRef C)
Definition: Comdat.cpp:48
LLVM_C_ABI void LLVMSetComdatSelectionKind(LLVMComdatRef C, LLVMComdatSelectionKind Kind)
Definition: Comdat.cpp:64
LLVMComdatSelectionKind
Definition: Comdat.h:30
LLVM_C_ABI LLVMComdatRef LLVMGetComdat(LLVMValueRef V)
Get the Comdat assigned to the given global object.
Definition: Comdat.cpp:38
LLVM_C_ABI LLVMComdatRef LLVMGetOrInsertComdat(LLVMModuleRef M, const char *Name)
Return the Comdat in the module with the specified name.
Definition: Comdat.cpp:34
@ LLVMLargestComdatSelectionKind
The linker will choose the largest COMDAT.
Definition: Comdat.h:34
@ LLVMSameSizeComdatSelectionKind
The data referenced by the COMDAT must be the same size.
Definition: Comdat.h:37
@ LLVMExactMatchComdatSelectionKind
The data referenced by the COMDAT must be the same.
Definition: Comdat.h:32
@ LLVMAnyComdatSelectionKind
The linker may choose any COMDAT.
Definition: Comdat.h:31
@ LLVMNoDeduplicateComdatSelectionKind
No deduplication is performed.
Definition: Comdat.h:36
struct LLVMOpaqueValue * LLVMValueRef
Represents an individual value in LLVM IR.
Definition: Types.h:75
struct LLVMComdat * LLVMComdatRef
Definition: Types.h:155
struct LLVMOpaqueModule * LLVMModuleRef
The top-level container for all other LLVM Intermediate Representation (IR) objects.
Definition: Types.h:61