llvm_sys/
core.rs

1//! The LLVM intermediate representation.
2
3use super::*;
4
5// Core
6extern "C" {
7    pub fn LLVMShutdown();
8    pub fn LLVMGetVersion(
9        Major: *mut ::libc::c_uint,
10        Minor: *mut ::libc::c_uint,
11        Patch: *mut ::libc::c_uint,
12    );
13    pub fn LLVMCreateMessage(Message: *const ::libc::c_char) -> *mut ::libc::c_char;
14    pub fn LLVMDisposeMessage(Message: *mut ::libc::c_char);
15}
16
17// Core->Contexts
18extern "C" {
19    pub fn LLVMContextCreate() -> LLVMContextRef;
20    pub fn LLVMGetGlobalContext() -> LLVMContextRef;
21    pub fn LLVMContextSetDiagnosticHandler(
22        C: LLVMContextRef,
23        Handler: LLVMDiagnosticHandler,
24        DiagnosticContext: *mut ::libc::c_void,
25    );
26    /// Get the diagnostic handler of this context.
27    pub fn LLVMContextGetDiagnosticHandler(C: LLVMContextRef) -> LLVMDiagnosticHandler;
28    /// Get the diagnostic context of this context.
29    pub fn LLVMContextGetDiagnosticContext(C: LLVMContextRef) -> *mut ::libc::c_void;
30    pub fn LLVMContextSetYieldCallback(
31        C: LLVMContextRef,
32        Callback: LLVMYieldCallback,
33        OpaqueHandle: *mut ::libc::c_void,
34    );
35    pub fn LLVMContextShouldDiscardValueNames(C: LLVMContextRef) -> LLVMBool;
36    pub fn LLVMContextSetDiscardValueNames(C: LLVMContextRef, Discard: LLVMBool);
37    pub fn LLVMContextDispose(C: LLVMContextRef);
38    pub fn LLVMGetDiagInfoDescription(DI: LLVMDiagnosticInfoRef) -> *mut ::libc::c_char;
39    pub fn LLVMGetDiagInfoSeverity(DI: LLVMDiagnosticInfoRef) -> LLVMDiagnosticSeverity;
40    pub fn LLVMGetMDKindIDInContext(
41        C: LLVMContextRef,
42        Name: *const ::libc::c_char,
43        SLen: ::libc::c_uint,
44    ) -> ::libc::c_uint;
45    pub fn LLVMGetMDKindID(Name: *const ::libc::c_char, SLen: ::libc::c_uint) -> ::libc::c_uint;
46
47    /// Maps a synchronization scope name to a ID unique within this context.
48    pub fn LLVMGetSyncScopeID(C: LLVMContextRef, Name: *const ::libc::c_char, SLen: ::libc::size_t);
49
50    /// Return a unique id given the name of an enum attribute, or 0 if no attribute
51    /// by that name exists.
52    ///
53    /// See <http://llvm.org/docs/LangRef.html#parameter-attributes>
54    /// and <http://llvm.org/docs/LangRef.html#function-attributes>
55    /// for the list of available attributes.
56    ///
57    /// Note that attribute names and IDs are not subject to the same stability
58    /// guarantees as this API.
59    pub fn LLVMGetEnumAttributeKindForName(
60        Name: *const ::libc::c_char,
61        SLen: ::libc::size_t,
62    ) -> ::libc::c_uint;
63    pub fn LLVMGetLastEnumAttributeKind() -> ::libc::c_uint;
64
65    /// Create an enum attribute.
66    pub fn LLVMCreateEnumAttribute(
67        C: LLVMContextRef,
68        KindID: ::libc::c_uint,
69        Val: u64,
70    ) -> LLVMAttributeRef;
71    /// Get the unique id corresponding to the provided enum attribute.
72    pub fn LLVMGetEnumAttributeKind(A: LLVMAttributeRef) -> ::libc::c_uint;
73    /// Get the value of an enum attribute.
74    ///
75    /// Returns 0 if none exists.
76    pub fn LLVMGetEnumAttributeValue(A: LLVMAttributeRef) -> u64;
77
78    /// Create a type attribute.
79    pub fn LLVMCreateTypeAttribute(
80        C: LLVMContextRef,
81        KindID: ::libc::c_uint,
82        type_ref: LLVMTypeRef,
83    ) -> LLVMAttributeRef;
84    /// Get the type attribute's value.
85    pub fn LLVMGetTypeAttributeValue(A: LLVMAttributeRef) -> LLVMTypeRef;
86
87    /// Create a ConstantRange attribute.
88    ///
89    /// LoweWords and UpperWords need to be NumBits divided by 64 rounded
90    /// up elements long.
91    pub fn LLVMCreateConstantRangeAttribute(
92        C: LLVMContextRef,
93        KindID: ::libc::c_uint,
94        NumBits: ::libc::c_uint,
95        LowerWords: *const u64,
96        UpperWords: *const u64,
97    ) -> LLVMAttributeRef;
98
99    /// Create a string attribute.
100    pub fn LLVMCreateStringAttribute(
101        C: LLVMContextRef,
102        K: *const ::libc::c_char,
103        KLength: ::libc::c_uint,
104        V: *const ::libc::c_char,
105        VLength: ::libc::c_uint,
106    ) -> LLVMAttributeRef;
107    /// Get a string attribute's kind.
108    pub fn LLVMGetStringAttributeKind(
109        A: LLVMAttributeRef,
110        Length: *mut ::libc::c_uint,
111    ) -> *const ::libc::c_char;
112    /// Get a string attribute's value.
113    pub fn LLVMGetStringAttributeValue(
114        A: LLVMAttributeRef,
115        Length: *mut ::libc::c_uint,
116    ) -> *const ::libc::c_char;
117    pub fn LLVMIsEnumAttribute(A: LLVMAttributeRef) -> LLVMBool;
118    pub fn LLVMIsStringAttribute(A: LLVMAttributeRef) -> LLVMBool;
119    pub fn LLVMIsTypeAttribute(A: LLVMAttributeRef) -> LLVMBool;
120
121    /// Obtain a Type from a context by its registered name.
122    pub fn LLVMGetTypeByName2(C: LLVMContextRef, Name: *const ::libc::c_char) -> LLVMTypeRef;
123}
124
125// Core->Modules
126extern "C" {
127    pub fn LLVMModuleCreateWithName(ModuleID: *const ::libc::c_char) -> LLVMModuleRef;
128    pub fn LLVMModuleCreateWithNameInContext(
129        ModuleID: *const ::libc::c_char,
130        C: LLVMContextRef,
131    ) -> LLVMModuleRef;
132    pub fn LLVMCloneModule(M: LLVMModuleRef) -> LLVMModuleRef;
133    pub fn LLVMDisposeModule(M: LLVMModuleRef);
134
135    /// [Soon to be deprecated](https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes).
136    ///
137    /// Returns true if the module is in the new debug info mode which uses
138    /// non-instruction debug records instead of debug intrinsics for variable
139    /// location tracking.
140    pub fn LLVMIsNewDbgInfoFormat(M: LLVMModuleRef) -> LLVMBool;
141
142    /// [Soon to be deprecated](https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes).
143    ///
144    /// Convert module into desired debug info format.
145    pub fn LLVMSetIsNewDbgInfoFormat(M: LLVMModuleRef, UseNewFormat: LLVMBool);
146
147    /// Get the identifier of a module.
148    ///
149    /// `Len` is written to contains the length of the returned string.
150    pub fn LLVMGetModuleIdentifier(
151        M: LLVMModuleRef,
152        Len: *mut ::libc::size_t,
153    ) -> *const ::libc::c_char;
154    /// Set the identifier of a module.
155    ///
156    /// `Len` is the length of the string pointed to by `Ident`.
157    pub fn LLVMSetModuleIdentifier(
158        M: LLVMModuleRef,
159        Ident: *const ::libc::c_char,
160        Len: ::libc::size_t,
161    );
162
163    /// Obtain the module's original source file name.
164    ///
165    /// Len holds the length of the returned string, returns the original source file name of M.
166    pub fn LLVMGetSourceFileName(
167        M: LLVMModuleRef,
168        Len: *mut ::libc::size_t,
169    ) -> *const ::libc::c_char;
170    /// Set the original source file name of a module to a string Name with length Len.
171    pub fn LLVMSetSourceFileName(
172        M: LLVMModuleRef,
173        Name: *const ::libc::c_char,
174        Len: ::libc::size_t,
175    );
176
177    #[deprecated(
178        since = "39.0.0",
179        note = "Confusingly named. Use LLVMGetDataLayoutStr."
180    )]
181    pub fn LLVMGetDataLayout(M: LLVMModuleRef) -> *const ::libc::c_char;
182    /// Obtain the data layout for a module.
183    pub fn LLVMGetDataLayoutStr(M: LLVMModuleRef) -> *const ::libc::c_char;
184    pub fn LLVMSetDataLayout(M: LLVMModuleRef, DataLayoutStr: *const ::libc::c_char);
185    pub fn LLVMGetTarget(M: LLVMModuleRef) -> *const ::libc::c_char;
186    pub fn LLVMSetTarget(M: LLVMModuleRef, Triple: *const ::libc::c_char);
187
188    /// Returns the module flags as an array of flag-key-value triples.  The caller is responsible for freeing this array by calling LLVMDisposeModuleFlagsMetadata.
189    pub fn LLVMCopyModuleFlagsMetadata(
190        M: LLVMModuleRef,
191        Len: *mut ::libc::size_t,
192    ) -> *mut LLVMModuleFlagEntry;
193    /// Destroys module flags metadata entries.
194    pub fn LLVMDisposeModuleFlagsMetadata(Entries: *mut LLVMModuleFlagEntry);
195    /// Returns the flag behavior for a module flag entry at a specific index.
196    pub fn LLVMModuleFlagEntriesGetFlagBehavior(
197        Entries: *mut LLVMModuleFlagEntry,
198        Index: ::libc::c_uint,
199    ) -> LLVMModuleFlagBehavior;
200    /// Returns the key for a module flag entry at a specific index.
201    pub fn LLVMModuleFlagEntriesGetKey(
202        Entries: *mut LLVMModuleFlagEntry,
203        Index: ::libc::c_uint,
204        Len: *mut ::libc::size_t,
205    ) -> *const ::libc::c_char;
206    /// Returns the metadata for a module flag entry at a specific index.
207    pub fn LLVMModuleFlagEntriesGetMetadata(
208        Entries: *mut LLVMModuleFlagEntry,
209        Index: ::libc::c_uint,
210    ) -> LLVMMetadataRef;
211    /// Add a module-level flag to the module-level flags metadata if it doesn't already exist.
212    pub fn LLVMGetModuleFlag(
213        M: LLVMModuleRef,
214        Key: *const ::libc::c_char,
215        KeyLen: ::libc::size_t,
216    ) -> LLVMMetadataRef;
217    /// Add a module-level flag to the module-level flags metadata if it doesn't already exist.
218    pub fn LLVMAddModuleFlag(
219        M: LLVMModuleRef,
220        Behavior: LLVMModuleFlagBehavior,
221        Key: *const ::libc::c_char,
222        KeyLen: ::libc::size_t,
223        Val: LLVMMetadataRef,
224    );
225
226    pub fn LLVMDumpModule(M: LLVMModuleRef);
227    pub fn LLVMPrintModuleToFile(
228        M: LLVMModuleRef,
229        Filename: *const ::libc::c_char,
230        ErrorMessage: *mut *mut ::libc::c_char,
231    ) -> LLVMBool;
232    pub fn LLVMPrintModuleToString(M: LLVMModuleRef) -> *mut ::libc::c_char;
233
234    pub fn LLVMGetModuleInlineAsm(
235        M: LLVMModuleRef,
236        Len: *mut ::libc::size_t,
237    ) -> *const ::libc::c_char;
238    #[deprecated(since = "70.0.0", note = "Use LLVMSetModuleInlineAsm2 instead")]
239    pub fn LLVMSetModuleInlineAsm(M: LLVMModuleRef, Asm: *const ::libc::c_char);
240    pub fn LLVMSetModuleInlineAsm2(
241        M: LLVMModuleRef,
242        Asm: *const ::libc::c_char,
243        Len: ::libc::size_t,
244    );
245    pub fn LLVMAppendModuleInlineAsm(
246        M: LLVMModuleRef,
247        Asm: *const ::libc::c_char,
248        Len: ::libc::size_t,
249    );
250    pub fn LLVMGetInlineAsm(
251        Ty: LLVMTypeRef,
252        AsmString: *const ::libc::c_char,
253        AsmStringSize: ::libc::size_t,
254        Constraints: *const ::libc::c_char,
255        ConstraintsSize: ::libc::size_t,
256        HasSideEffects: LLVMBool,
257        IsAlignStack: LLVMBool,
258        Dialect: LLVMInlineAsmDialect,
259        CanThrow: LLVMBool,
260    ) -> LLVMValueRef;
261
262    /// Get the template string used for an inline assembly snippet.
263    pub fn LLVMGetInlineAsmAsmString(
264        InlineAsmVal: LLVMValueRef,
265        Len: *mut ::libc::size_t,
266    ) -> *const ::libc::c_char;
267
268    /// Get the raw constraint string for an inline assembly snippet.
269    pub fn LLVMGetInlineAsmConstraintString(
270        InlineAsmVal: LLVMValueRef,
271        Len: *mut ::libc::size_t,
272    ) -> *const ::libc::c_char;
273
274    /// Get the dialect used by the inline asm snippet.
275    pub fn LLVMGetInlineAsmDialect(InlineAsmVal: LLVMValueRef) -> LLVMInlineAsmDialect;
276
277    /// Get the function type of the inline assembly snippet.
278    ///
279    /// This is the same type that was passed into LLVMGetInlineAsm originally.
280    pub fn LLVMGetInlineAsmFunctionType(InlineAsmVal: LLVMValueRef) -> LLVMTypeRef;
281
282    /// Get if the inline asm snippet has side effects
283    pub fn LLVMGetInlineAsmHasSideEffects(InlineAsmVal: LLVMValueRef) -> LLVMBool;
284
285    /// Get if the inline asm snippet needs an aligned stack
286    pub fn LLVMGetInlineAsmNeedsAlignedStack(InlineAsmVal: LLVMValueRef) -> LLVMBool;
287
288    /// Get if the inline asm snippet may unwind the stack
289    pub fn LLVMGetInlineAsmCanUnwind(InlineAsmVal: LLVMValueRef) -> LLVMBool;
290
291    pub fn LLVMGetModuleContext(M: LLVMModuleRef) -> LLVMContextRef;
292    #[deprecated(since = "120.0.0", note = "Use LLVMGetTypeByName2 instead")]
293    pub fn LLVMGetTypeByName(M: LLVMModuleRef, Name: *const ::libc::c_char) -> LLVMTypeRef;
294    pub fn LLVMGetFirstNamedMetadata(M: LLVMModuleRef) -> LLVMNamedMDNodeRef;
295    pub fn LLVMGetLastNamedMetadata(M: LLVMModuleRef) -> LLVMNamedMDNodeRef;
296    pub fn LLVMGetNextNamedMetadata(NamedMDNode: LLVMNamedMDNodeRef) -> LLVMNamedMDNodeRef;
297    pub fn LLVMGetPreviousNamedMetadata(NamedMDNode: LLVMNamedMDNodeRef) -> LLVMNamedMDNodeRef;
298    pub fn LLVMGetNamedMetadata(
299        M: LLVMModuleRef,
300        Name: *const ::libc::c_char,
301        NameLen: ::libc::size_t,
302    ) -> LLVMNamedMDNodeRef;
303    pub fn LLVMGetOrInsertNamedMetadata(
304        M: LLVMModuleRef,
305        Name: *const ::libc::c_char,
306        NameLen: ::libc::size_t,
307    ) -> LLVMNamedMDNodeRef;
308    pub fn LLVMGetNamedMetadataName(
309        NamedMD: LLVMNamedMDNodeRef,
310        NameLen: *mut ::libc::size_t,
311    ) -> *const ::libc::c_char;
312    pub fn LLVMGetNamedMetadataNumOperands(
313        M: LLVMModuleRef,
314        name: *const ::libc::c_char,
315    ) -> ::libc::c_uint;
316    pub fn LLVMGetNamedMetadataOperands(
317        M: LLVMModuleRef,
318        name: *const ::libc::c_char,
319        Dest: *mut LLVMValueRef,
320    );
321    pub fn LLVMAddNamedMetadataOperand(
322        M: LLVMModuleRef,
323        name: *const ::libc::c_char,
324        Val: LLVMValueRef,
325    );
326    pub fn LLVMGetDebugLocDirectory(
327        Val: LLVMValueRef,
328        Length: *mut ::libc::c_uint,
329    ) -> *const ::libc::c_char;
330    pub fn LLVMGetDebugLocFilename(
331        Val: LLVMValueRef,
332        Length: *mut ::libc::c_uint,
333    ) -> *const ::libc::c_char;
334    pub fn LLVMGetDebugLocLine(Val: LLVMValueRef) -> ::libc::c_uint;
335    pub fn LLVMGetDebugLocColumn(Val: LLVMValueRef) -> ::libc::c_uint;
336    pub fn LLVMAddFunction(
337        M: LLVMModuleRef,
338        Name: *const ::libc::c_char,
339        FunctionTy: LLVMTypeRef,
340    ) -> LLVMValueRef;
341    pub fn LLVMGetNamedFunction(M: LLVMModuleRef, Name: *const ::libc::c_char) -> LLVMValueRef;
342    /// Obtain a Function value from a Module by its name.
343    ///
344    /// The returned value corresponds to a Function value.
345    pub fn LLVMGetNamedFunctionWithLength(
346        M: LLVMModuleRef,
347        Name: *const ::libc::c_char,
348        Length: ::libc::size_t,
349    ) -> LLVMValueRef;
350    pub fn LLVMGetFirstFunction(M: LLVMModuleRef) -> LLVMValueRef;
351    pub fn LLVMGetLastFunction(M: LLVMModuleRef) -> LLVMValueRef;
352    pub fn LLVMGetNextFunction(Fn: LLVMValueRef) -> LLVMValueRef;
353    pub fn LLVMGetPreviousFunction(Fn: LLVMValueRef) -> LLVMValueRef;
354}
355
356// Core->Types
357extern "C" {
358    pub fn LLVMGetTypeKind(Ty: LLVMTypeRef) -> LLVMTypeKind;
359    pub fn LLVMTypeIsSized(Ty: LLVMTypeRef) -> LLVMBool;
360    pub fn LLVMGetTypeContext(Ty: LLVMTypeRef) -> LLVMContextRef;
361    pub fn LLVMDumpType(Val: LLVMTypeRef);
362    pub fn LLVMPrintTypeToString(Val: LLVMTypeRef) -> *mut ::libc::c_char;
363
364    // Core->Types->Integer
365    pub fn LLVMInt1TypeInContext(C: LLVMContextRef) -> LLVMTypeRef;
366    pub fn LLVMInt8TypeInContext(C: LLVMContextRef) -> LLVMTypeRef;
367    pub fn LLVMInt16TypeInContext(C: LLVMContextRef) -> LLVMTypeRef;
368    pub fn LLVMInt32TypeInContext(C: LLVMContextRef) -> LLVMTypeRef;
369    pub fn LLVMInt64TypeInContext(C: LLVMContextRef) -> LLVMTypeRef;
370    pub fn LLVMInt128TypeInContext(C: LLVMContextRef) -> LLVMTypeRef;
371    pub fn LLVMIntTypeInContext(C: LLVMContextRef, NumBits: ::libc::c_uint) -> LLVMTypeRef;
372    pub fn LLVMInt1Type() -> LLVMTypeRef;
373    pub fn LLVMInt8Type() -> LLVMTypeRef;
374    pub fn LLVMInt16Type() -> LLVMTypeRef;
375    pub fn LLVMInt32Type() -> LLVMTypeRef;
376    pub fn LLVMInt64Type() -> LLVMTypeRef;
377    pub fn LLVMInt128Type() -> LLVMTypeRef;
378    pub fn LLVMIntType(NumBits: ::libc::c_uint) -> LLVMTypeRef;
379    pub fn LLVMGetIntTypeWidth(IntegerTy: LLVMTypeRef) -> ::libc::c_uint;
380
381    // Core->Types->Floating-Point
382    pub fn LLVMHalfTypeInContext(C: LLVMContextRef) -> LLVMTypeRef;
383    pub fn LLVMBFloatTypeInContext(C: LLVMContextRef) -> LLVMTypeRef;
384    pub fn LLVMFloatTypeInContext(C: LLVMContextRef) -> LLVMTypeRef;
385    pub fn LLVMDoubleTypeInContext(C: LLVMContextRef) -> LLVMTypeRef;
386    pub fn LLVMX86FP80TypeInContext(C: LLVMContextRef) -> LLVMTypeRef;
387    pub fn LLVMFP128TypeInContext(C: LLVMContextRef) -> LLVMTypeRef;
388    pub fn LLVMPPCFP128TypeInContext(C: LLVMContextRef) -> LLVMTypeRef;
389    pub fn LLVMHalfType() -> LLVMTypeRef;
390    pub fn LLVMBFloatType() -> LLVMTypeRef;
391    pub fn LLVMFloatType() -> LLVMTypeRef;
392    pub fn LLVMDoubleType() -> LLVMTypeRef;
393    pub fn LLVMX86FP80Type() -> LLVMTypeRef;
394    pub fn LLVMFP128Type() -> LLVMTypeRef;
395    pub fn LLVMPPCFP128Type() -> LLVMTypeRef;
396
397    // Core->Types->Function
398    pub fn LLVMFunctionType(
399        ReturnType: LLVMTypeRef,
400        ParamTypes: *mut LLVMTypeRef,
401        ParamCount: ::libc::c_uint,
402        IsVarArg: LLVMBool,
403    ) -> LLVMTypeRef;
404    pub fn LLVMIsFunctionVarArg(FunctionTy: LLVMTypeRef) -> LLVMBool;
405    pub fn LLVMGetReturnType(FunctionTy: LLVMTypeRef) -> LLVMTypeRef;
406    pub fn LLVMCountParamTypes(FunctionTy: LLVMTypeRef) -> ::libc::c_uint;
407    pub fn LLVMGetParamTypes(FunctionTy: LLVMTypeRef, Dest: *mut LLVMTypeRef);
408
409    // Core->Types->Struct
410    pub fn LLVMStructTypeInContext(
411        C: LLVMContextRef,
412        ElementTypes: *mut LLVMTypeRef,
413        ElementCount: ::libc::c_uint,
414        Packed: LLVMBool,
415    ) -> LLVMTypeRef;
416    pub fn LLVMStructType(
417        ElementTypes: *mut LLVMTypeRef,
418        ElementCount: ::libc::c_uint,
419        Packed: LLVMBool,
420    ) -> LLVMTypeRef;
421    pub fn LLVMStructCreateNamed(C: LLVMContextRef, Name: *const ::libc::c_char) -> LLVMTypeRef;
422    pub fn LLVMGetStructName(Ty: LLVMTypeRef) -> *const ::libc::c_char;
423    pub fn LLVMStructSetBody(
424        StructTy: LLVMTypeRef,
425        ElementTypes: *mut LLVMTypeRef,
426        ElementCount: ::libc::c_uint,
427        Packed: LLVMBool,
428    );
429    pub fn LLVMCountStructElementTypes(StructTy: LLVMTypeRef) -> ::libc::c_uint;
430    pub fn LLVMGetStructElementTypes(StructTy: LLVMTypeRef, Dest: *mut LLVMTypeRef);
431    /// Get the type of the element at the given index in a structure.
432    ///
433    /// Added in LLVM 3.7.
434    pub fn LLVMStructGetTypeAtIndex(StructTy: LLVMTypeRef, i: ::libc::c_uint) -> LLVMTypeRef;
435    /// Determine whether a structure is packed.
436    pub fn LLVMIsPackedStruct(StructTy: LLVMTypeRef) -> LLVMBool;
437    pub fn LLVMIsOpaqueStruct(StructTy: LLVMTypeRef) -> LLVMBool;
438    pub fn LLVMIsLiteralStruct(StructTy: LLVMTypeRef) -> LLVMBool;
439
440    // Core->Types->Sequential
441    pub fn LLVMGetElementType(Ty: LLVMTypeRef) -> LLVMTypeRef;
442    /// Get the subtypes of the given type.
443    pub fn LLVMGetSubtypes(Tp: LLVMTypeRef, Arr: *mut LLVMTypeRef);
444    /// Return the number of types in the derived type.
445    pub fn LLVMGetNumContainedTypes(Tp: LLVMTypeRef) -> ::libc::c_uint;
446    #[deprecated(
447        since = "170.0.0",
448        note = "LLVMArrayType is deprecated in favor of the API accurate LLVMArrayType2"
449    )]
450    pub fn LLVMArrayType(ElementType: LLVMTypeRef, ElementCount: ::libc::c_uint) -> LLVMTypeRef;
451    /// Create a fixed size array type that refers to a specific type.
452    ///
453    /// The created type will exist in the context that its element type
454    /// exists in.
455    pub fn LLVMArrayType2(ElementType: LLVMTypeRef, ElementCount: u64) -> LLVMTypeRef;
456    #[deprecated(
457        since = "170.0.0",
458        note = "LLVMGetArrayLength is deprecated in favor of the API accurate LLVMGetArrayLength2"
459    )]
460    pub fn LLVMGetArrayLength(ArrayTy: LLVMTypeRef) -> ::libc::c_uint;
461    /// Obtain the length of an array type.
462    ///
463    /// This only works on types that represent arrays.
464    pub fn LLVMGetArrayLength2(ArrayTy: LLVMTypeRef) -> u64;
465    pub fn LLVMPointerType(ElementType: LLVMTypeRef, AddressSpace: ::libc::c_uint) -> LLVMTypeRef;
466    /// Determine whether a pointer is opaque.
467    ///
468    /// True if this is an instance of an opaque PointerType.
469    pub fn LLVMPointerTypeIsOpaque(Ty: LLVMTypeRef) -> LLVMBool;
470    /// Create an opaque pointer type in a context.
471    pub fn LLVMPointerTypeInContext(C: LLVMContextRef, AddressSpace: ::libc::c_uint)
472        -> LLVMTypeRef;
473    pub fn LLVMGetPointerAddressSpace(PointerTy: LLVMTypeRef) -> ::libc::c_uint;
474    pub fn LLVMVectorType(ElementType: LLVMTypeRef, ElementCount: ::libc::c_uint) -> LLVMTypeRef;
475    /// Create a vector type that contains a defined type and has a scalable
476    /// number of elements.
477    ///
478    /// The created type will exist in the context that its element type
479    /// exists in.
480    pub fn LLVMScalableVectorType(
481        ElementType: LLVMTypeRef,
482        ElementCount: ::libc::c_uint,
483    ) -> LLVMTypeRef;
484    /// Obtain the (possibly scalable) number of elements in a vector type.
485    pub fn LLVMGetVectorSize(VectorTy: LLVMTypeRef) -> ::libc::c_uint;
486
487    /// Get the pointer value for the associated ConstantPtrAuth constant.
488    pub fn LLVMGetConstantPtrAuthPointer(PtrAuth: LLVMValueRef) -> LLVMValueRef;
489
490    /// Get the key value for the associated ConstantPtrAuth constant.
491    pub fn LLVMGetConstantPtrAuthKey(PtrAuth: LLVMValueRef) -> LLVMValueRef;
492
493    /// Get the discriminator value for the associated ConstantPtrAuth constant.
494    pub fn LLVMGetConstantPtrAuthDiscriminator(PtrAuth: LLVMValueRef) -> LLVMValueRef;
495
496    /// Get the address discriminator value for the associated ConstantPtrAuth
497    /// constant.
498    pub fn LLVMGetConstantPtrAuthAddrDiscriminator(PtrAuth: LLVMValueRef) -> LLVMValueRef;
499
500    // Core->Types->Other
501    pub fn LLVMVoidTypeInContext(C: LLVMContextRef) -> LLVMTypeRef;
502    pub fn LLVMLabelTypeInContext(C: LLVMContextRef) -> LLVMTypeRef;
503    pub fn LLVMX86AMXTypeInContext(C: LLVMContextRef) -> LLVMTypeRef;
504    pub fn LLVMTokenTypeInContext(C: LLVMContextRef) -> LLVMTypeRef;
505    pub fn LLVMMetadataTypeInContext(C: LLVMContextRef) -> LLVMTypeRef;
506    pub fn LLVMVoidType() -> LLVMTypeRef;
507    pub fn LLVMLabelType() -> LLVMTypeRef;
508    pub fn LLVMX86AMXType() -> LLVMTypeRef;
509    pub fn LLVMTargetExtTypeInContext(
510        C: LLVMContextRef,
511        Name: *const ::libc::c_char,
512        TypeParams: *mut LLVMTypeRef,
513        TypeParamCount: ::libc::c_uint,
514        IntParams: *mut ::libc::c_uint,
515        IntParamCount: ::libc::c_uint,
516    ) -> LLVMTypeRef;
517
518    /// Obtain the name for this target extension type.
519    pub fn LLVMGetTargetExtTypeName(TargetExtTy: LLVMTypeRef) -> *const ::libc::c_char;
520
521    /// Obtain the number of type parameters for this target extension type.
522    pub fn LLVMGetTargetExtTypeNumTypeParams(TargetExtTy: LLVMTypeRef) -> ::libc::c_uint;
523
524    /// Get the type parameter at the given index for the target extension type.
525    pub fn LLVMGetTargetExtTypeTypeParam(
526        TargetExtTy: LLVMTypeRef,
527        Idx: ::libc::c_uint,
528    ) -> LLVMTypeRef;
529
530    /// Obtain the number of int parameters for this target extension type.
531    pub fn LLVMGetTargetExtTypeNumIntParams(TargetExtTy: LLVMTypeRef) -> ::libc::c_uint;
532
533    /// Get the int parameter at the given index for the target extension type.
534    pub fn LLVMGetTargetExtTypeIntParam(
535        TargetExtTy: LLVMTypeRef,
536        Idx: ::libc::c_uint,
537    ) -> ::libc::c_uint;
538}
539
540// Core->Values
541extern "C" {
542    // Core->Values->General
543    // Get the enumerated kind of a Value instance.
544    pub fn LLVMGetValueKind(Val: LLVMValueRef) -> LLVMValueKind;
545    pub fn LLVMTypeOf(Val: LLVMValueRef) -> LLVMTypeRef;
546
547    #[deprecated(since = "70.0.0", note = "Use LLVMGetValueName2 instead")]
548    pub fn LLVMGetValueName(Val: LLVMValueRef) -> *const ::libc::c_char;
549    pub fn LLVMGetValueName2(
550        Val: LLVMValueRef,
551        Length: *mut ::libc::size_t,
552    ) -> *const ::libc::c_char;
553    #[deprecated(since = "70.0.0", note = "Use LLVMSetValueName2 instead")]
554    pub fn LLVMSetValueName(Val: LLVMValueRef, Name: *const ::libc::c_char);
555    pub fn LLVMSetValueName2(
556        Val: LLVMValueRef,
557        Name: *const ::libc::c_char,
558        NameLen: ::libc::size_t,
559    );
560
561    pub fn LLVMDumpValue(Val: LLVMValueRef);
562    pub fn LLVMPrintValueToString(Val: LLVMValueRef) -> *mut ::libc::c_char;
563
564    /// Obtain the context to which this value is associated.
565    pub fn LLVMGetValueContext(Val: LLVMValueRef) -> LLVMContextRef;
566
567    /// Return a string representation of the DbgRecord.
568    ///
569    /// Use LLVMDisposeMessage to free the string.
570    pub fn LLVMPrintDbgRecordToString(Record: LLVMDbgRecordRef) -> *mut ::libc::c_char;
571    pub fn LLVMReplaceAllUsesWith(OldVal: LLVMValueRef, NewVal: LLVMValueRef);
572    /// Determine whether the specified value instance is constant.
573    pub fn LLVMIsConstant(Val: LLVMValueRef) -> LLVMBool;
574    pub fn LLVMIsUndef(Val: LLVMValueRef) -> LLVMBool;
575    /// Determine whether a value instance is poisonous.
576    pub fn LLVMIsPoison(Val: LLVMValueRef) -> LLVMBool;
577    pub fn LLVMIsAMDNode(Val: LLVMValueRef) -> LLVMValueRef;
578    pub fn LLVMIsAValueAsMetadata(Val: LLVMValueRef) -> LLVMValueRef;
579    pub fn LLVMIsAMDString(Val: LLVMValueRef) -> LLVMValueRef;
580
581    // Core->Values->Usage
582    pub fn LLVMGetFirstUse(Val: LLVMValueRef) -> LLVMUseRef;
583    pub fn LLVMGetNextUse(U: LLVMUseRef) -> LLVMUseRef;
584    pub fn LLVMGetUser(U: LLVMUseRef) -> LLVMValueRef;
585    pub fn LLVMGetUsedValue(U: LLVMUseRef) -> LLVMValueRef;
586
587    // Core->Values->User value
588    pub fn LLVMGetOperand(Val: LLVMValueRef, Index: ::libc::c_uint) -> LLVMValueRef;
589    pub fn LLVMGetOperandUse(Val: LLVMValueRef, Index: ::libc::c_uint) -> LLVMUseRef;
590    pub fn LLVMSetOperand(User: LLVMValueRef, Index: ::libc::c_uint, Val: LLVMValueRef);
591    pub fn LLVMGetNumOperands(Val: LLVMValueRef) -> ::libc::c_int;
592
593    // Core->Values->Constants
594    pub fn LLVMConstNull(Ty: LLVMTypeRef) -> LLVMValueRef;
595    pub fn LLVMConstAllOnes(Ty: LLVMTypeRef) -> LLVMValueRef;
596    pub fn LLVMGetUndef(Ty: LLVMTypeRef) -> LLVMValueRef;
597    /// Obtain a constant value referring to a poison value of a type.
598    pub fn LLVMGetPoison(Ty: LLVMTypeRef) -> LLVMValueRef;
599    pub fn LLVMIsNull(Val: LLVMValueRef) -> LLVMBool;
600    pub fn LLVMConstPointerNull(Ty: LLVMTypeRef) -> LLVMValueRef;
601
602    // Core->Values->Constants->Scalar
603    pub fn LLVMConstInt(
604        IntTy: LLVMTypeRef,
605        N: ::libc::c_ulonglong,
606        SignExtend: LLVMBool,
607    ) -> LLVMValueRef;
608    pub fn LLVMConstIntOfArbitraryPrecision(
609        IntTy: LLVMTypeRef,
610        NumWords: ::libc::c_uint,
611        Words: *const u64,
612    ) -> LLVMValueRef;
613    pub fn LLVMConstIntOfString(
614        IntTy: LLVMTypeRef,
615        Text: *const ::libc::c_char,
616        Radix: u8,
617    ) -> LLVMValueRef;
618    pub fn LLVMConstIntOfStringAndSize(
619        IntTy: LLVMTypeRef,
620        Text: *const ::libc::c_char,
621        SLen: ::libc::c_uint,
622        Radix: u8,
623    ) -> LLVMValueRef;
624    pub fn LLVMConstReal(RealTy: LLVMTypeRef, N: ::libc::c_double) -> LLVMValueRef;
625    pub fn LLVMConstRealOfString(RealTy: LLVMTypeRef, Text: *const ::libc::c_char) -> LLVMValueRef;
626    pub fn LLVMConstRealOfStringAndSize(
627        RealTy: LLVMTypeRef,
628        Text: *const ::libc::c_char,
629        SLen: ::libc::c_uint,
630    ) -> LLVMValueRef;
631    pub fn LLVMConstIntGetZExtValue(ConstantVal: LLVMValueRef) -> ::libc::c_ulonglong;
632    pub fn LLVMConstIntGetSExtValue(ConstantVal: LLVMValueRef) -> ::libc::c_longlong;
633    pub fn LLVMConstRealGetDouble(
634        ConstantVal: LLVMValueRef,
635        losesInfo: *mut LLVMBool,
636    ) -> ::libc::c_double;
637
638    // Core->Values->Constants->Composite
639    #[deprecated(since = "191.0.0", note = "Use LLVMConstStringInContext2 instead.")]
640    pub fn LLVMConstStringInContext(
641        C: LLVMContextRef,
642        Str: *const ::libc::c_char,
643        Length: ::libc::c_uint,
644        DontNullTerminate: LLVMBool,
645    ) -> LLVMValueRef;
646    pub fn LLVMConstStringInContext2(
647        C: LLVMContextRef,
648        Str: *const ::libc::c_char,
649        Length: usize,
650        DontNullTerminate: LLVMBool,
651    ) -> LLVMValueRef;
652    pub fn LLVMConstString(
653        Str: *const ::libc::c_char,
654        Length: ::libc::c_uint,
655        DontNullTerminate: LLVMBool,
656    ) -> LLVMValueRef;
657    pub fn LLVMIsConstantString(c: LLVMValueRef) -> LLVMBool;
658    pub fn LLVMGetAsString(C: LLVMValueRef, Length: *mut ::libc::size_t) -> *const ::libc::c_char;
659    /// Get the raw, underlying bytes of the given constant data sequential.
660    ///
661    /// This is the same as LLVMGetAsString except it works for all constant data
662    /// sequentials, not just i8 arrays.
663    pub fn LLVMGetRawDataValues(c: LLVMValueRef, SizeInBytes: usize) -> *const ::libc::c_char;
664    pub fn LLVMConstStructInContext(
665        C: LLVMContextRef,
666        ConstantVals: *mut LLVMValueRef,
667        Count: ::libc::c_uint,
668        Packed: LLVMBool,
669    ) -> LLVMValueRef;
670    pub fn LLVMConstStruct(
671        ConstantVals: *mut LLVMValueRef,
672        Count: ::libc::c_uint,
673        Packed: LLVMBool,
674    ) -> LLVMValueRef;
675    #[deprecated(
676        since = "170.0.0",
677        note = "LLVMConstArray is deprecated in favor of the API accurate LLVMConstArray2"
678    )]
679    pub fn LLVMConstArray(
680        ElementTy: LLVMTypeRef,
681        ConstantVals: *mut LLVMValueRef,
682        Length: ::libc::c_uint,
683    ) -> LLVMValueRef;
684    /// Create a ConstantArray from values.
685    pub fn LLVMConstArray2(
686        ElementTy: LLVMTypeRef,
687        ConstantVals: *mut LLVMValueRef,
688        Length: u64,
689    ) -> LLVMValueRef;
690    /// Create a ConstantDataArray from raw values.
691    ///
692    /// ElementTy must be one of i8, i16, i32, i64, half, bfloat, float, or double.
693    /// Data points to a contiguous buffer of raw values in the host endianness. The
694    /// element count is inferred from the element type and the data size in bytes.
695    pub fn LLVMConstDataArray(
696        ElementTy: LLVMTypeRef,
697        Data: *const ::libc::c_char,
698        SizeInBytes: usize,
699    ) -> LLVMValueRef;
700    pub fn LLVMConstNamedStruct(
701        StructTy: LLVMTypeRef,
702        ConstantVals: *mut LLVMValueRef,
703        Count: ::libc::c_uint,
704    ) -> LLVMValueRef;
705    pub fn LLVMGetAggregateElement(C: LLVMValueRef, idx: ::libc::c_uint) -> LLVMValueRef;
706    #[deprecated(since = "150.0.0", note = "Use LLVMGetAggregateElement instead")]
707    pub fn LLVMGetElementAsConstant(C: LLVMValueRef, idx: ::libc::c_uint) -> LLVMValueRef;
708    pub fn LLVMConstVector(
709        ScalarConstantVals: *mut LLVMValueRef,
710        Size: ::libc::c_uint,
711    ) -> LLVMValueRef;
712    /// Create a ConstantPtrAuth constant with the given values.
713    pub fn LLVMConstantPtrAuth(
714        Ptr: LLVMValueRef,
715        Key: LLVMValueRef,
716        Disc: LLVMValueRef,
717        AddrDisc: LLVMValueRef,
718    ) -> LLVMValueRef;
719
720    // Core->Values->Constants->Constant expressions
721    pub fn LLVMGetConstOpcode(ConstantVal: LLVMValueRef) -> LLVMOpcode;
722    pub fn LLVMAlignOf(Ty: LLVMTypeRef) -> LLVMValueRef;
723    pub fn LLVMSizeOf(Ty: LLVMTypeRef) -> LLVMValueRef;
724    pub fn LLVMConstNeg(ConstantVal: LLVMValueRef) -> LLVMValueRef;
725    pub fn LLVMConstNSWNeg(ConstantVal: LLVMValueRef) -> LLVMValueRef;
726    #[deprecated(since = "191.0.0", note = "Use LLVMConstNull instead.")]
727    pub fn LLVMConstNUWNeg(ConstantVal: LLVMValueRef) -> LLVMValueRef;
728    pub fn LLVMConstNot(ConstantVal: LLVMValueRef) -> LLVMValueRef;
729    pub fn LLVMConstAdd(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) -> LLVMValueRef;
730    pub fn LLVMConstNSWAdd(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) -> LLVMValueRef;
731    pub fn LLVMConstNUWAdd(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) -> LLVMValueRef;
732    pub fn LLVMConstSub(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) -> LLVMValueRef;
733    pub fn LLVMConstNSWSub(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) -> LLVMValueRef;
734    pub fn LLVMConstNUWSub(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) -> LLVMValueRef;
735    pub fn LLVMConstMul(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) -> LLVMValueRef;
736    pub fn LLVMConstNSWMul(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) -> LLVMValueRef;
737    pub fn LLVMConstNUWMul(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) -> LLVMValueRef;
738    pub fn LLVMConstXor(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) -> LLVMValueRef;
739    pub fn LLVMConstGEP2(
740        Ty: LLVMTypeRef,
741        ConstantVal: LLVMValueRef,
742        ConstantIndices: *mut LLVMValueRef,
743        NumIndices: ::libc::c_uint,
744    ) -> LLVMValueRef;
745    pub fn LLVMConstInBoundsGEP2(
746        Ty: LLVMTypeRef,
747        ConstantVal: LLVMValueRef,
748        ConstantIndices: *mut LLVMValueRef,
749        NumIndices: ::libc::c_uint,
750    ) -> LLVMValueRef;
751    /// Creates a constant GetElementPtr expression.
752    ///
753    /// Similar to LLVMConstGEP2, but allows specifying the no-wrap flags.
754    pub fn LLVMConstGEPWithNoWrapFlags(
755        Ty: LLVMTypeRef,
756        ConstantVal: LLVMValueRef,
757        ConstantIndices: *mut LLVMValueRef,
758        NumIndices: ::libc::c_uint,
759        NoWrapFlags: LLVMGEPNoWrapFlags,
760    ) -> LLVMValueRef;
761    pub fn LLVMConstTrunc(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef) -> LLVMValueRef;
762    pub fn LLVMConstPtrToInt(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef) -> LLVMValueRef;
763    pub fn LLVMConstIntToPtr(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef) -> LLVMValueRef;
764    pub fn LLVMConstBitCast(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef) -> LLVMValueRef;
765    pub fn LLVMConstAddrSpaceCast(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef) -> LLVMValueRef;
766    pub fn LLVMConstTruncOrBitCast(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef) -> LLVMValueRef;
767    pub fn LLVMConstPointerCast(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef) -> LLVMValueRef;
768    pub fn LLVMConstExtractElement(
769        VectorConstant: LLVMValueRef,
770        IndexConstant: LLVMValueRef,
771    ) -> LLVMValueRef;
772    pub fn LLVMConstInsertElement(
773        VectorConstant: LLVMValueRef,
774        ElementValueConstant: LLVMValueRef,
775        IndexConstant: LLVMValueRef,
776    ) -> LLVMValueRef;
777    pub fn LLVMConstShuffleVector(
778        VectorAConstant: LLVMValueRef,
779        VectorBConstant: LLVMValueRef,
780        MaskConstant: LLVMValueRef,
781    ) -> LLVMValueRef;
782    #[deprecated(since = "70.0.0", note = "Use LLVMGetInlineAsm instead")]
783    pub fn LLVMConstInlineAsm(
784        Ty: LLVMTypeRef,
785        AsmString: *const ::libc::c_char,
786        Constraints: *const ::libc::c_char,
787        HasSideEffects: LLVMBool,
788        IsAlignStack: LLVMBool,
789    ) -> LLVMValueRef;
790    pub fn LLVMBlockAddress(F: LLVMValueRef, BB: LLVMBasicBlockRef) -> LLVMValueRef;
791    /// Gets the function associated with a given BlockAddress constant value.
792    pub fn LLVMGetBlockAddressFunction(BlockAddr: LLVMValueRef) -> LLVMValueRef;
793    /// Gets the basic block associated with a given BlockAddress constant value.
794    pub fn LLVMGetBlockAddressBasicBlock(BlockAddr: LLVMValueRef) -> LLVMBasicBlockRef;
795
796    // Core->Values->Constants->Global Values
797    pub fn LLVMGetGlobalParent(Global: LLVMValueRef) -> LLVMModuleRef;
798    pub fn LLVMIsDeclaration(Global: LLVMValueRef) -> LLVMBool;
799    pub fn LLVMGetLinkage(Global: LLVMValueRef) -> LLVMLinkage;
800    pub fn LLVMSetLinkage(Global: LLVMValueRef, Linkage: LLVMLinkage);
801    pub fn LLVMGetSection(Global: LLVMValueRef) -> *const ::libc::c_char;
802    pub fn LLVMSetSection(Global: LLVMValueRef, Section: *const ::libc::c_char);
803    pub fn LLVMGetVisibility(Global: LLVMValueRef) -> LLVMVisibility;
804    pub fn LLVMSetVisibility(Global: LLVMValueRef, Viz: LLVMVisibility);
805    pub fn LLVMGetDLLStorageClass(Global: LLVMValueRef) -> LLVMDLLStorageClass;
806    pub fn LLVMSetDLLStorageClass(Global: LLVMValueRef, Class: LLVMDLLStorageClass);
807
808    pub fn LLVMGetUnnamedAddress(Global: LLVMValueRef) -> LLVMUnnamedAddr;
809    pub fn LLVMSetUnnamedAddress(Global: LLVMValueRef, UnnamedAddr: LLVMUnnamedAddr);
810    pub fn LLVMGlobalGetValueType(Global: LLVMValueRef) -> LLVMTypeRef;
811    #[deprecated(since = "70.0.0", note = "Use LLVMGetUnnamedAddress instead")]
812    pub fn LLVMHasUnnamedAddr(Global: LLVMValueRef) -> LLVMBool;
813    #[deprecated(since = "70.0.0", note = "Use LLVMSetUnnamedAddress instead")]
814    pub fn LLVMSetUnnamedAddr(Global: LLVMValueRef, HasUnnamedAddr: LLVMBool);
815
816    pub fn LLVMGetAlignment(V: LLVMValueRef) -> ::libc::c_uint;
817    pub fn LLVMSetAlignment(V: LLVMValueRef, Bytes: ::libc::c_uint);
818
819    pub fn LLVMGlobalSetMetadata(Global: LLVMValueRef, Kind: ::libc::c_uint, MD: LLVMMetadataRef);
820    pub fn LLVMGlobalEraseMetadata(Global: LLVMValueRef, Kind: ::libc::c_uint);
821    pub fn LLVMGlobalClearMetadata(Global: LLVMValueRef);
822    pub fn LLVMGlobalCopyAllMetadata(
823        Value: LLVMValueRef,
824        NumEntries: *mut ::libc::size_t,
825    ) -> *mut LLVMValueMetadataEntry;
826    pub fn LLVMDisposeValueMetadataEntries(Entries: *mut LLVMValueMetadataEntry);
827    pub fn LLVMValueMetadataEntriesGetKind(
828        Entries: *mut LLVMValueMetadataEntry,
829        Index: ::libc::c_uint,
830    ) -> ::libc::c_uint;
831    pub fn LLVMValueMetadataEntriesGetMetadata(
832        Entries: *mut LLVMValueMetadataEntry,
833        Index: ::libc::c_uint,
834    ) -> LLVMMetadataRef;
835
836    // Core->Values->Constants->Global Variables
837    pub fn LLVMAddGlobal(
838        M: LLVMModuleRef,
839        Ty: LLVMTypeRef,
840        Name: *const ::libc::c_char,
841    ) -> LLVMValueRef;
842    pub fn LLVMAddGlobalInAddressSpace(
843        M: LLVMModuleRef,
844        Ty: LLVMTypeRef,
845        Name: *const ::libc::c_char,
846        AddressSpace: ::libc::c_uint,
847    ) -> LLVMValueRef;
848    pub fn LLVMGetNamedGlobal(M: LLVMModuleRef, Name: *const ::libc::c_char) -> LLVMValueRef;
849    pub fn LLVMGetNamedGlobalWithLength(
850        M: LLVMModuleRef,
851        Name: *const ::libc::c_char,
852        Length: ::libc::size_t,
853    ) -> LLVMValueRef;
854    pub fn LLVMGetFirstGlobal(M: LLVMModuleRef) -> LLVMValueRef;
855    pub fn LLVMGetLastGlobal(M: LLVMModuleRef) -> LLVMValueRef;
856    pub fn LLVMGetNextGlobal(GlobalVar: LLVMValueRef) -> LLVMValueRef;
857    pub fn LLVMGetPreviousGlobal(GlobalVar: LLVMValueRef) -> LLVMValueRef;
858    pub fn LLVMDeleteGlobal(GlobalVar: LLVMValueRef);
859    pub fn LLVMGetInitializer(GlobalVar: LLVMValueRef) -> LLVMValueRef;
860    pub fn LLVMSetInitializer(GlobalVar: LLVMValueRef, ConstantVal: LLVMValueRef);
861    pub fn LLVMIsThreadLocal(GlobalVar: LLVMValueRef) -> LLVMBool;
862    pub fn LLVMSetThreadLocal(GlobalVar: LLVMValueRef, IsThreadLocal: LLVMBool);
863    pub fn LLVMIsGlobalConstant(GlobalVar: LLVMValueRef) -> LLVMBool;
864    pub fn LLVMSetGlobalConstant(GlobalVar: LLVMValueRef, IsConstant: LLVMBool);
865    pub fn LLVMGetThreadLocalMode(GlobalVar: LLVMValueRef) -> LLVMThreadLocalMode;
866    pub fn LLVMSetThreadLocalMode(GlobalVar: LLVMValueRef, Mode: LLVMThreadLocalMode);
867    pub fn LLVMIsExternallyInitialized(GlobalVar: LLVMValueRef) -> LLVMBool;
868    pub fn LLVMSetExternallyInitialized(GlobalVar: LLVMValueRef, IsExtInit: LLVMBool);
869
870    // Core->Values->Constants->Global Aliases
871    /// Obtain a GlobalAlias value from a Module by its name.
872    ///
873    /// The returned value corresponds to a llvm::GlobalAlias value.
874    pub fn LLVMGetNamedGlobalAlias(
875        M: LLVMModuleRef,
876        Name: *const ::libc::c_char,
877        NameLen: ::libc::size_t,
878    ) -> LLVMValueRef;
879    /// Obtain an iterator to the first GlobalAlias in a Module.
880    pub fn LLVMGetFirstGlobalAlias(M: LLVMModuleRef) -> LLVMValueRef;
881    /// Obtain an iterator to the last GlobalAlias in a Module.
882    pub fn LLVMGetLastGlobalAlias(M: LLVMModuleRef) -> LLVMValueRef;
883    /// Advance a GlobalAlias iterator to the next GlobalAlias.
884    ///
885    /// Returns NULL if the iterator was already at the end and there are no more global aliases.
886    pub fn LLVMGetNextGlobalAlias(GA: LLVMValueRef) -> LLVMValueRef;
887    /// Decrement a GlobalAlias iterator to the previous GlobalAlias.
888    ///
889    /// Returns NULL if the iterator was already at the beginning and there are no previous global aliases.
890    pub fn LLVMGetPreviousGlobalAlias(GA: LLVMValueRef) -> LLVMValueRef;
891    /// Retrieve the target value of an alias.
892    pub fn LLVMAliasGetAliasee(Alias: LLVMValueRef) -> LLVMValueRef;
893    /// Set the target value of an alias.
894    pub fn LLVMAliasSetAliasee(Alias: LLVMValueRef, Aliasee: LLVMValueRef);
895
896    pub fn LLVMAddAlias2(
897        M: LLVMModuleRef,
898        ValueTy: LLVMTypeRef,
899        AddrSpace: ::libc::c_uint,
900        Aliasee: LLVMValueRef,
901        Name: *const ::libc::c_char,
902    ) -> LLVMValueRef;
903
904    // ..->Function Values
905    pub fn LLVMDeleteFunction(Fn: LLVMValueRef);
906    /// Check whether the given function has a personality function.
907    pub fn LLVMHasPersonalityFn(Fn: LLVMValueRef) -> LLVMBool;
908    /// Obtain the personality function attached to the function.
909    ///
910    /// Added in LLVM 3.7.
911    pub fn LLVMGetPersonalityFn(Fn: LLVMValueRef) -> LLVMValueRef;
912    /// Set the personality function attached to the function.
913    ///
914    /// Added in LLVM 3.7.
915    pub fn LLVMSetPersonalityFn(Fn: LLVMValueRef, PersonalityFn: LLVMValueRef);
916    /// Obtain the intrinsic ID number which matches the given function name.
917    pub fn LLVMLookupIntrinsicID(
918        Name: *const ::libc::c_char,
919        NameLen: ::libc::size_t,
920    ) -> ::libc::c_uint;
921    /// Obtain the ID number from a function instance.
922    pub fn LLVMGetIntrinsicID(Fn: LLVMValueRef) -> ::libc::c_uint;
923    pub fn LLVMGetIntrinsicDeclaration(
924        Mod: LLVMModuleRef,
925        ID: ::libc::c_uint,
926        ParamTypes: *mut LLVMTypeRef,
927        ParamCount: ::libc::size_t,
928    ) -> LLVMValueRef;
929    pub fn LLVMIntrinsicGetType(
930        Ctx: LLVMContextRef,
931        ID: ::libc::c_uint,
932        ParamTypes: *mut LLVMTypeRef,
933        ParamCount: ::libc::size_t,
934    ) -> LLVMTypeRef;
935    pub fn LLVMIntrinsicGetName(
936        ID: ::libc::c_uint,
937        NameLength: *mut ::libc::size_t,
938    ) -> *const ::libc::c_char;
939    #[deprecated = "Use LLVMIntrinsicCopyOverloadedName2 instead."]
940    pub fn LLVMIntrinsicCopyOverloadedName(
941        ID: ::libc::c_uint,
942        ParamTypes: *mut LLVMTypeRef,
943        ParamCount: ::libc::size_t,
944        NameLength: *mut ::libc::size_t,
945    ) -> *const ::libc::c_char;
946    pub fn LLVMIntrinsicCopyOverloadedName2(
947        Mod: LLVMModuleRef,
948        ID: ::libc::c_uint,
949        ParamTypes: *mut LLVMTypeRef,
950        ParamCount: ::libc::size_t,
951        NameLength: *mut ::libc::size_t,
952    ) -> *mut ::libc::c_char;
953    pub fn LLVMIntrinsicIsOverloaded(ID: ::libc::c_uint) -> LLVMBool;
954    pub fn LLVMGetFunctionCallConv(Fn: LLVMValueRef) -> ::libc::c_uint;
955    pub fn LLVMSetFunctionCallConv(Fn: LLVMValueRef, CC: ::libc::c_uint);
956    pub fn LLVMGetGC(Fn: LLVMValueRef) -> *const ::libc::c_char;
957    pub fn LLVMSetGC(Fn: LLVMValueRef, Name: *const ::libc::c_char);
958
959    /// Gets the prefix data associated with a function.
960    ///
961    /// Only valid on functions, and only if LLVMHasPrefixData returns true.
962    pub fn LLVMGetPrefixData(Fn: LLVMValueRef) -> LLVMValueRef;
963
964    /// Check if a given function has prefix data. Only valid on functions.
965    pub fn LLVMHasPrefixData(Fn: LLVMValueRef) -> LLVMBool;
966
967    /// Sets the prefix data for the function. Only valid on functions.
968    pub fn LLVMSetPrefixData(Fn: LLVMValueRef, prefixData: LLVMValueRef);
969
970    /// Gets the prologue data associated with a function.
971    ///
972    /// Only valid on functions, and only if LLVMHasPrologueData returns true.
973    pub fn LLVMGetPrologueData(Fn: LLVMValueRef) -> LLVMValueRef;
974
975    /// Check if a given function has prologue data. Only valid on functions.
976    pub fn LLVMHasPrologueData(Fn: LLVMValueRef) -> LLVMBool;
977
978    /// Sets the prologue data for the function. Only valid on functions.
979    pub fn LLVMSetPrologueData(Fn: LLVMValueRef, prologueData: LLVMValueRef);
980
981    pub fn LLVMAddAttributeAtIndex(F: LLVMValueRef, Idx: LLVMAttributeIndex, A: LLVMAttributeRef);
982    pub fn LLVMGetAttributeCountAtIndex(F: LLVMValueRef, Idx: LLVMAttributeIndex)
983        -> ::libc::c_uint;
984    pub fn LLVMGetAttributesAtIndex(
985        F: LLVMValueRef,
986        Idx: LLVMAttributeIndex,
987        Attrs: *mut LLVMAttributeRef,
988    );
989    pub fn LLVMGetEnumAttributeAtIndex(
990        F: LLVMValueRef,
991        Idx: LLVMAttributeIndex,
992        KindID: ::libc::c_uint,
993    ) -> LLVMAttributeRef;
994    pub fn LLVMGetStringAttributeAtIndex(
995        F: LLVMValueRef,
996        Idx: LLVMAttributeIndex,
997        K: *const ::libc::c_char,
998        KLen: ::libc::c_uint,
999    ) -> LLVMAttributeRef;
1000    pub fn LLVMRemoveEnumAttributeAtIndex(
1001        F: LLVMValueRef,
1002        Idx: LLVMAttributeIndex,
1003        KindID: ::libc::c_uint,
1004    );
1005    pub fn LLVMRemoveStringAttributeAtIndex(
1006        F: LLVMValueRef,
1007        Idx: LLVMAttributeIndex,
1008        K: *const ::libc::c_char,
1009        KLen: ::libc::c_uint,
1010    );
1011    pub fn LLVMAddTargetDependentFunctionAttr(
1012        Fn: LLVMValueRef,
1013        A: *const ::libc::c_char,
1014        V: *const ::libc::c_char,
1015    );
1016
1017    // ..->Function Values->Function Parameters
1018    pub fn LLVMCountParams(Fn: LLVMValueRef) -> ::libc::c_uint;
1019    pub fn LLVMGetParams(Fn: LLVMValueRef, Params: *mut LLVMValueRef);
1020    pub fn LLVMGetParam(Fn: LLVMValueRef, Index: ::libc::c_uint) -> LLVMValueRef;
1021    pub fn LLVMGetParamParent(Inst: LLVMValueRef) -> LLVMValueRef;
1022    pub fn LLVMGetFirstParam(Fn: LLVMValueRef) -> LLVMValueRef;
1023    pub fn LLVMGetLastParam(Fn: LLVMValueRef) -> LLVMValueRef;
1024    pub fn LLVMGetNextParam(Arg: LLVMValueRef) -> LLVMValueRef;
1025    pub fn LLVMGetPreviousParam(Arg: LLVMValueRef) -> LLVMValueRef;
1026    pub fn LLVMSetParamAlignment(Arg: LLVMValueRef, Align: ::libc::c_uint);
1027}
1028
1029// Core->Metadata
1030extern "C" {
1031    #[deprecated(since = "90.0.0", note = "Use LLVMMDStringInContext2 instead.")]
1032    pub fn LLVMMDStringInContext(
1033        C: LLVMContextRef,
1034        Str: *const ::libc::c_char,
1035        SLen: ::libc::c_uint,
1036    ) -> LLVMValueRef;
1037    #[deprecated(since = "90.0.0", note = "Use LLVMMDStringInContext2 instead.")]
1038    pub fn LLVMMDString(Str: *const ::libc::c_char, SLen: ::libc::c_uint) -> LLVMValueRef;
1039    #[deprecated(since = "90.0.0", note = "Use LLVMMDNodeInContext2 instead.")]
1040    pub fn LLVMMDNodeInContext(
1041        C: LLVMContextRef,
1042        Vals: *mut LLVMValueRef,
1043        Count: ::libc::c_uint,
1044    ) -> LLVMValueRef;
1045    #[deprecated(since = "90.0.0", note = "Use LLVMMDNodeInContext2 instead.")]
1046    pub fn LLVMMDNode(Vals: *mut LLVMValueRef, Count: ::libc::c_uint) -> LLVMValueRef;
1047
1048    /// Create a new operand bundle.
1049    ///
1050    /// Every invocation should be paired with LLVMDisposeOperandBundle() or memory
1051    /// will be leaked.
1052    pub fn LLVMCreateOperandBundle(
1053        Tag: *const ::libc::c_char,
1054        TagLen: ::libc::size_t,
1055        Args: *mut LLVMValueRef,
1056        NumArgs: ::libc::c_uint,
1057    ) -> LLVMOperandBundleRef;
1058
1059    /// Destroy an operand bundle.
1060    ///
1061    /// This must be called for every created operand bundle or memory will be
1062    /// leaked.
1063    pub fn LLVMDisposeOperandBundle(Bundle: LLVMOperandBundleRef);
1064
1065    /// Obtain the tag of an operand bundle as a string.
1066    ///
1067    /// @param Bundle Operand bundle to obtain tag of.
1068    /// @param Len Out parameter which holds the length of the returned string.
1069    /// @return The tag name of Bundle.
1070    /// @see OperandBundleDef::getTag()
1071    pub fn LLVMGetOperandBundleTag(
1072        Bundle: LLVMOperandBundleRef,
1073        Len: *mut ::libc::size_t,
1074    ) -> *const ::libc::c_char;
1075
1076    /// Obtain the number of operands for an operand bundle.
1077    pub fn LLVMGetNumOperandBundleArgs(Bundle: LLVMOperandBundleRef) -> ::libc::c_uint;
1078
1079    /// Obtain the operand for an operand bundle at the given index.
1080    pub fn LLVMGetOperandBundleArgAtIndex(
1081        Bundle: LLVMOperandBundleRef,
1082        Index: ::libc::c_uint,
1083    ) -> LLVMValueRef;
1084
1085    /// Add a global indirect function to a module under a specified name.
1086    pub fn LLVMAddGlobalIFunc(
1087        M: LLVMModuleRef,
1088        Name: *const ::libc::c_char,
1089        NameLen: ::libc::size_t,
1090        Ty: LLVMTypeRef,
1091        AddrSpace: ::libc::c_uint,
1092        Resolver: LLVMValueRef,
1093    ) -> LLVMValueRef;
1094
1095    /// Obtain a GlobalIFunc value from a Module by its name.
1096    pub fn LLVMGetNamedGlobalIFunc(
1097        M: LLVMModuleRef,
1098        Name: *const ::libc::c_char,
1099        NameLen: ::libc::size_t,
1100    ) -> LLVMValueRef;
1101
1102    /// Obtain an iterator to the first GlobalIFunc in a Module.
1103    pub fn LLVMGetFirstGlobalIFunc(M: LLVMModuleRef) -> LLVMValueRef;
1104
1105    /// Obtain an iterator to the last GlobalIFunc in a Module.
1106    pub fn LLVMGetLastGlobalIFunc(M: LLVMModuleRef) -> LLVMValueRef;
1107
1108    /// Advance a GlobalIFunc iterator to the next GlobalIFunc.
1109    pub fn LLVMGetNextGlobalIFunc(IFunc: LLVMValueRef) -> LLVMValueRef;
1110
1111    /// Decrement a GlobalIFunc iterator to the previous GlobalIFunc.
1112    pub fn LLVMGetPreviousGlobalIFunc(IFunc: LLVMValueRef) -> LLVMValueRef;
1113
1114    /// Retrieves the resolver function associated with this indirect function, or
1115    /// NULL if it doesn't not exist.
1116    pub fn LLVMGetGlobalIFuncResolver(IFunc: LLVMValueRef) -> LLVMValueRef;
1117
1118    /// Sets the resolver function associated with this indirect function.
1119    pub fn LLVMSetGlobalIFuncResolver(IFunc: LLVMValueRef, Resolver: LLVMValueRef);
1120
1121    /// Remove a global indirect function from its parent module and delete it.
1122    pub fn LLVMEraseGlobalIFunc(IFunc: LLVMValueRef);
1123
1124    /// Remove a global indirect function from its parent module.
1125    pub fn LLVMRemoveGlobalIFunc(IFunc: LLVMValueRef);
1126
1127    /// Create an MDString value from a given string value.
1128    pub fn LLVMMDStringInContext2(
1129        C: LLVMContextRef,
1130        Str: *const ::libc::c_char,
1131        SLen: ::libc::size_t,
1132    ) -> LLVMMetadataRef;
1133
1134    /// Create an MDNode value with the given array of operands.
1135    pub fn LLVMMDNodeInContext2(
1136        C: LLVMContextRef,
1137        MDs: *mut LLVMMetadataRef,
1138        Count: ::libc::size_t,
1139    ) -> LLVMMetadataRef;
1140
1141    /// Obtain Metadata as a Value.
1142    pub fn LLVMMetadataAsValue(C: LLVMContextRef, MD: LLVMMetadataRef) -> LLVMValueRef;
1143    /// Obtain a Value as Metadata.
1144    pub fn LLVMValueAsMetadata(Val: LLVMValueRef) -> LLVMMetadataRef;
1145    /// Obtain the underlying string from a MDString value.
1146    ///
1147    /// `Len` is written to contain the length of the returned string.
1148    pub fn LLVMGetMDString(V: LLVMValueRef, Len: *mut ::libc::c_uint) -> *const ::libc::c_char;
1149    pub fn LLVMGetMDNodeNumOperands(V: LLVMValueRef) -> ::libc::c_uint;
1150    pub fn LLVMGetMDNodeOperands(V: LLVMValueRef, Dest: *mut LLVMValueRef);
1151    /// Replace an operand at a specific index in a llvm::MDNode value.
1152    pub fn LLVMReplaceMDNodeOperandWith(
1153        V: LLVMValueRef,
1154        Index: ::libc::c_uint,
1155        Replacement: LLVMMetadataRef,
1156    );
1157}
1158
1159// Core->Basic Block
1160extern "C" {
1161    pub fn LLVMBasicBlockAsValue(BB: LLVMBasicBlockRef) -> LLVMValueRef;
1162    pub fn LLVMValueIsBasicBlock(Val: LLVMValueRef) -> LLVMBool;
1163    pub fn LLVMValueAsBasicBlock(Val: LLVMValueRef) -> LLVMBasicBlockRef;
1164    /// Get the string name of a basic block.
1165    pub fn LLVMGetBasicBlockName(BB: LLVMBasicBlockRef) -> *const ::libc::c_char;
1166    pub fn LLVMGetBasicBlockParent(BB: LLVMBasicBlockRef) -> LLVMValueRef;
1167    pub fn LLVMGetBasicBlockTerminator(BB: LLVMBasicBlockRef) -> LLVMValueRef;
1168    pub fn LLVMCountBasicBlocks(Fn: LLVMValueRef) -> ::libc::c_uint;
1169    pub fn LLVMGetBasicBlocks(Fn: LLVMValueRef, BasicBlocks: *mut LLVMBasicBlockRef);
1170    pub fn LLVMGetFirstBasicBlock(Fn: LLVMValueRef) -> LLVMBasicBlockRef;
1171    pub fn LLVMGetLastBasicBlock(Fn: LLVMValueRef) -> LLVMBasicBlockRef;
1172    pub fn LLVMGetNextBasicBlock(BB: LLVMBasicBlockRef) -> LLVMBasicBlockRef;
1173    pub fn LLVMGetPreviousBasicBlock(BB: LLVMBasicBlockRef) -> LLVMBasicBlockRef;
1174    pub fn LLVMGetEntryBasicBlock(Fn: LLVMValueRef) -> LLVMBasicBlockRef;
1175    /// Insert the given basic block after the insertion point of the given builder.
1176    pub fn LLVMInsertExistingBasicBlockAfterInsertBlock(
1177        Builder: LLVMBuilderRef,
1178        BB: LLVMBasicBlockRef,
1179    );
1180    /// Append the given basic block to the basic block list of the given function.
1181    pub fn LLVMAppendExistingBasicBlock(Fn: LLVMValueRef, BB: LLVMBasicBlockRef);
1182    pub fn LLVMCreateBasicBlockInContext(
1183        C: LLVMContextRef,
1184        Name: *const ::libc::c_char,
1185    ) -> LLVMBasicBlockRef;
1186    pub fn LLVMAppendBasicBlockInContext(
1187        C: LLVMContextRef,
1188        Fn: LLVMValueRef,
1189        Name: *const ::libc::c_char,
1190    ) -> LLVMBasicBlockRef;
1191    pub fn LLVMAppendBasicBlock(Fn: LLVMValueRef, Name: *const ::libc::c_char)
1192        -> LLVMBasicBlockRef;
1193    pub fn LLVMInsertBasicBlockInContext(
1194        C: LLVMContextRef,
1195        BB: LLVMBasicBlockRef,
1196        Name: *const ::libc::c_char,
1197    ) -> LLVMBasicBlockRef;
1198    pub fn LLVMInsertBasicBlock(
1199        InsertBeforeBB: LLVMBasicBlockRef,
1200        Name: *const ::libc::c_char,
1201    ) -> LLVMBasicBlockRef;
1202    pub fn LLVMDeleteBasicBlock(BB: LLVMBasicBlockRef);
1203    pub fn LLVMRemoveBasicBlockFromParent(BB: LLVMBasicBlockRef);
1204    pub fn LLVMMoveBasicBlockBefore(BB: LLVMBasicBlockRef, MovePos: LLVMBasicBlockRef);
1205    pub fn LLVMMoveBasicBlockAfter(BB: LLVMBasicBlockRef, MovePos: LLVMBasicBlockRef);
1206    pub fn LLVMGetFirstInstruction(BB: LLVMBasicBlockRef) -> LLVMValueRef;
1207    pub fn LLVMGetLastInstruction(BB: LLVMBasicBlockRef) -> LLVMValueRef;
1208}
1209
1210// Core->Instructions
1211extern "C" {
1212    pub fn LLVMHasMetadata(Val: LLVMValueRef) -> ::libc::c_int;
1213    pub fn LLVMGetMetadata(Val: LLVMValueRef, KindID: ::libc::c_uint) -> LLVMValueRef;
1214    pub fn LLVMSetMetadata(Val: LLVMValueRef, KindID: ::libc::c_uint, Node: LLVMValueRef);
1215    pub fn LLVMInstructionGetAllMetadataOtherThanDebugLoc(
1216        Instr: LLVMValueRef,
1217        NumEntries: *mut ::libc::size_t,
1218    ) -> *mut LLVMValueMetadataEntry;
1219    pub fn LLVMGetInstructionParent(Inst: LLVMValueRef) -> LLVMBasicBlockRef;
1220    pub fn LLVMGetNextInstruction(Inst: LLVMValueRef) -> LLVMValueRef;
1221    pub fn LLVMGetPreviousInstruction(Inst: LLVMValueRef) -> LLVMValueRef;
1222    /// Remove the given instruction from its containing building block but
1223    /// kept alive.
1224    pub fn LLVMInstructionRemoveFromParent(Inst: LLVMValueRef);
1225    /// Remove the given instruction from its containing building block and
1226    /// delete it.
1227    pub fn LLVMInstructionEraseFromParent(Inst: LLVMValueRef);
1228    /// Remove the given instruction that is not inserted into a basic block.
1229    /// It must have previously been removed from its containing building block.
1230    pub fn LLVMDeleteInstruction(Inst: LLVMValueRef);
1231    pub fn LLVMGetInstructionOpcode(Inst: LLVMValueRef) -> LLVMOpcode;
1232    pub fn LLVMGetICmpPredicate(Inst: LLVMValueRef) -> LLVMIntPredicate;
1233    /// Get whether or not an icmp instruction has the samesign flag.
1234    ///
1235    /// This is only valid for instructions that correspond to `llvm::ICmpInst`.
1236    pub fn LLVMGetICmpSameSign(Inst: LLVMValueRef) -> LLVMBool;
1237    /// Set the samesign flag on an icmp instruction.
1238    ///
1239    /// This is only valid for instructions that correspond to `llvm::ICmpInst`.
1240    pub fn LLVMSetICmpSameSign(Inst: LLVMValueRef, SameSign: LLVMBool);
1241    pub fn LLVMGetFCmpPredicate(Inst: LLVMValueRef) -> LLVMRealPredicate;
1242    pub fn LLVMInstructionClone(Inst: LLVMValueRef) -> LLVMValueRef;
1243    pub fn LLVMIsATerminatorInst(Inst: LLVMValueRef) -> LLVMValueRef;
1244
1245    /// Obtain the first debug record attached to an instruction.
1246    ///
1247    /// Use LLVMGetNextDbgRecord() and LLVMGetPreviousDbgRecord() to traverse the
1248    /// sequence of DbgRecords.
1249    ///
1250    /// Return the first DbgRecord attached to Inst or NULL if there are none.
1251    pub fn LLVMGetFirstDbgRecord(Inst: LLVMValueRef) -> LLVMDbgRecordRef;
1252    /// Obtain the last debug record attached to an instruction.
1253    ///
1254    /// Return the last DbgRecord attached to Inst or NULL if there are none.
1255    pub fn LLVMGetLastDbgRecord(Inst: LLVMValueRef) -> LLVMDbgRecordRef;
1256    /// Obtain the next DbgRecord in the sequence or NULL if there are no more.
1257    pub fn LLVMGetNextDbgRecord(DbgRecord: LLVMDbgRecordRef) -> LLVMDbgRecordRef;
1258    /// Obtain the previous DbgRecord in the sequence or NULL if there are no more.
1259    pub fn LLVMGetPreviousDbgRecord(DbgRecord: LLVMDbgRecordRef) -> LLVMDbgRecordRef;
1260
1261    // Instructions->Call Sites and Invocations
1262    // Obtain the argument count for a call instruction.
1263    //
1264    // The provided value should be either a CallInst, InvokeInst or FuncletPadInst.
1265    pub fn LLVMGetNumArgOperands(Instr: LLVMValueRef) -> ::libc::c_uint;
1266    pub fn LLVMSetInstructionCallConv(Instr: LLVMValueRef, CC: ::libc::c_uint);
1267    pub fn LLVMGetInstructionCallConv(Instr: LLVMValueRef) -> ::libc::c_uint;
1268    pub fn LLVMSetInstrParamAlignment(
1269        Instr: LLVMValueRef,
1270        Idx: LLVMAttributeIndex,
1271        Align: ::libc::c_uint,
1272    );
1273    pub fn LLVMAddCallSiteAttribute(C: LLVMValueRef, Idx: LLVMAttributeIndex, A: LLVMAttributeRef);
1274    pub fn LLVMGetCallSiteAttributeCount(
1275        C: LLVMValueRef,
1276        Idx: LLVMAttributeIndex,
1277    ) -> ::libc::c_uint;
1278    pub fn LLVMGetCallSiteAttributes(
1279        C: LLVMValueRef,
1280        Idx: LLVMAttributeIndex,
1281        Attrs: *mut LLVMAttributeRef,
1282    );
1283    pub fn LLVMGetCallSiteEnumAttribute(
1284        C: LLVMValueRef,
1285        Idx: LLVMAttributeIndex,
1286        KindID: ::libc::c_uint,
1287    ) -> LLVMAttributeRef;
1288    pub fn LLVMGetCallSiteStringAttribute(
1289        C: LLVMValueRef,
1290        Idx: LLVMAttributeIndex,
1291        K: *const ::libc::c_char,
1292        KLen: ::libc::c_uint,
1293    ) -> LLVMAttributeRef;
1294    pub fn LLVMRemoveCallSiteEnumAttribute(
1295        C: LLVMValueRef,
1296        Idx: LLVMAttributeIndex,
1297        KindID: ::libc::c_uint,
1298    );
1299    pub fn LLVMRemoveCallSiteStringAttribute(
1300        C: LLVMValueRef,
1301        Idx: LLVMAttributeIndex,
1302        K: *const ::libc::c_char,
1303        KLen: ::libc::c_uint,
1304    );
1305    pub fn LLVMGetCalledFunctionType(C: LLVMValueRef) -> LLVMTypeRef;
1306    /// Get a pointer to the function invoked by this instruction.
1307    ///
1308    /// The provided value should be a CallInst or InvokeInst.
1309    pub fn LLVMGetCalledValue(Instr: LLVMValueRef) -> LLVMValueRef;
1310    /// Get the number of operand bundles attached to this instruction.
1311    ///
1312    /// Only works with CallInst and InvokeInst instructions.
1313    pub fn LLVMGetNumOperandBundles(C: LLVMValueRef) -> ::libc::c_uint;
1314    /// Get the operand bundle attached to this instruction at the given index.
1315    ///
1316    /// Use LLVMDisposeOperandBundle to free the operand bundle. This only works
1317    /// on CallInst and InvokeInst instructions.
1318    pub fn LLVMGetOperandBundleAtIndex(
1319        C: LLVMValueRef,
1320        Index: ::libc::c_uint,
1321    ) -> LLVMOperandBundleRef;
1322    /// Get whether a call instruction is a tail call.
1323    pub fn LLVMIsTailCall(CallInst: LLVMValueRef) -> LLVMBool;
1324    pub fn LLVMSetTailCall(CallInst: LLVMValueRef, IsTailCall: LLVMBool);
1325    pub fn LLVMGetTailCallKind(CallInst: LLVMValueRef) -> LLVMTailCallKind;
1326    pub fn LLVMSetTailCallKind(CallInst: LLVMValueRef, kind: LLVMTailCallKind);
1327    /// Return the normal destination basic block of an invoke instruction.
1328    pub fn LLVMGetNormalDest(InvokeInst: LLVMValueRef) -> LLVMBasicBlockRef;
1329    /// Return the unwind destination basic block.
1330    pub fn LLVMGetUnwindDest(InvokeInst: LLVMValueRef) -> LLVMBasicBlockRef;
1331    /// Set the normal destination basic block.
1332    pub fn LLVMSetNormalDest(InvokeInst: LLVMValueRef, B: LLVMBasicBlockRef);
1333    /// Set the unwind destination basic block.
1334    pub fn LLVMSetUnwindDest(InvokeInst: LLVMValueRef, B: LLVMBasicBlockRef);
1335
1336    /// Get the default destination of a CallBr instruction.
1337    pub fn LLVMGetCallBrDefaultDest(CallBr: LLVMValueRef) -> LLVMBasicBlockRef;
1338    /// Get the number of indirect destinations of a CallBr instruction.
1339    pub fn LLVMGetCallBrNumIndirectDests(CallBr: LLVMValueRef) -> ::libc::c_uint;
1340    /// Get the indirect destination of a CallBr instruction at the given index.
1341    pub fn LLVMGetCallBrIndirectDest(
1342        CallBr: LLVMValueRef,
1343        Idx: ::libc::c_uint,
1344    ) -> LLVMBasicBlockRef;
1345
1346    // Instructions->Terminators
1347    pub fn LLVMGetNumSuccessors(Term: LLVMValueRef) -> ::libc::c_uint;
1348    pub fn LLVMGetSuccessor(Term: LLVMValueRef, i: ::libc::c_uint) -> LLVMBasicBlockRef;
1349    pub fn LLVMSetSuccessor(Term: LLVMValueRef, i: ::libc::c_uint, block: LLVMBasicBlockRef);
1350    pub fn LLVMIsConditional(Branch: LLVMValueRef) -> LLVMBool;
1351    pub fn LLVMGetCondition(Branch: LLVMValueRef) -> LLVMValueRef;
1352    pub fn LLVMSetCondition(Branch: LLVMValueRef, Cond: LLVMValueRef);
1353    pub fn LLVMGetSwitchDefaultDest(SwitchInstr: LLVMValueRef) -> LLVMBasicBlockRef;
1354
1355    // Instructions->Allocas
1356    // Obtain the type being allocated by an alloca instruction.
1357    pub fn LLVMGetAllocatedType(Alloca: LLVMValueRef) -> LLVMTypeRef;
1358
1359    // Instructions->GEPs
1360    // Check whether the given GEP operator is inbounds.
1361    pub fn LLVMIsInBounds(GEP: LLVMValueRef) -> LLVMBool;
1362    /// Set the given GEP instruction to be inbounds or not.
1363    pub fn LLVMSetIsInBounds(GEP: LLVMValueRef, InBounds: LLVMBool);
1364
1365    /// Get the source element type of the given GEP operator.
1366    pub fn LLVMGetGEPSourceElementType(GEP: LLVMValueRef) -> LLVMTypeRef;
1367    /// Get the no-wrap related flags for the given GEP instruction.
1368    pub fn LLVMGEPGetNoWrapFlags(GEP: LLVMValueRef) -> LLVMGEPNoWrapFlags;
1369    /// Set the no-wrap related flags for the given GEP instruction.
1370    pub fn LLVMGEPSetNoWrapFlags(GEP: LLVMValueRef, NoWrapFlags: LLVMGEPNoWrapFlags);
1371
1372    // Instruction->PHI Nodes
1373    pub fn LLVMAddIncoming(
1374        PhiNode: LLVMValueRef,
1375        IncomingValues: *mut LLVMValueRef,
1376        IncomingBlocks: *mut LLVMBasicBlockRef,
1377        Count: ::libc::c_uint,
1378    );
1379    pub fn LLVMCountIncoming(PhiNode: LLVMValueRef) -> ::libc::c_uint;
1380    pub fn LLVMGetIncomingValue(PhiNode: LLVMValueRef, Index: ::libc::c_uint) -> LLVMValueRef;
1381    pub fn LLVMGetIncomingBlock(PhiNode: LLVMValueRef, Index: ::libc::c_uint) -> LLVMBasicBlockRef;
1382}
1383
1384// Core->Values again; these don't appear in Doxygen because they're macro-generated.
1385extern "C" {
1386    pub fn LLVMIsAArgument(Val: LLVMValueRef) -> LLVMValueRef;
1387    pub fn LLVMIsABasicBlock(Val: LLVMValueRef) -> LLVMValueRef;
1388    pub fn LLVMIsAInlineAsm(Val: LLVMValueRef) -> LLVMValueRef;
1389    pub fn LLVMIsAUser(Val: LLVMValueRef) -> LLVMValueRef;
1390    pub fn LLVMIsAConstant(Val: LLVMValueRef) -> LLVMValueRef;
1391    pub fn LLVMIsABlockAddress(Val: LLVMValueRef) -> LLVMValueRef;
1392    pub fn LLVMIsAConstantAggregateZero(Val: LLVMValueRef) -> LLVMValueRef;
1393    pub fn LLVMIsAConstantArray(Val: LLVMValueRef) -> LLVMValueRef;
1394    pub fn LLVMIsAConstantDataSequential(Val: LLVMValueRef) -> LLVMValueRef;
1395    pub fn LLVMIsAConstantDataArray(Val: LLVMValueRef) -> LLVMValueRef;
1396    pub fn LLVMIsAConstantDataVector(Val: LLVMValueRef) -> LLVMValueRef;
1397    pub fn LLVMIsAConstantExpr(Val: LLVMValueRef) -> LLVMValueRef;
1398    pub fn LLVMIsAConstantFP(Val: LLVMValueRef) -> LLVMValueRef;
1399    pub fn LLVMIsAConstantInt(Val: LLVMValueRef) -> LLVMValueRef;
1400    pub fn LLVMIsAConstantPointerNull(Val: LLVMValueRef) -> LLVMValueRef;
1401    pub fn LLVMIsAConstantStruct(Val: LLVMValueRef) -> LLVMValueRef;
1402    pub fn LLVMIsAConstantTokenNone(Val: LLVMValueRef) -> LLVMValueRef;
1403    pub fn LLVMIsAConstantVector(Val: LLVMValueRef) -> LLVMValueRef;
1404    pub fn LLVMIsAConstantPtrAuth(Val: LLVMValueRef) -> LLVMValueRef;
1405    pub fn LLVMIsAGlobalValue(Val: LLVMValueRef) -> LLVMValueRef;
1406    pub fn LLVMIsAGlobalAlias(Val: LLVMValueRef) -> LLVMValueRef;
1407    pub fn LLVMIsAGlobalIFunc(Val: LLVMValueRef) -> LLVMValueRef;
1408    pub fn LLVMIsAGlobalObject(Val: LLVMValueRef) -> LLVMValueRef;
1409    pub fn LLVMIsAFunction(Val: LLVMValueRef) -> LLVMValueRef;
1410    pub fn LLVMIsAGlobalVariable(Val: LLVMValueRef) -> LLVMValueRef;
1411    pub fn LLVMIsAUndefValue(Val: LLVMValueRef) -> LLVMValueRef;
1412    pub fn LLVMIsAPoisonValue(Val: LLVMValueRef) -> LLVMValueRef;
1413    pub fn LLVMIsAInstruction(Val: LLVMValueRef) -> LLVMValueRef;
1414    pub fn LLVMIsAUnaryOperator(Val: LLVMValueRef) -> LLVMValueRef;
1415    pub fn LLVMIsABinaryOperator(Val: LLVMValueRef) -> LLVMValueRef;
1416    pub fn LLVMIsACallInst(Val: LLVMValueRef) -> LLVMValueRef;
1417    pub fn LLVMIsAIntrinsicInst(Val: LLVMValueRef) -> LLVMValueRef;
1418    pub fn LLVMIsADbgInfoIntrinsic(Val: LLVMValueRef) -> LLVMValueRef;
1419    pub fn LLVMIsADbgVariableIntrinsic(Val: LLVMValueRef) -> LLVMValueRef;
1420    pub fn LLVMIsADbgDeclareInst(Val: LLVMValueRef) -> LLVMValueRef;
1421    pub fn LLVMIsADbgLabelInst(Val: LLVMValueRef) -> LLVMValueRef;
1422    pub fn LLVMIsAMemIntrinsic(Val: LLVMValueRef) -> LLVMValueRef;
1423    pub fn LLVMIsAMemCpyInst(Val: LLVMValueRef) -> LLVMValueRef;
1424    pub fn LLVMIsAMemMoveInst(Val: LLVMValueRef) -> LLVMValueRef;
1425    pub fn LLVMIsAMemSetInst(Val: LLVMValueRef) -> LLVMValueRef;
1426    pub fn LLVMIsACmpInst(Val: LLVMValueRef) -> LLVMValueRef;
1427    pub fn LLVMIsAFCmpInst(Val: LLVMValueRef) -> LLVMValueRef;
1428    pub fn LLVMIsAICmpInst(Val: LLVMValueRef) -> LLVMValueRef;
1429    pub fn LLVMIsAExtractElementInst(Val: LLVMValueRef) -> LLVMValueRef;
1430    pub fn LLVMIsAGetElementPtrInst(Val: LLVMValueRef) -> LLVMValueRef;
1431    pub fn LLVMIsAInsertElementInst(Val: LLVMValueRef) -> LLVMValueRef;
1432    pub fn LLVMIsAInsertValueInst(Val: LLVMValueRef) -> LLVMValueRef;
1433    pub fn LLVMIsALandingPadInst(Val: LLVMValueRef) -> LLVMValueRef;
1434    pub fn LLVMIsAPHINode(Val: LLVMValueRef) -> LLVMValueRef;
1435    pub fn LLVMIsASelectInst(Val: LLVMValueRef) -> LLVMValueRef;
1436    pub fn LLVMIsAShuffleVectorInst(Val: LLVMValueRef) -> LLVMValueRef;
1437    pub fn LLVMIsAStoreInst(Val: LLVMValueRef) -> LLVMValueRef;
1438    pub fn LLVMIsABranchInst(Val: LLVMValueRef) -> LLVMValueRef;
1439    pub fn LLVMIsAIndirectBrInst(Val: LLVMValueRef) -> LLVMValueRef;
1440    pub fn LLVMIsAInvokeInst(Val: LLVMValueRef) -> LLVMValueRef;
1441    pub fn LLVMIsAReturnInst(Val: LLVMValueRef) -> LLVMValueRef;
1442    pub fn LLVMIsASwitchInst(Val: LLVMValueRef) -> LLVMValueRef;
1443    pub fn LLVMIsAUnreachableInst(Val: LLVMValueRef) -> LLVMValueRef;
1444    pub fn LLVMIsAResumeInst(Val: LLVMValueRef) -> LLVMValueRef;
1445    pub fn LLVMIsACleanupReturnInst(Val: LLVMValueRef) -> LLVMValueRef;
1446    pub fn LLVMIsACatchReturnInst(Val: LLVMValueRef) -> LLVMValueRef;
1447    pub fn LLVMIsACatchSwitchInst(Val: LLVMValueRef) -> LLVMValueRef;
1448    pub fn LLVMIsACallBrInst(Val: LLVMValueRef) -> LLVMValueRef;
1449    pub fn LLVMIsAFuncletPadInst(Val: LLVMValueRef) -> LLVMValueRef;
1450    pub fn LLVMIsACatchPadInst(Val: LLVMValueRef) -> LLVMValueRef;
1451    pub fn LLVMIsACleanupPadInst(Val: LLVMValueRef) -> LLVMValueRef;
1452    pub fn LLVMIsAUnaryInstruction(Val: LLVMValueRef) -> LLVMValueRef;
1453    pub fn LLVMIsAAllocaInst(Val: LLVMValueRef) -> LLVMValueRef;
1454    pub fn LLVMIsACastInst(Val: LLVMValueRef) -> LLVMValueRef;
1455    pub fn LLVMIsAAddrSpaceCastInst(Val: LLVMValueRef) -> LLVMValueRef;
1456    pub fn LLVMIsABitCastInst(Val: LLVMValueRef) -> LLVMValueRef;
1457    pub fn LLVMIsAFPExtInst(Val: LLVMValueRef) -> LLVMValueRef;
1458    pub fn LLVMIsAFPToSIInst(Val: LLVMValueRef) -> LLVMValueRef;
1459    pub fn LLVMIsAFPToUIInst(Val: LLVMValueRef) -> LLVMValueRef;
1460    pub fn LLVMIsAFPTruncInst(Val: LLVMValueRef) -> LLVMValueRef;
1461    pub fn LLVMIsAIntToPtrInst(Val: LLVMValueRef) -> LLVMValueRef;
1462    pub fn LLVMIsAPtrToIntInst(Val: LLVMValueRef) -> LLVMValueRef;
1463    pub fn LLVMIsASExtInst(Val: LLVMValueRef) -> LLVMValueRef;
1464    pub fn LLVMIsASIToFPInst(Val: LLVMValueRef) -> LLVMValueRef;
1465    pub fn LLVMIsATruncInst(Val: LLVMValueRef) -> LLVMValueRef;
1466    pub fn LLVMIsAUIToFPInst(Val: LLVMValueRef) -> LLVMValueRef;
1467    pub fn LLVMIsAZExtInst(Val: LLVMValueRef) -> LLVMValueRef;
1468    pub fn LLVMIsAExtractValueInst(Val: LLVMValueRef) -> LLVMValueRef;
1469    pub fn LLVMIsALoadInst(Val: LLVMValueRef) -> LLVMValueRef;
1470    pub fn LLVMIsAVAArgInst(Val: LLVMValueRef) -> LLVMValueRef;
1471    pub fn LLVMIsAFreezeInst(Val: LLVMValueRef) -> LLVMValueRef;
1472    pub fn LLVMIsAAtomicCmpXchgInst(Val: LLVMValueRef) -> LLVMValueRef;
1473    pub fn LLVMIsAAtomicRMWInst(Val: LLVMValueRef) -> LLVMValueRef;
1474    pub fn LLVMIsAFenceInst(Val: LLVMValueRef) -> LLVMValueRef;
1475}
1476
1477// Core->Extract/Insert Value
1478extern "C" {
1479    /// Get the number of indices on an ExtractValue, InsertValue or GEP operator.
1480    pub fn LLVMGetNumIndices(Inst: LLVMValueRef) -> ::libc::c_uint;
1481    pub fn LLVMGetIndices(Inst: LLVMValueRef) -> *const ::libc::c_uint;
1482}
1483
1484// Core->Instruction Builders
1485extern "C" {
1486    pub fn LLVMCreateBuilderInContext(C: LLVMContextRef) -> LLVMBuilderRef;
1487    pub fn LLVMCreateBuilder() -> LLVMBuilderRef;
1488    /// Set the builder position before Instr but after any attached debug records,
1489    /// or if Instr is null set the position to the end of Block.
1490    pub fn LLVMPositionBuilder(
1491        Builder: LLVMBuilderRef,
1492        Block: LLVMBasicBlockRef,
1493        Instr: LLVMValueRef,
1494    );
1495    /// Set the builder position before Instr and any attached debug records,
1496    /// or if Instr is null set the position to the end of Block.
1497    pub fn LLVMPositionBuilderBeforeDbgRecords(
1498        Builder: LLVMBuilderRef,
1499        Block: LLVMBasicBlockRef,
1500        Inst: LLVMValueRef,
1501    );
1502    /// Set the builder position before Instr but after any attached debug records.
1503    pub fn LLVMPositionBuilderBefore(Builder: LLVMBuilderRef, Instr: LLVMValueRef);
1504    /// Set the builder position before Instr and any attached debug records.
1505    pub fn LLVMPositionBuilderBeforeInstrAndDbgRecords(
1506        Builder: LLVMBuilderRef,
1507        Instr: LLVMValueRef,
1508    );
1509    pub fn LLVMPositionBuilderAtEnd(Builder: LLVMBuilderRef, Block: LLVMBasicBlockRef);
1510    pub fn LLVMGetInsertBlock(Builder: LLVMBuilderRef) -> LLVMBasicBlockRef;
1511    pub fn LLVMClearInsertionPosition(Builder: LLVMBuilderRef);
1512    pub fn LLVMInsertIntoBuilder(Builder: LLVMBuilderRef, Instr: LLVMValueRef);
1513    pub fn LLVMInsertIntoBuilderWithName(
1514        Builder: LLVMBuilderRef,
1515        Instr: LLVMValueRef,
1516        Name: *const ::libc::c_char,
1517    );
1518    pub fn LLVMDisposeBuilder(Builder: LLVMBuilderRef);
1519
1520    // Metadata
1521    /// Get location information used by debugging information.
1522    pub fn LLVMGetCurrentDebugLocation2(Builder: LLVMBuilderRef) -> LLVMMetadataRef;
1523    /// Set location information used by debugging information.
1524    pub fn LLVMSetCurrentDebugLocation2(Builder: LLVMBuilderRef, Loc: LLVMMetadataRef);
1525    /// Attempts to set the debug location for the given instruction using the
1526    /// current debug location for the given builder.  If the builder has no current
1527    /// debug location, this function is a no-op.
1528    #[deprecated(
1529        since = "140.0.0",
1530        note = "Deprecated in favor of the more general LLVMAddMetadataToInst."
1531    )]
1532    pub fn LLVMSetInstDebugLocation(Builder: LLVMBuilderRef, Inst: LLVMValueRef);
1533    /// Adds the metadata registered with the given builder to the given instruction.
1534    pub fn LLVMAddMetadataToInst(Builder: LLVMBuilderRef, Inst: LLVMValueRef);
1535    /// Get the dafult floating-point math metadata for a given builder.
1536    pub fn LLVMBuilderGetDefaultFPMathTag(Builder: LLVMBuilderRef) -> LLVMMetadataRef;
1537    /// Set the default floating-point math metadata for the given builder.
1538    pub fn LLVMBuilderSetDefaultFPMathTag(Builder: LLVMBuilderRef, FPMathTag: LLVMMetadataRef);
1539
1540    /// Obtain the context to which this builder is associated.
1541    pub fn LLVMGetBuilderContext(Builder: LLVMBuilderRef) -> LLVMContextRef;
1542
1543    #[deprecated(since = "90.0.0", note = "Use LLVMGetCurrentDebugLocation2 instead.")]
1544    pub fn LLVMSetCurrentDebugLocation(Builder: LLVMBuilderRef, L: LLVMValueRef);
1545    pub fn LLVMGetCurrentDebugLocation(Builder: LLVMBuilderRef) -> LLVMValueRef;
1546
1547    // Terminators
1548    pub fn LLVMBuildRetVoid(arg1: LLVMBuilderRef) -> LLVMValueRef;
1549    pub fn LLVMBuildRet(arg1: LLVMBuilderRef, V: LLVMValueRef) -> LLVMValueRef;
1550    pub fn LLVMBuildAggregateRet(
1551        arg1: LLVMBuilderRef,
1552        RetVals: *mut LLVMValueRef,
1553        N: ::libc::c_uint,
1554    ) -> LLVMValueRef;
1555    pub fn LLVMBuildBr(arg1: LLVMBuilderRef, Dest: LLVMBasicBlockRef) -> LLVMValueRef;
1556    pub fn LLVMBuildCondBr(
1557        arg1: LLVMBuilderRef,
1558        If: LLVMValueRef,
1559        Then: LLVMBasicBlockRef,
1560        Else: LLVMBasicBlockRef,
1561    ) -> LLVMValueRef;
1562    pub fn LLVMBuildSwitch(
1563        arg1: LLVMBuilderRef,
1564        V: LLVMValueRef,
1565        Else: LLVMBasicBlockRef,
1566        NumCases: ::libc::c_uint,
1567    ) -> LLVMValueRef;
1568    pub fn LLVMBuildIndirectBr(
1569        B: LLVMBuilderRef,
1570        Addr: LLVMValueRef,
1571        NumDests: ::libc::c_uint,
1572    ) -> LLVMValueRef;
1573    pub fn LLVMBuildCallBr(
1574        B: LLVMBuilderRef,
1575        Ty: LLVMTypeRef,
1576        Fn: LLVMValueRef,
1577        DefaultDest: LLVMBasicBlockRef,
1578        IndirectDests: *mut LLVMBasicBlockRef,
1579        NumIndirectDests: ::libc::c_uint,
1580        Args: *mut LLVMValueRef,
1581        NumArgs: ::libc::c_uint,
1582        Bundles: *mut LLVMOperandBundleRef,
1583        NumBundles: ::libc::c_uint,
1584        Name: *const ::libc::c_char,
1585    ) -> LLVMValueRef;
1586    pub fn LLVMBuildInvoke2(
1587        arg1: LLVMBuilderRef,
1588        Ty: LLVMTypeRef,
1589        Fn: LLVMValueRef,
1590        Args: *mut LLVMValueRef,
1591        NumArgs: ::libc::c_uint,
1592        Then: LLVMBasicBlockRef,
1593        Catch: LLVMBasicBlockRef,
1594        Name: *const ::libc::c_char,
1595    ) -> LLVMValueRef;
1596    pub fn LLVMBuildInvokeWithOperandBundles(
1597        arg1: LLVMBuilderRef,
1598        Ty: LLVMTypeRef,
1599        Fn: LLVMValueRef,
1600        Args: *mut LLVMValueRef,
1601        NumArgs: ::libc::c_uint,
1602        Then: LLVMBasicBlockRef,
1603        Catch: LLVMBasicBlockRef,
1604        Bundles: *mut LLVMOperandBundleRef,
1605        NumBundles: ::libc::c_uint,
1606        Name: *const ::libc::c_char,
1607    ) -> LLVMValueRef;
1608    pub fn LLVMBuildUnreachable(B: LLVMBuilderRef) -> LLVMValueRef;
1609
1610    pub fn LLVMBuildResume(B: LLVMBuilderRef, Exn: LLVMValueRef) -> LLVMValueRef;
1611    pub fn LLVMBuildLandingPad(
1612        B: LLVMBuilderRef,
1613        Ty: LLVMTypeRef,
1614        PersFn: LLVMValueRef,
1615        NumClauses: ::libc::c_uint,
1616        Name: *const ::libc::c_char,
1617    ) -> LLVMValueRef;
1618    pub fn LLVMBuildCleanupRet(
1619        B: LLVMBuilderRef,
1620        CatchPad: LLVMValueRef,
1621        BB: LLVMBasicBlockRef,
1622    ) -> LLVMValueRef;
1623    pub fn LLVMBuildCatchRet(
1624        B: LLVMBuilderRef,
1625        CatchPad: LLVMValueRef,
1626        BB: LLVMBasicBlockRef,
1627    ) -> LLVMValueRef;
1628    pub fn LLVMBuildCatchPad(
1629        B: LLVMBuilderRef,
1630        ParentPad: LLVMValueRef,
1631        Args: *mut LLVMValueRef,
1632        NumArgs: ::libc::c_uint,
1633        Name: *const ::libc::c_char,
1634    ) -> LLVMValueRef;
1635    pub fn LLVMBuildCleanupPad(
1636        B: LLVMBuilderRef,
1637        ParentPad: LLVMValueRef,
1638        Args: *mut LLVMValueRef,
1639        NumArgs: ::libc::c_uint,
1640        Name: *const ::libc::c_char,
1641    ) -> LLVMValueRef;
1642    pub fn LLVMBuildCatchSwitch(
1643        B: LLVMBuilderRef,
1644        ParentPad: LLVMValueRef,
1645        UnwindBB: LLVMBasicBlockRef,
1646        NumHandler: ::libc::c_uint,
1647        Name: *const ::libc::c_char,
1648    ) -> LLVMValueRef;
1649
1650    /// Add a case to a `switch` instruction
1651    pub fn LLVMAddCase(Switch: LLVMValueRef, OnVal: LLVMValueRef, Dest: LLVMBasicBlockRef);
1652
1653    /// Add a destination to an `indirectbr` instruction
1654    pub fn LLVMAddDestination(IndirectBr: LLVMValueRef, Dest: LLVMBasicBlockRef);
1655
1656    /// Get the number of clauses on a landingpad instruction.
1657    pub fn LLVMGetNumClauses(LandingPad: LLVMValueRef) -> ::libc::c_uint;
1658
1659    /// Get the value of the clause with the given index on a landingpad instruction.
1660    pub fn LLVMGetClause(LandingPad: LLVMValueRef, Idx: ::libc::c_uint) -> LLVMValueRef;
1661
1662    /// Add a catch or filter clause to a `landingpad` instruction
1663    pub fn LLVMAddClause(LandingPad: LLVMValueRef, ClauseVal: LLVMValueRef);
1664
1665    /// Get the cleanup flag in a landingpad instruction.
1666    pub fn LLVMIsCleanup(LandingPad: LLVMValueRef) -> LLVMBool;
1667
1668    /// Set the cleanup flag in a `landingpad` instruction.
1669    pub fn LLVMSetCleanup(LandingPad: LLVMValueRef, Val: LLVMBool);
1670
1671    /// Add a destination to the catchswitch instruction
1672    pub fn LLVMAddHandler(CatchSwitch: LLVMValueRef, Dest: LLVMBasicBlockRef);
1673
1674    /// Get the number of handlers on the catchswitch instruction
1675    pub fn LLVMGetNumHandlers(CatchSwitch: LLVMValueRef) -> ::libc::c_uint;
1676
1677    /// Obtain the basic blocks acting as handlers for a catchswitch instruction.
1678    ///
1679    /// The Handlers parameter should point to a pre-allocated array of LLVMBasicBlockRefs at least LLVMGetNumHandlers() large. On return, the first LLVMGetNumHandlers() entries in the array will be populated with LLVMBasicBlockRef instances.
1680    pub fn LLVMGetHandlers(CatchSwitch: LLVMValueRef, Handlers: *mut LLVMBasicBlockRef);
1681
1682    // Funclets
1683    /// Get the number of funcletpad arguments.
1684    pub fn LLVMGetArgOperand(Funclet: LLVMValueRef, i: ::libc::c_uint) -> LLVMValueRef;
1685
1686    /// Set a funcletpad argument at the given index.
1687    pub fn LLVMSetArgOperand(Funclet: LLVMValueRef, i: ::libc::c_uint, value: LLVMValueRef);
1688
1689    /// Get the parent catchswitch instruction of a catchpad instruction.
1690    ///
1691    /// This only works on llvm::CatchPadInst instructions.
1692    pub fn LLVMGetParentCatchSwitch(CatchPad: LLVMValueRef) -> LLVMValueRef;
1693
1694    /// Set the parent catchswitch instruction of a catchpad instruction.
1695    /// This only works on llvm::CatchPadInst instructions.
1696    pub fn LLVMSetParentCatchSwitch(CatchPad: LLVMValueRef, CatchSwitch: LLVMValueRef);
1697
1698    // Arithmetic
1699    pub fn LLVMBuildAdd(
1700        arg1: LLVMBuilderRef,
1701        LHS: LLVMValueRef,
1702        RHS: LLVMValueRef,
1703        Name: *const ::libc::c_char,
1704    ) -> LLVMValueRef;
1705    pub fn LLVMBuildNSWAdd(
1706        arg1: LLVMBuilderRef,
1707        LHS: LLVMValueRef,
1708        RHS: LLVMValueRef,
1709        Name: *const ::libc::c_char,
1710    ) -> LLVMValueRef;
1711    pub fn LLVMBuildNUWAdd(
1712        arg1: LLVMBuilderRef,
1713        LHS: LLVMValueRef,
1714        RHS: LLVMValueRef,
1715        Name: *const ::libc::c_char,
1716    ) -> LLVMValueRef;
1717    pub fn LLVMBuildFAdd(
1718        arg1: LLVMBuilderRef,
1719        LHS: LLVMValueRef,
1720        RHS: LLVMValueRef,
1721        Name: *const ::libc::c_char,
1722    ) -> LLVMValueRef;
1723    pub fn LLVMBuildSub(
1724        arg1: LLVMBuilderRef,
1725        LHS: LLVMValueRef,
1726        RHS: LLVMValueRef,
1727        Name: *const ::libc::c_char,
1728    ) -> LLVMValueRef;
1729    pub fn LLVMBuildNSWSub(
1730        arg1: LLVMBuilderRef,
1731        LHS: LLVMValueRef,
1732        RHS: LLVMValueRef,
1733        Name: *const ::libc::c_char,
1734    ) -> LLVMValueRef;
1735    pub fn LLVMBuildNUWSub(
1736        arg1: LLVMBuilderRef,
1737        LHS: LLVMValueRef,
1738        RHS: LLVMValueRef,
1739        Name: *const ::libc::c_char,
1740    ) -> LLVMValueRef;
1741    pub fn LLVMBuildFSub(
1742        arg1: LLVMBuilderRef,
1743        LHS: LLVMValueRef,
1744        RHS: LLVMValueRef,
1745        Name: *const ::libc::c_char,
1746    ) -> LLVMValueRef;
1747    pub fn LLVMBuildMul(
1748        arg1: LLVMBuilderRef,
1749        LHS: LLVMValueRef,
1750        RHS: LLVMValueRef,
1751        Name: *const ::libc::c_char,
1752    ) -> LLVMValueRef;
1753    pub fn LLVMBuildNSWMul(
1754        arg1: LLVMBuilderRef,
1755        LHS: LLVMValueRef,
1756        RHS: LLVMValueRef,
1757        Name: *const ::libc::c_char,
1758    ) -> LLVMValueRef;
1759    pub fn LLVMBuildNUWMul(
1760        arg1: LLVMBuilderRef,
1761        LHS: LLVMValueRef,
1762        RHS: LLVMValueRef,
1763        Name: *const ::libc::c_char,
1764    ) -> LLVMValueRef;
1765    pub fn LLVMBuildFMul(
1766        arg1: LLVMBuilderRef,
1767        LHS: LLVMValueRef,
1768        RHS: LLVMValueRef,
1769        Name: *const ::libc::c_char,
1770    ) -> LLVMValueRef;
1771    pub fn LLVMBuildUDiv(
1772        arg1: LLVMBuilderRef,
1773        LHS: LLVMValueRef,
1774        RHS: LLVMValueRef,
1775        Name: *const ::libc::c_char,
1776    ) -> LLVMValueRef;
1777    pub fn LLVMBuildExactUDiv(
1778        arg1: LLVMBuilderRef,
1779        LHS: LLVMValueRef,
1780        RHS: LLVMValueRef,
1781        Name: *const ::libc::c_char,
1782    ) -> LLVMValueRef;
1783    pub fn LLVMBuildSDiv(
1784        arg1: LLVMBuilderRef,
1785        LHS: LLVMValueRef,
1786        RHS: LLVMValueRef,
1787        Name: *const ::libc::c_char,
1788    ) -> LLVMValueRef;
1789    pub fn LLVMBuildExactSDiv(
1790        arg1: LLVMBuilderRef,
1791        LHS: LLVMValueRef,
1792        RHS: LLVMValueRef,
1793        Name: *const ::libc::c_char,
1794    ) -> LLVMValueRef;
1795    pub fn LLVMBuildFDiv(
1796        arg1: LLVMBuilderRef,
1797        LHS: LLVMValueRef,
1798        RHS: LLVMValueRef,
1799        Name: *const ::libc::c_char,
1800    ) -> LLVMValueRef;
1801    pub fn LLVMBuildURem(
1802        arg1: LLVMBuilderRef,
1803        LHS: LLVMValueRef,
1804        RHS: LLVMValueRef,
1805        Name: *const ::libc::c_char,
1806    ) -> LLVMValueRef;
1807    pub fn LLVMBuildSRem(
1808        arg1: LLVMBuilderRef,
1809        LHS: LLVMValueRef,
1810        RHS: LLVMValueRef,
1811        Name: *const ::libc::c_char,
1812    ) -> LLVMValueRef;
1813    pub fn LLVMBuildFRem(
1814        arg1: LLVMBuilderRef,
1815        LHS: LLVMValueRef,
1816        RHS: LLVMValueRef,
1817        Name: *const ::libc::c_char,
1818    ) -> LLVMValueRef;
1819    pub fn LLVMBuildShl(
1820        arg1: LLVMBuilderRef,
1821        LHS: LLVMValueRef,
1822        RHS: LLVMValueRef,
1823        Name: *const ::libc::c_char,
1824    ) -> LLVMValueRef;
1825    pub fn LLVMBuildLShr(
1826        arg1: LLVMBuilderRef,
1827        LHS: LLVMValueRef,
1828        RHS: LLVMValueRef,
1829        Name: *const ::libc::c_char,
1830    ) -> LLVMValueRef;
1831    pub fn LLVMBuildAShr(
1832        arg1: LLVMBuilderRef,
1833        LHS: LLVMValueRef,
1834        RHS: LLVMValueRef,
1835        Name: *const ::libc::c_char,
1836    ) -> LLVMValueRef;
1837    pub fn LLVMBuildAnd(
1838        arg1: LLVMBuilderRef,
1839        LHS: LLVMValueRef,
1840        RHS: LLVMValueRef,
1841        Name: *const ::libc::c_char,
1842    ) -> LLVMValueRef;
1843    pub fn LLVMBuildOr(
1844        arg1: LLVMBuilderRef,
1845        LHS: LLVMValueRef,
1846        RHS: LLVMValueRef,
1847        Name: *const ::libc::c_char,
1848    ) -> LLVMValueRef;
1849    pub fn LLVMBuildXor(
1850        arg1: LLVMBuilderRef,
1851        LHS: LLVMValueRef,
1852        RHS: LLVMValueRef,
1853        Name: *const ::libc::c_char,
1854    ) -> LLVMValueRef;
1855    pub fn LLVMBuildBinOp(
1856        B: LLVMBuilderRef,
1857        Op: LLVMOpcode,
1858        LHS: LLVMValueRef,
1859        RHS: LLVMValueRef,
1860        Name: *const ::libc::c_char,
1861    ) -> LLVMValueRef;
1862    pub fn LLVMBuildNeg(
1863        arg1: LLVMBuilderRef,
1864        V: LLVMValueRef,
1865        Name: *const ::libc::c_char,
1866    ) -> LLVMValueRef;
1867    pub fn LLVMBuildNSWNeg(
1868        B: LLVMBuilderRef,
1869        V: LLVMValueRef,
1870        Name: *const ::libc::c_char,
1871    ) -> LLVMValueRef;
1872    #[deprecated(since = "191.0.0", note = "Use LLVMBuildNeg + LLVMSetNUW instead.")]
1873    pub fn LLVMBuildNUWNeg(
1874        B: LLVMBuilderRef,
1875        V: LLVMValueRef,
1876        Name: *const ::libc::c_char,
1877    ) -> LLVMValueRef;
1878    pub fn LLVMBuildFNeg(
1879        arg1: LLVMBuilderRef,
1880        V: LLVMValueRef,
1881        Name: *const ::libc::c_char,
1882    ) -> LLVMValueRef;
1883    pub fn LLVMBuildNot(
1884        arg1: LLVMBuilderRef,
1885        V: LLVMValueRef,
1886        Name: *const ::libc::c_char,
1887    ) -> LLVMValueRef;
1888
1889    pub fn LLVMGetNUW(ArithInst: LLVMValueRef) -> LLVMBool;
1890    pub fn LLVMSetNUW(ArithInst: LLVMValueRef, HasNUW: LLVMBool);
1891    pub fn LLVMGetNSW(ArithInst: LLVMValueRef) -> LLVMBool;
1892    pub fn LLVMSetNSW(ArithInst: LLVMValueRef, HasNSW: LLVMBool);
1893    pub fn LLVMGetExact(DivOrShrInst: LLVMValueRef) -> LLVMBool;
1894    pub fn LLVMSetExact(DivOrShrInst: LLVMValueRef, IsExact: LLVMBool);
1895
1896    /// Gets if the instruction has the non-negative flag set.
1897    ///
1898    /// Only valid for zext instructions.
1899    pub fn LLVMGetNNeg(NonNegInst: LLVMValueRef) -> LLVMBool;
1900
1901    /// Sets the non-negative flag for the instruction.
1902    ///
1903    /// Only valid for zext instructions.
1904    pub fn LLVMSetNNeg(NonNegInst: LLVMValueRef, IsNonNeg: LLVMBool);
1905
1906    /// Get the flags for which fast-math-style optimizations are allowed for this value.
1907    ///
1908    /// Only valid on floating point instructions.
1909    pub fn LLVMGetFastMathFlags(FPMathInst: LLVMValueRef) -> LLVMFastMathFlags;
1910
1911    /// Sets the flags for which fast-math-style optimizations are allowed for this value.
1912    ///
1913    /// Only valid on floating point instructions.
1914    pub fn LLVMSetFastMathFlags(FPMathInst: LLVMValueRef, FMF: LLVMFastMathFlags);
1915
1916    /// Check if a given value can potentially have fast math flags.
1917    ///
1918    /// Will return true for floating point arithmetic instructions, and for select,
1919    /// phi, and call instructions whose type is a floating point type, or a vector
1920    /// or array thereof. See <https://llvm.org/docs/LangRef.html#fast-math-flags>
1921    pub fn LLVMCanValueUseFastMathFlags(Inst: LLVMValueRef) -> LLVMBool;
1922
1923    /// Gets whether the instruction has the disjoint flag set.
1924    ///
1925    /// Only valid for or instructions.
1926    pub fn LLVMGetIsDisjoint(Inst: LLVMValueRef) -> LLVMBool;
1927
1928    /// Sets the disjoint flag for the instruction.
1929    ///
1930    /// Only valid for or instructions.
1931    pub fn LLVMSetIsDisjoint(Inst: LLVMValueRef, IsDisjoint: LLVMBool);
1932
1933    // Memory
1934    pub fn LLVMBuildMalloc(
1935        arg1: LLVMBuilderRef,
1936        Ty: LLVMTypeRef,
1937        Name: *const ::libc::c_char,
1938    ) -> LLVMValueRef;
1939    pub fn LLVMBuildArrayMalloc(
1940        arg1: LLVMBuilderRef,
1941        Ty: LLVMTypeRef,
1942        Val: LLVMValueRef,
1943        Name: *const ::libc::c_char,
1944    ) -> LLVMValueRef;
1945    pub fn LLVMBuildMemSet(
1946        B: LLVMBuilderRef,
1947        Ptr: LLVMValueRef,
1948        Val: LLVMValueRef,
1949        Len: LLVMValueRef,
1950        Align: ::libc::c_uint,
1951    ) -> LLVMValueRef;
1952    pub fn LLVMBuildMemCpy(
1953        B: LLVMBuilderRef,
1954        Dst: LLVMValueRef,
1955        DstAlign: ::libc::c_uint,
1956        Src: LLVMValueRef,
1957        SrcAlign: ::libc::c_uint,
1958        Size: LLVMValueRef,
1959    ) -> LLVMValueRef;
1960    pub fn LLVMBuildMemMove(
1961        B: LLVMBuilderRef,
1962        Dst: LLVMValueRef,
1963        DstAlign: ::libc::c_uint,
1964        Src: LLVMValueRef,
1965        SrcAlign: ::libc::c_uint,
1966        Size: LLVMValueRef,
1967    ) -> LLVMValueRef;
1968    pub fn LLVMBuildAlloca(
1969        arg1: LLVMBuilderRef,
1970        Ty: LLVMTypeRef,
1971        Name: *const ::libc::c_char,
1972    ) -> LLVMValueRef;
1973    pub fn LLVMBuildArrayAlloca(
1974        arg1: LLVMBuilderRef,
1975        Ty: LLVMTypeRef,
1976        Val: LLVMValueRef,
1977        Name: *const ::libc::c_char,
1978    ) -> LLVMValueRef;
1979    pub fn LLVMBuildFree(arg1: LLVMBuilderRef, PointerVal: LLVMValueRef) -> LLVMValueRef;
1980    pub fn LLVMBuildLoad2(
1981        arg1: LLVMBuilderRef,
1982        Ty: LLVMTypeRef,
1983        PointerVal: LLVMValueRef,
1984        Name: *const ::libc::c_char,
1985    ) -> LLVMValueRef;
1986    pub fn LLVMBuildStore(
1987        arg1: LLVMBuilderRef,
1988        Val: LLVMValueRef,
1989        Ptr: LLVMValueRef,
1990    ) -> LLVMValueRef;
1991    pub fn LLVMBuildGEP2(
1992        B: LLVMBuilderRef,
1993        Ty: LLVMTypeRef,
1994        Pointer: LLVMValueRef,
1995        Indices: *mut LLVMValueRef,
1996        NumIndices: ::libc::c_uint,
1997        Name: *const ::libc::c_char,
1998    ) -> LLVMValueRef;
1999    pub fn LLVMBuildInBoundsGEP2(
2000        B: LLVMBuilderRef,
2001        Ty: LLVMTypeRef,
2002        Pointer: LLVMValueRef,
2003        Indices: *mut LLVMValueRef,
2004        NumIndices: ::libc::c_uint,
2005        Name: *const ::libc::c_char,
2006    ) -> LLVMValueRef;
2007    /// Creates a GetElementPtr instruction.
2008    ///
2009    /// Similar to LLVMBuildGEP2, but allows specifying the no-wrap flags.
2010    pub fn LLVMBuildGEPWithNoWrapFlags(
2011        B: LLVMBuilderRef,
2012        Ty: LLVMTypeRef,
2013        Pointer: LLVMValueRef,
2014        Indices: *mut LLVMValueRef,
2015        NumIndices: ::libc::c_uint,
2016        Name: *const ::libc::c_char,
2017        NoWrapFlags: LLVMGEPNoWrapFlags,
2018    ) -> LLVMValueRef;
2019    pub fn LLVMBuildStructGEP2(
2020        B: LLVMBuilderRef,
2021        Ty: LLVMTypeRef,
2022        Pointer: LLVMValueRef,
2023        Idx: ::libc::c_uint,
2024        Name: *const ::libc::c_char,
2025    ) -> LLVMValueRef;
2026    pub fn LLVMBuildGlobalString(
2027        B: LLVMBuilderRef,
2028        Str: *const ::libc::c_char,
2029        Name: *const ::libc::c_char,
2030    ) -> LLVMValueRef;
2031    #[deprecated(
2032        since = "201.0.0",
2033        note = "Use LLVMBuildGlobalString instead, which has identical behavior"
2034    )]
2035    pub fn LLVMBuildGlobalStringPtr(
2036        B: LLVMBuilderRef,
2037        Str: *const ::libc::c_char,
2038        Name: *const ::libc::c_char,
2039    ) -> LLVMValueRef;
2040    pub fn LLVMGetVolatile(MemoryAccessInst: LLVMValueRef) -> LLVMBool;
2041    pub fn LLVMSetVolatile(MemoryAccessInst: LLVMValueRef, IsVolatile: LLVMBool);
2042    pub fn LLVMGetWeak(CmpXchgInst: LLVMValueRef) -> LLVMBool;
2043    pub fn LLVMSetWeak(CmpXchgInst: LLVMValueRef, IsWeak: LLVMBool);
2044    pub fn LLVMGetOrdering(MemoryAccessInst: LLVMValueRef) -> LLVMAtomicOrdering;
2045    pub fn LLVMSetOrdering(MemoryAccessInst: LLVMValueRef, Ordering: LLVMAtomicOrdering);
2046    pub fn LLVMGetAtomicRMWBinOp(AtomicRMWInst: LLVMValueRef) -> LLVMAtomicRMWBinOp;
2047    pub fn LLVMSetAtomicRMWBinOp(AtomicRMWInst: LLVMValueRef, BinOp: LLVMAtomicRMWBinOp);
2048
2049    // Casts
2050    pub fn LLVMBuildTrunc(
2051        arg1: LLVMBuilderRef,
2052        Val: LLVMValueRef,
2053        DestTy: LLVMTypeRef,
2054        Name: *const ::libc::c_char,
2055    ) -> LLVMValueRef;
2056    pub fn LLVMBuildZExt(
2057        arg1: LLVMBuilderRef,
2058        Val: LLVMValueRef,
2059        DestTy: LLVMTypeRef,
2060        Name: *const ::libc::c_char,
2061    ) -> LLVMValueRef;
2062    pub fn LLVMBuildSExt(
2063        arg1: LLVMBuilderRef,
2064        Val: LLVMValueRef,
2065        DestTy: LLVMTypeRef,
2066        Name: *const ::libc::c_char,
2067    ) -> LLVMValueRef;
2068    pub fn LLVMBuildFPToUI(
2069        arg1: LLVMBuilderRef,
2070        Val: LLVMValueRef,
2071        DestTy: LLVMTypeRef,
2072        Name: *const ::libc::c_char,
2073    ) -> LLVMValueRef;
2074    pub fn LLVMBuildFPToSI(
2075        arg1: LLVMBuilderRef,
2076        Val: LLVMValueRef,
2077        DestTy: LLVMTypeRef,
2078        Name: *const ::libc::c_char,
2079    ) -> LLVMValueRef;
2080    pub fn LLVMBuildUIToFP(
2081        arg1: LLVMBuilderRef,
2082        Val: LLVMValueRef,
2083        DestTy: LLVMTypeRef,
2084        Name: *const ::libc::c_char,
2085    ) -> LLVMValueRef;
2086    pub fn LLVMBuildSIToFP(
2087        arg1: LLVMBuilderRef,
2088        Val: LLVMValueRef,
2089        DestTy: LLVMTypeRef,
2090        Name: *const ::libc::c_char,
2091    ) -> LLVMValueRef;
2092    pub fn LLVMBuildFPTrunc(
2093        arg1: LLVMBuilderRef,
2094        Val: LLVMValueRef,
2095        DestTy: LLVMTypeRef,
2096        Name: *const ::libc::c_char,
2097    ) -> LLVMValueRef;
2098    pub fn LLVMBuildFPExt(
2099        arg1: LLVMBuilderRef,
2100        Val: LLVMValueRef,
2101        DestTy: LLVMTypeRef,
2102        Name: *const ::libc::c_char,
2103    ) -> LLVMValueRef;
2104    pub fn LLVMBuildPtrToInt(
2105        arg1: LLVMBuilderRef,
2106        Val: LLVMValueRef,
2107        DestTy: LLVMTypeRef,
2108        Name: *const ::libc::c_char,
2109    ) -> LLVMValueRef;
2110    pub fn LLVMBuildIntToPtr(
2111        arg1: LLVMBuilderRef,
2112        Val: LLVMValueRef,
2113        DestTy: LLVMTypeRef,
2114        Name: *const ::libc::c_char,
2115    ) -> LLVMValueRef;
2116    pub fn LLVMBuildBitCast(
2117        arg1: LLVMBuilderRef,
2118        Val: LLVMValueRef,
2119        DestTy: LLVMTypeRef,
2120        Name: *const ::libc::c_char,
2121    ) -> LLVMValueRef;
2122    pub fn LLVMBuildAddrSpaceCast(
2123        arg1: LLVMBuilderRef,
2124        Val: LLVMValueRef,
2125        DestTy: LLVMTypeRef,
2126        Name: *const ::libc::c_char,
2127    ) -> LLVMValueRef;
2128    pub fn LLVMBuildZExtOrBitCast(
2129        arg1: LLVMBuilderRef,
2130        Val: LLVMValueRef,
2131        DestTy: LLVMTypeRef,
2132        Name: *const ::libc::c_char,
2133    ) -> LLVMValueRef;
2134    pub fn LLVMBuildSExtOrBitCast(
2135        arg1: LLVMBuilderRef,
2136        Val: LLVMValueRef,
2137        DestTy: LLVMTypeRef,
2138        Name: *const ::libc::c_char,
2139    ) -> LLVMValueRef;
2140    pub fn LLVMBuildTruncOrBitCast(
2141        arg1: LLVMBuilderRef,
2142        Val: LLVMValueRef,
2143        DestTy: LLVMTypeRef,
2144        Name: *const ::libc::c_char,
2145    ) -> LLVMValueRef;
2146    pub fn LLVMBuildCast(
2147        B: LLVMBuilderRef,
2148        Op: LLVMOpcode,
2149        Val: LLVMValueRef,
2150        DestTy: LLVMTypeRef,
2151        Name: *const ::libc::c_char,
2152    ) -> LLVMValueRef;
2153    pub fn LLVMBuildPointerCast(
2154        arg1: LLVMBuilderRef,
2155        Val: LLVMValueRef,
2156        DestTy: LLVMTypeRef,
2157        Name: *const ::libc::c_char,
2158    ) -> LLVMValueRef;
2159    pub fn LLVMBuildIntCast(
2160        arg1: LLVMBuilderRef,
2161        Val: LLVMValueRef,
2162        DestTy: LLVMTypeRef,
2163        Name: *const ::libc::c_char,
2164    ) -> LLVMValueRef;
2165    pub fn LLVMBuildIntCast2(
2166        arg1: LLVMBuilderRef,
2167        Val: LLVMValueRef,
2168        DestTy: LLVMTypeRef,
2169        IsSigned: LLVMBool,
2170        Name: *const ::libc::c_char,
2171    ) -> LLVMValueRef;
2172    pub fn LLVMBuildFPCast(
2173        arg1: LLVMBuilderRef,
2174        Val: LLVMValueRef,
2175        DestTy: LLVMTypeRef,
2176        Name: *const ::libc::c_char,
2177    ) -> LLVMValueRef;
2178    pub fn LLVMGetCastOpcode(
2179        arg1: LLVMValueRef,
2180        SrcIsSigned: LLVMBool,
2181        DestTy: LLVMTypeRef,
2182        DestIsSigned: LLVMBool,
2183    ) -> LLVMOpcode;
2184
2185    // Comparisons
2186    pub fn LLVMBuildICmp(
2187        arg1: LLVMBuilderRef,
2188        Op: LLVMIntPredicate,
2189        LHS: LLVMValueRef,
2190        RHS: LLVMValueRef,
2191        Name: *const ::libc::c_char,
2192    ) -> LLVMValueRef;
2193    pub fn LLVMBuildFCmp(
2194        arg1: LLVMBuilderRef,
2195        Op: LLVMRealPredicate,
2196        LHS: LLVMValueRef,
2197        RHS: LLVMValueRef,
2198        Name: *const ::libc::c_char,
2199    ) -> LLVMValueRef;
2200
2201    // Miscellaneous instructions
2202    pub fn LLVMBuildPhi(
2203        arg1: LLVMBuilderRef,
2204        Ty: LLVMTypeRef,
2205        Name: *const ::libc::c_char,
2206    ) -> LLVMValueRef;
2207    pub fn LLVMBuildCall2(
2208        arg1: LLVMBuilderRef,
2209        arg2: LLVMTypeRef,
2210        Fn: LLVMValueRef,
2211        Args: *mut LLVMValueRef,
2212        NumArgs: ::libc::c_uint,
2213        Name: *const ::libc::c_char,
2214    ) -> LLVMValueRef;
2215    pub fn LLVMBuildCallWithOperandBundles(
2216        arg1: LLVMBuilderRef,
2217        arg2: LLVMTypeRef,
2218        Fn: LLVMValueRef,
2219        Args: *mut LLVMValueRef,
2220        NumArgs: ::libc::c_uint,
2221        Bundles: *mut LLVMOperandBundleRef,
2222        NumBundles: ::libc::c_uint,
2223        Name: *const ::libc::c_char,
2224    ) -> LLVMValueRef;
2225    pub fn LLVMBuildSelect(
2226        arg1: LLVMBuilderRef,
2227        If: LLVMValueRef,
2228        Then: LLVMValueRef,
2229        Else: LLVMValueRef,
2230        Name: *const ::libc::c_char,
2231    ) -> LLVMValueRef;
2232    pub fn LLVMBuildVAArg(
2233        arg1: LLVMBuilderRef,
2234        List: LLVMValueRef,
2235        Ty: LLVMTypeRef,
2236        Name: *const ::libc::c_char,
2237    ) -> LLVMValueRef;
2238    pub fn LLVMBuildExtractElement(
2239        arg1: LLVMBuilderRef,
2240        VecVal: LLVMValueRef,
2241        Index: LLVMValueRef,
2242        Name: *const ::libc::c_char,
2243    ) -> LLVMValueRef;
2244    pub fn LLVMBuildInsertElement(
2245        arg1: LLVMBuilderRef,
2246        VecVal: LLVMValueRef,
2247        EltVal: LLVMValueRef,
2248        Index: LLVMValueRef,
2249        Name: *const ::libc::c_char,
2250    ) -> LLVMValueRef;
2251    pub fn LLVMBuildShuffleVector(
2252        arg1: LLVMBuilderRef,
2253        V1: LLVMValueRef,
2254        V2: LLVMValueRef,
2255        Mask: LLVMValueRef,
2256        Name: *const ::libc::c_char,
2257    ) -> LLVMValueRef;
2258    pub fn LLVMBuildExtractValue(
2259        arg1: LLVMBuilderRef,
2260        AggVal: LLVMValueRef,
2261        Index: ::libc::c_uint,
2262        Name: *const ::libc::c_char,
2263    ) -> LLVMValueRef;
2264    pub fn LLVMBuildInsertValue(
2265        arg1: LLVMBuilderRef,
2266        AggVal: LLVMValueRef,
2267        EltVal: LLVMValueRef,
2268        Index: ::libc::c_uint,
2269        Name: *const ::libc::c_char,
2270    ) -> LLVMValueRef;
2271    pub fn LLVMBuildFreeze(
2272        arg1: LLVMBuilderRef,
2273        Val: LLVMValueRef,
2274        Name: *const ::libc::c_char,
2275    ) -> LLVMValueRef;
2276    pub fn LLVMBuildIsNull(
2277        arg1: LLVMBuilderRef,
2278        Val: LLVMValueRef,
2279        Name: *const ::libc::c_char,
2280    ) -> LLVMValueRef;
2281    pub fn LLVMBuildIsNotNull(
2282        arg1: LLVMBuilderRef,
2283        Val: LLVMValueRef,
2284        Name: *const ::libc::c_char,
2285    ) -> LLVMValueRef;
2286    pub fn LLVMBuildPtrDiff2(
2287        arg1: LLVMBuilderRef,
2288        ElemTy: LLVMTypeRef,
2289        LHS: LLVMValueRef,
2290        RHS: LLVMValueRef,
2291        Name: *const ::libc::c_char,
2292    ) -> LLVMValueRef;
2293    pub fn LLVMBuildFence(
2294        B: LLVMBuilderRef,
2295        ordering: LLVMAtomicOrdering,
2296        singleThread: LLVMBool,
2297        Name: *const ::libc::c_char,
2298    ) -> LLVMValueRef;
2299    pub fn LLVMBuildFenceSyncScope(
2300        B: LLVMBuilderRef,
2301        ordering: LLVMAtomicOrdering,
2302        SSID: ::libc::c_uint,
2303        Name: *const ::libc::c_char,
2304    ) -> LLVMValueRef;
2305    pub fn LLVMBuildAtomicRMW(
2306        B: LLVMBuilderRef,
2307        op: LLVMAtomicRMWBinOp,
2308        PTR: LLVMValueRef,
2309        Val: LLVMValueRef,
2310        ordering: LLVMAtomicOrdering,
2311        singleThread: LLVMBool,
2312    ) -> LLVMValueRef;
2313    pub fn LLVMBuildAtomicRMWSyncScope(
2314        B: LLVMBuilderRef,
2315        op: LLVMAtomicRMWBinOp,
2316        PTR: LLVMValueRef,
2317        Val: LLVMValueRef,
2318        ordering: LLVMAtomicOrdering,
2319        SSID: ::libc::c_uint,
2320    ) -> LLVMValueRef;
2321    pub fn LLVMBuildAtomicCmpXchg(
2322        B: LLVMBuilderRef,
2323        Ptr: LLVMValueRef,
2324        Cmp: LLVMValueRef,
2325        New: LLVMValueRef,
2326        SuccessOrdering: LLVMAtomicOrdering,
2327        FailureOrdering: LLVMAtomicOrdering,
2328        SingleThread: LLVMBool,
2329    ) -> LLVMValueRef;
2330    pub fn LLVMBuildAtomicCmpXchgSyncScope(
2331        B: LLVMBuilderRef,
2332        Ptr: LLVMValueRef,
2333        Cmp: LLVMValueRef,
2334        New: LLVMValueRef,
2335        SuccessOrdering: LLVMAtomicOrdering,
2336        FailureOrdering: LLVMAtomicOrdering,
2337        SSID: ::libc::c_uint,
2338    ) -> LLVMValueRef;
2339    pub fn LLVMGetNumMaskElements(ShuffleVectorInst: LLVMValueRef) -> ::libc::c_uint;
2340    pub fn LLVMGetUndefMaskElem() -> ::libc::c_int;
2341    pub fn LLVMGetMaskValue(ShuffleVectorInst: LLVMValueRef, Elt: ::libc::c_uint) -> ::libc::c_int;
2342    pub fn LLVMIsAtomicSingleThread(AtomicInst: LLVMValueRef) -> LLVMBool;
2343    pub fn LLVMSetAtomicSingleThread(AtomicInst: LLVMValueRef, SingleThread: LLVMBool);
2344    /// Returns whether an instruction is an atomic instruction, e.g., atomicrmw,
2345    /// cmpxchg, fence, or loads and stores with atomic ordering.
2346    pub fn LLVMIsAtomic(Inst: LLVMValueRef) -> LLVMBool;
2347    /// Returns the synchronization scope ID of an atomic instruction.
2348    pub fn LLVMGetAtomicSyncScopeID(AtomicInst: LLVMValueRef) -> ::libc::c_uint;
2349    /// Sets the synchronization scope ID of an atomic instruction.
2350    pub fn LLVMSetAtomicSyncScopeID(AtomicInst: LLVMValueRef, SSID: ::libc::c_uint);
2351    pub fn LLVMGetCmpXchgSuccessOrdering(CmpXchgInst: LLVMValueRef) -> LLVMAtomicOrdering;
2352    pub fn LLVMSetCmpXchgSuccessOrdering(CmpXchgInst: LLVMValueRef, Ordering: LLVMAtomicOrdering);
2353    pub fn LLVMGetCmpXchgFailureOrdering(CmpXchgInst: LLVMValueRef) -> LLVMAtomicOrdering;
2354    pub fn LLVMSetCmpXchgFailureOrdering(CmpXchgInst: LLVMValueRef, Ordering: LLVMAtomicOrdering);
2355}
2356
2357// Core->Module Providers
2358extern "C" {
2359    pub fn LLVMCreateModuleProviderForExistingModule(M: LLVMModuleRef) -> LLVMModuleProviderRef;
2360    pub fn LLVMDisposeModuleProvider(M: LLVMModuleProviderRef);
2361}
2362
2363// Core->Memory Buffers
2364extern "C" {
2365    pub fn LLVMCreateMemoryBufferWithContentsOfFile(
2366        Path: *const ::libc::c_char,
2367        OutMemBuf: *mut LLVMMemoryBufferRef,
2368        OutMessage: *mut *mut ::libc::c_char,
2369    ) -> LLVMBool;
2370    pub fn LLVMCreateMemoryBufferWithSTDIN(
2371        OutMemBuf: *mut LLVMMemoryBufferRef,
2372        OutMessage: *mut *mut ::libc::c_char,
2373    ) -> LLVMBool;
2374    pub fn LLVMCreateMemoryBufferWithMemoryRange(
2375        InputData: *const ::libc::c_char,
2376        InputDataLength: ::libc::size_t,
2377        BufferName: *const ::libc::c_char,
2378        RequiresNullTerminator: LLVMBool,
2379    ) -> LLVMMemoryBufferRef;
2380    pub fn LLVMCreateMemoryBufferWithMemoryRangeCopy(
2381        InputData: *const ::libc::c_char,
2382        InputDataLength: ::libc::size_t,
2383        BufferName: *const ::libc::c_char,
2384    ) -> LLVMMemoryBufferRef;
2385    pub fn LLVMGetBufferStart(MemBuf: LLVMMemoryBufferRef) -> *const ::libc::c_char;
2386    pub fn LLVMGetBufferSize(MemBuf: LLVMMemoryBufferRef) -> ::libc::size_t;
2387    pub fn LLVMDisposeMemoryBuffer(MemBuf: LLVMMemoryBufferRef);
2388}
2389
2390// Core->Pass managers
2391extern "C" {
2392    pub fn LLVMCreatePassManager() -> LLVMPassManagerRef;
2393    pub fn LLVMCreateFunctionPassManagerForModule(M: LLVMModuleRef) -> LLVMPassManagerRef;
2394    pub fn LLVMCreateFunctionPassManager(MP: LLVMModuleProviderRef) -> LLVMPassManagerRef;
2395    pub fn LLVMRunPassManager(PM: LLVMPassManagerRef, M: LLVMModuleRef) -> LLVMBool;
2396    pub fn LLVMInitializeFunctionPassManager(FPM: LLVMPassManagerRef) -> LLVMBool;
2397    pub fn LLVMRunFunctionPassManager(FPM: LLVMPassManagerRef, F: LLVMValueRef) -> LLVMBool;
2398    pub fn LLVMFinalizeFunctionPassManager(FPM: LLVMPassManagerRef) -> LLVMBool;
2399    pub fn LLVMDisposePassManager(PM: LLVMPassManagerRef);
2400}
2401
2402// Core->Threading
2403extern "C" {
2404    /// Deprecated: LLVM threading is configured at compile-time with `LLVM_ENABLE_THREADS`
2405    pub fn LLVMStartMultithreaded() -> LLVMBool;
2406    /// Deprecated: LLVM threading is configured at compile-time with `LLVM_ENABLE_THREADS`
2407    pub fn LLVMStopMultithreaded();
2408    pub fn LLVMIsMultithreaded() -> LLVMBool;
2409}