LLVM 19.0.0git
Types.h
Go to the documentation of this file.
1/*===-- llvm-c/Support.h - C Interface Types declarations ---------*- 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 types used by the C interface to LLVM. *|
11|* *|
12\*===----------------------------------------------------------------------===*/
13
14#ifndef LLVM_C_TYPES_H
15#define LLVM_C_TYPES_H
16
17#include "llvm-c/DataTypes.h"
18#include "llvm-c/ExternC.h"
19
21
22/**
23 * @defgroup LLVMCSupportTypes Types and Enumerations
24 *
25 * @{
26 */
27
28typedef int LLVMBool;
29
30/* Opaque types. */
31
32/**
33 * LLVM uses a polymorphic type hierarchy which C cannot represent, therefore
34 * parameters must be passed as base types. Despite the declared types, most
35 * of the functions provided operate only on branches of the type hierarchy.
36 * The declared parameter names are descriptive and specify which type is
37 * required. Additionally, each type hierarchy is documented along with the
38 * functions that operate upon it. For more detail, refer to LLVM's C++ code.
39 * If in doubt, refer to Core.cpp, which performs parameter downcasts in the
40 * form unwrap<RequiredType>(Param).
41 */
42
43/**
44 * Used to pass regions of memory through LLVM interfaces.
45 *
46 * @see llvm::MemoryBuffer
47 */
48typedef struct LLVMOpaqueMemoryBuffer *LLVMMemoryBufferRef;
49
50/**
51 * The top-level container for all LLVM global data. See the LLVMContext class.
52 */
53typedef struct LLVMOpaqueContext *LLVMContextRef;
54
55/**
56 * The top-level container for all other LLVM Intermediate Representation (IR)
57 * objects.
58 *
59 * @see llvm::Module
60 */
61typedef struct LLVMOpaqueModule *LLVMModuleRef;
62
63/**
64 * Each value in the LLVM IR has a type, an LLVMTypeRef.
65 *
66 * @see llvm::Type
67 */
68typedef struct LLVMOpaqueType *LLVMTypeRef;
69
70/**
71 * Represents an individual value in LLVM IR.
72 *
73 * This models llvm::Value.
74 */
75typedef struct LLVMOpaqueValue *LLVMValueRef;
76
77/**
78 * Represents a basic block of instructions in LLVM IR.
79 *
80 * This models llvm::BasicBlock.
81 */
82typedef struct LLVMOpaqueBasicBlock *LLVMBasicBlockRef;
83
84/**
85 * Represents an LLVM Metadata.
86 *
87 * This models llvm::Metadata.
88 */
89typedef struct LLVMOpaqueMetadata *LLVMMetadataRef;
90
91/**
92 * Represents an LLVM Named Metadata Node.
93 *
94 * This models llvm::NamedMDNode.
95 */
96typedef struct LLVMOpaqueNamedMDNode *LLVMNamedMDNodeRef;
97
98/**
99 * Represents an entry in a Global Object's metadata attachments.
100 *
101 * This models std::pair<unsigned, MDNode *>
102 */
104
105/**
106 * Represents an LLVM basic block builder.
107 *
108 * This models llvm::IRBuilder.
109 */
110typedef struct LLVMOpaqueBuilder *LLVMBuilderRef;
111
112/**
113 * Represents an LLVM debug info builder.
114 *
115 * This models llvm::DIBuilder.
116 */
117typedef struct LLVMOpaqueDIBuilder *LLVMDIBuilderRef;
118
119/**
120 * Interface used to provide a module to JIT or interpreter.
121 * This is now just a synonym for llvm::Module, but we have to keep using the
122 * different type to keep binary compatibility.
123 */
124typedef struct LLVMOpaqueModuleProvider *LLVMModuleProviderRef;
125
126/** @see llvm::PassManagerBase */
127typedef struct LLVMOpaquePassManager *LLVMPassManagerRef;
128
129/**
130 * Used to get the users and usees of a Value.
131 *
132 * @see llvm::Use */
133typedef struct LLVMOpaqueUse *LLVMUseRef;
134
135/**
136 * @see llvm::OperandBundleDef
137 */
138typedef struct LLVMOpaqueOperandBundle *LLVMOperandBundleRef;
139
140/**
141 * Used to represent an attributes.
142 *
143 * @see llvm::Attribute
144 */
145typedef struct LLVMOpaqueAttributeRef *LLVMAttributeRef;
146
147/**
148 * @see llvm::DiagnosticInfo
149 */
150typedef struct LLVMOpaqueDiagnosticInfo *LLVMDiagnosticInfoRef;
151
152/**
153 * @see llvm::Comdat
154 */
155typedef struct LLVMComdat *LLVMComdatRef;
156
157/**
158 * @see llvm::Module::ModuleFlagEntry
159 */
161
162/**
163 * @see llvm::JITEventListener
164 */
165typedef struct LLVMOpaqueJITEventListener *LLVMJITEventListenerRef;
166
167/**
168 * @see llvm::object::Binary
169 */
170typedef struct LLVMOpaqueBinary *LLVMBinaryRef;
171
172/**
173 * @}
174 */
175
177
178#endif
#define LLVM_C_EXTERN_C_BEGIN
Definition: ExternC.h:35
#define LLVM_C_EXTERN_C_END
Definition: ExternC.h:36
struct LLVMOpaqueValue * LLVMValueRef
Represents an individual value in LLVM IR.
Definition: Types.h:75
struct LLVMOpaqueAttributeRef * LLVMAttributeRef
Used to represent an attributes.
Definition: Types.h:145
int LLVMBool
Definition: Types.h:28
struct LLVMOpaqueNamedMDNode * LLVMNamedMDNodeRef
Represents an LLVM Named Metadata Node.
Definition: Types.h:96
struct LLVMOpaquePassManager * LLVMPassManagerRef
Definition: Types.h:127
struct LLVMOpaqueBinary * LLVMBinaryRef
Definition: Types.h:170
struct LLVMOpaqueDiagnosticInfo * LLVMDiagnosticInfoRef
Definition: Types.h:150
struct LLVMOpaqueMemoryBuffer * LLVMMemoryBufferRef
LLVM uses a polymorphic type hierarchy which C cannot represent, therefore parameters must be passed ...
Definition: Types.h:48
struct LLVMOpaqueContext * LLVMContextRef
The top-level container for all LLVM global data.
Definition: Types.h:53
struct LLVMComdat * LLVMComdatRef
Definition: Types.h:155
struct LLVMOpaqueBuilder * LLVMBuilderRef
Represents an LLVM basic block builder.
Definition: Types.h:110
struct LLVMOpaqueUse * LLVMUseRef
Used to get the users and usees of a Value.
Definition: Types.h:133
struct LLVMOpaqueBasicBlock * LLVMBasicBlockRef
Represents a basic block of instructions in LLVM IR.
Definition: Types.h:82
struct LLVMOpaqueType * LLVMTypeRef
Each value in the LLVM IR has a type, an LLVMTypeRef.
Definition: Types.h:68
struct LLVMOpaqueMetadata * LLVMMetadataRef
Represents an LLVM Metadata.
Definition: Types.h:89
struct LLVMOpaqueModule * LLVMModuleRef
The top-level container for all other LLVM Intermediate Representation (IR) objects.
Definition: Types.h:61
struct LLVMOpaqueJITEventListener * LLVMJITEventListenerRef
Definition: Types.h:165
struct LLVMOpaqueModuleProvider * LLVMModuleProviderRef
Interface used to provide a module to JIT or interpreter.
Definition: Types.h:124
struct LLVMOpaqueDIBuilder * LLVMDIBuilderRef
Represents an LLVM debug info builder.
Definition: Types.h:117
struct LLVMOpaqueOperandBundle * LLVMOperandBundleRef
Definition: Types.h:138