1 /*===-- llvm-c/Support.h - C Interface Types declarations ---------*- 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 types used by the C interface to LLVM. *|
12 \*===----------------------------------------------------------------------===*/
14 #ifndef LLVM_C_TYPES_H
15 #define LLVM_C_TYPES_H
17 #include "llvm-c/DataTypes.h"
18 #include "llvm-c/ExternC.h"
23 * @defgroup LLVMCSupportTypes Types and Enumerations
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).
44 * Used to pass regions of memory through LLVM interfaces.
46 * @see llvm::MemoryBuffer
48 typedef struct LLVMOpaqueMemoryBuffer
*LLVMMemoryBufferRef
;
51 * The top-level container for all LLVM global data. See the LLVMContext class.
53 typedef struct LLVMOpaqueContext
*LLVMContextRef
;
56 * The top-level container for all other LLVM Intermediate Representation (IR)
61 typedef struct LLVMOpaqueModule
*LLVMModuleRef
;
64 * Each value in the LLVM IR has a type, an LLVMTypeRef.
68 typedef struct LLVMOpaqueType
*LLVMTypeRef
;
71 * Represents an individual value in LLVM IR.
73 * This models llvm::Value.
75 typedef struct LLVMOpaqueValue
*LLVMValueRef
;
78 * Represents a basic block of instructions in LLVM IR.
80 * This models llvm::BasicBlock.
82 typedef struct LLVMOpaqueBasicBlock
*LLVMBasicBlockRef
;
85 * Represents an LLVM Metadata.
87 * This models llvm::Metadata.
89 typedef struct LLVMOpaqueMetadata
*LLVMMetadataRef
;
92 * Represents an LLVM Named Metadata Node.
94 * This models llvm::NamedMDNode.
96 typedef struct LLVMOpaqueNamedMDNode
*LLVMNamedMDNodeRef
;
99 * Represents an entry in a Global Object's metadata attachments.
101 * This models std::pair<unsigned, MDNode *>
103 typedef struct LLVMOpaqueValueMetadataEntry LLVMValueMetadataEntry
;
106 * Represents an LLVM basic block builder.
108 * This models llvm::IRBuilder.
110 typedef struct LLVMOpaqueBuilder
*LLVMBuilderRef
;
113 * Represents an LLVM debug info builder.
115 * This models llvm::DIBuilder.
117 typedef struct LLVMOpaqueDIBuilder
*LLVMDIBuilderRef
;
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.
124 typedef struct LLVMOpaqueModuleProvider
*LLVMModuleProviderRef
;
126 /** @see llvm::PassManagerBase */
127 typedef struct LLVMOpaquePassManager
*LLVMPassManagerRef
;
130 * Used to get the users and usees of a Value.
133 typedef struct LLVMOpaqueUse
*LLVMUseRef
;
136 * @see llvm::OperandBundleDef
138 typedef struct LLVMOpaqueOperandBundle
*LLVMOperandBundleRef
;
141 * Used to represent an attributes.
143 * @see llvm::Attribute
145 typedef struct LLVMOpaqueAttributeRef
*LLVMAttributeRef
;
148 * @see llvm::DiagnosticInfo
150 typedef struct LLVMOpaqueDiagnosticInfo
*LLVMDiagnosticInfoRef
;
155 typedef struct LLVMComdat
*LLVMComdatRef
;
158 * @see llvm::Module::ModuleFlagEntry
160 typedef struct LLVMOpaqueModuleFlagEntry LLVMModuleFlagEntry
;
163 * @see llvm::JITEventListener
165 typedef struct LLVMOpaqueJITEventListener
*LLVMJITEventListenerRef
;
168 * @see llvm::object::Binary
170 typedef struct LLVMOpaqueBinary
*LLVMBinaryRef
;
173 * @see llvm::DbgRecord
175 typedef struct LLVMOpaqueDbgRecord
*LLVMDbgRecordRef
;