[InstCombine] Signed saturation tests. NFC
[llvm-complete.git] / include / llvm-c / Types.h
blob612c7d3eff32df94dab626ea2a660799fd0fb623
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 \*===----------------------------------------------------------------------===*/
14 #ifndef LLVM_C_TYPES_H
15 #define LLVM_C_TYPES_H
17 #include "llvm-c/DataTypes.h"
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
23 /**
24 * @defgroup LLVMCSupportTypes Types and Enumerations
26 * @{
29 typedef int LLVMBool;
31 /* Opaque types. */
33 /**
34 * LLVM uses a polymorphic type hierarchy which C cannot represent, therefore
35 * parameters must be passed as base types. Despite the declared types, most
36 * of the functions provided operate only on branches of the type hierarchy.
37 * The declared parameter names are descriptive and specify which type is
38 * required. Additionally, each type hierarchy is documented along with the
39 * functions that operate upon it. For more detail, refer to LLVM's C++ code.
40 * If in doubt, refer to Core.cpp, which performs parameter downcasts in the
41 * form unwrap<RequiredType>(Param).
44 /**
45 * Used to pass regions of memory through LLVM interfaces.
47 * @see llvm::MemoryBuffer
49 typedef struct LLVMOpaqueMemoryBuffer *LLVMMemoryBufferRef;
51 /**
52 * The top-level container for all LLVM global data. See the LLVMContext class.
54 typedef struct LLVMOpaqueContext *LLVMContextRef;
56 /**
57 * The top-level container for all other LLVM Intermediate Representation (IR)
58 * objects.
60 * @see llvm::Module
62 typedef struct LLVMOpaqueModule *LLVMModuleRef;
64 /**
65 * Each value in the LLVM IR has a type, an LLVMTypeRef.
67 * @see llvm::Type
69 typedef struct LLVMOpaqueType *LLVMTypeRef;
71 /**
72 * Represents an individual value in LLVM IR.
74 * This models llvm::Value.
76 typedef struct LLVMOpaqueValue *LLVMValueRef;
78 /**
79 * Represents a basic block of instructions in LLVM IR.
81 * This models llvm::BasicBlock.
83 typedef struct LLVMOpaqueBasicBlock *LLVMBasicBlockRef;
85 /**
86 * Represents an LLVM Metadata.
88 * This models llvm::Metadata.
90 typedef struct LLVMOpaqueMetadata *LLVMMetadataRef;
92 /**
93 * Represents an LLVM Named Metadata Node.
95 * This models llvm::NamedMDNode.
97 typedef struct LLVMOpaqueNamedMDNode *LLVMNamedMDNodeRef;
99 /**
100 * Represents an entry in a Global Object's metadata attachments.
102 * This models std::pair<unsigned, MDNode *>
104 typedef struct LLVMOpaqueValueMetadataEntry LLVMValueMetadataEntry;
107 * Represents an LLVM basic block builder.
109 * This models llvm::IRBuilder.
111 typedef struct LLVMOpaqueBuilder *LLVMBuilderRef;
114 * Represents an LLVM debug info builder.
116 * This models llvm::DIBuilder.
118 typedef struct LLVMOpaqueDIBuilder *LLVMDIBuilderRef;
121 * Interface used to provide a module to JIT or interpreter.
122 * This is now just a synonym for llvm::Module, but we have to keep using the
123 * different type to keep binary compatibility.
125 typedef struct LLVMOpaqueModuleProvider *LLVMModuleProviderRef;
127 /** @see llvm::PassManagerBase */
128 typedef struct LLVMOpaquePassManager *LLVMPassManagerRef;
130 /** @see llvm::PassRegistry */
131 typedef struct LLVMOpaquePassRegistry *LLVMPassRegistryRef;
134 * Used to get the users and usees of a Value.
136 * @see llvm::Use */
137 typedef struct LLVMOpaqueUse *LLVMUseRef;
140 * Used to represent an attributes.
142 * @see llvm::Attribute
144 typedef struct LLVMOpaqueAttributeRef *LLVMAttributeRef;
147 * @see llvm::DiagnosticInfo
149 typedef struct LLVMOpaqueDiagnosticInfo *LLVMDiagnosticInfoRef;
152 * @see llvm::Comdat
154 typedef struct LLVMComdat *LLVMComdatRef;
157 * @see llvm::Module::ModuleFlagEntry
159 typedef struct LLVMOpaqueModuleFlagEntry LLVMModuleFlagEntry;
162 * @see llvm::JITEventListener
164 typedef struct LLVMOpaqueJITEventListener *LLVMJITEventListenerRef;
167 * @see llvm::object::Binary
169 typedef struct LLVMOpaqueBinary *LLVMBinaryRef;
172 * @}
175 #ifdef __cplusplus
177 #endif
179 #endif