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    pub fn LLVMConstStructInContext(
660        C: LLVMContextRef,
661        ConstantVals: *mut LLVMValueRef,
662        Count: ::libc::c_uint,
663        Packed: LLVMBool,
664    ) -> LLVMValueRef;
665    pub fn LLVMConstStruct(
666        ConstantVals: *mut LLVMValueRef,
667        Count: ::libc::c_uint,
668        Packed: LLVMBool,
669    ) -> LLVMValueRef;
670    #[deprecated(
671        since = "170.0.0",
672        note = "LLVMConstArray is deprecated in favor of the API accurate LLVMConstArray2"
673    )]
674    pub fn LLVMConstArray(
675        ElementTy: LLVMTypeRef,
676        ConstantVals: *mut LLVMValueRef,
677        Length: ::libc::c_uint,
678    ) -> LLVMValueRef;
679    /// Create a ConstantArray from values.
680    pub fn LLVMConstArray2(
681        ElementTy: LLVMTypeRef,
682        ConstantVals: *mut LLVMValueRef,
683        Length: u64,
684    ) -> LLVMValueRef;
685    pub fn LLVMConstNamedStruct(
686        StructTy: LLVMTypeRef,
687        ConstantVals: *mut LLVMValueRef,
688        Count: ::libc::c_uint,
689    ) -> LLVMValueRef;
690    pub fn LLVMGetAggregateElement(C: LLVMValueRef, idx: ::libc::c_uint) -> LLVMValueRef;
691    #[deprecated(since = "150.0.0", note = "Use LLVMGetAggregateElement instead")]
692    pub fn LLVMGetElementAsConstant(C: LLVMValueRef, idx: ::libc::c_uint) -> LLVMValueRef;
693    pub fn LLVMConstVector(
694        ScalarConstantVals: *mut LLVMValueRef,
695        Size: ::libc::c_uint,
696    ) -> LLVMValueRef;
697    /// Create a ConstantPtrAuth constant with the given values.
698    pub fn LLVMConstantPtrAuth(
699        Ptr: LLVMValueRef,
700        Key: LLVMValueRef,
701        Disc: LLVMValueRef,
702        AddrDisc: LLVMValueRef,
703    ) -> LLVMValueRef;
704
705    // Core->Values->Constants->Constant expressions
706    pub fn LLVMGetConstOpcode(ConstantVal: LLVMValueRef) -> LLVMOpcode;
707    pub fn LLVMAlignOf(Ty: LLVMTypeRef) -> LLVMValueRef;
708    pub fn LLVMSizeOf(Ty: LLVMTypeRef) -> LLVMValueRef;
709    pub fn LLVMConstNeg(ConstantVal: LLVMValueRef) -> LLVMValueRef;
710    pub fn LLVMConstNSWNeg(ConstantVal: LLVMValueRef) -> LLVMValueRef;
711    #[deprecated(since = "191.0.0", note = "Use LLVMConstNull instead.")]
712    pub fn LLVMConstNUWNeg(ConstantVal: LLVMValueRef) -> LLVMValueRef;
713    pub fn LLVMConstNot(ConstantVal: LLVMValueRef) -> LLVMValueRef;
714    pub fn LLVMConstAdd(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) -> LLVMValueRef;
715    pub fn LLVMConstNSWAdd(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) -> LLVMValueRef;
716    pub fn LLVMConstNUWAdd(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) -> LLVMValueRef;
717    pub fn LLVMConstSub(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) -> LLVMValueRef;
718    pub fn LLVMConstNSWSub(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) -> LLVMValueRef;
719    pub fn LLVMConstNUWSub(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) -> LLVMValueRef;
720    pub fn LLVMConstMul(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) -> LLVMValueRef;
721    pub fn LLVMConstNSWMul(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) -> LLVMValueRef;
722    pub fn LLVMConstNUWMul(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) -> LLVMValueRef;
723    pub fn LLVMConstXor(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) -> LLVMValueRef;
724    pub fn LLVMConstGEP2(
725        Ty: LLVMTypeRef,
726        ConstantVal: LLVMValueRef,
727        ConstantIndices: *mut LLVMValueRef,
728        NumIndices: ::libc::c_uint,
729    ) -> LLVMValueRef;
730    pub fn LLVMConstInBoundsGEP2(
731        Ty: LLVMTypeRef,
732        ConstantVal: LLVMValueRef,
733        ConstantIndices: *mut LLVMValueRef,
734        NumIndices: ::libc::c_uint,
735    ) -> LLVMValueRef;
736    /// Creates a constant GetElementPtr expression.
737    ///
738    /// Similar to LLVMConstGEP2, but allows specifying the no-wrap flags.
739    pub fn LLVMConstGEPWithNoWrapFlags(
740        Ty: LLVMTypeRef,
741        ConstantVal: LLVMValueRef,
742        ConstantIndices: *mut LLVMValueRef,
743        NumIndices: ::libc::c_uint,
744        NoWrapFlags: LLVMGEPNoWrapFlags,
745    ) -> LLVMValueRef;
746    pub fn LLVMConstTrunc(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef) -> LLVMValueRef;
747    pub fn LLVMConstPtrToInt(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef) -> LLVMValueRef;
748    pub fn LLVMConstIntToPtr(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef) -> LLVMValueRef;
749    pub fn LLVMConstBitCast(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef) -> LLVMValueRef;
750    pub fn LLVMConstAddrSpaceCast(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef) -> LLVMValueRef;
751    pub fn LLVMConstTruncOrBitCast(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef) -> LLVMValueRef;
752    pub fn LLVMConstPointerCast(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef) -> LLVMValueRef;
753    pub fn LLVMConstExtractElement(
754        VectorConstant: LLVMValueRef,
755        IndexConstant: LLVMValueRef,
756    ) -> LLVMValueRef;
757    pub fn LLVMConstInsertElement(
758        VectorConstant: LLVMValueRef,
759        ElementValueConstant: LLVMValueRef,
760        IndexConstant: LLVMValueRef,
761    ) -> LLVMValueRef;
762    pub fn LLVMConstShuffleVector(
763        VectorAConstant: LLVMValueRef,
764        VectorBConstant: LLVMValueRef,
765        MaskConstant: LLVMValueRef,
766    ) -> LLVMValueRef;
767    #[deprecated(since = "70.0.0", note = "Use LLVMGetInlineAsm instead")]
768    pub fn LLVMConstInlineAsm(
769        Ty: LLVMTypeRef,
770        AsmString: *const ::libc::c_char,
771        Constraints: *const ::libc::c_char,
772        HasSideEffects: LLVMBool,
773        IsAlignStack: LLVMBool,
774    ) -> LLVMValueRef;
775    pub fn LLVMBlockAddress(F: LLVMValueRef, BB: LLVMBasicBlockRef) -> LLVMValueRef;
776    /// Gets the function associated with a given BlockAddress constant value.
777    pub fn LLVMGetBlockAddressFunction(BlockAddr: LLVMValueRef) -> LLVMValueRef;
778    /// Gets the basic block associated with a given BlockAddress constant value.
779    pub fn LLVMGetBlockAddressBasicBlock(BlockAddr: LLVMValueRef) -> LLVMBasicBlockRef;
780
781    // Core->Values->Constants->Global Values
782    pub fn LLVMGetGlobalParent(Global: LLVMValueRef) -> LLVMModuleRef;
783    pub fn LLVMIsDeclaration(Global: LLVMValueRef) -> LLVMBool;
784    pub fn LLVMGetLinkage(Global: LLVMValueRef) -> LLVMLinkage;
785    pub fn LLVMSetLinkage(Global: LLVMValueRef, Linkage: LLVMLinkage);
786    pub fn LLVMGetSection(Global: LLVMValueRef) -> *const ::libc::c_char;
787    pub fn LLVMSetSection(Global: LLVMValueRef, Section: *const ::libc::c_char);
788    pub fn LLVMGetVisibility(Global: LLVMValueRef) -> LLVMVisibility;
789    pub fn LLVMSetVisibility(Global: LLVMValueRef, Viz: LLVMVisibility);
790    pub fn LLVMGetDLLStorageClass(Global: LLVMValueRef) -> LLVMDLLStorageClass;
791    pub fn LLVMSetDLLStorageClass(Global: LLVMValueRef, Class: LLVMDLLStorageClass);
792
793    pub fn LLVMGetUnnamedAddress(Global: LLVMValueRef) -> LLVMUnnamedAddr;
794    pub fn LLVMSetUnnamedAddress(Global: LLVMValueRef, UnnamedAddr: LLVMUnnamedAddr);
795    pub fn LLVMGlobalGetValueType(Global: LLVMValueRef) -> LLVMTypeRef;
796    #[deprecated(since = "70.0.0", note = "Use LLVMGetUnnamedAddress instead")]
797    pub fn LLVMHasUnnamedAddr(Global: LLVMValueRef) -> LLVMBool;
798    #[deprecated(since = "70.0.0", note = "Use LLVMSetUnnamedAddress instead")]
799    pub fn LLVMSetUnnamedAddr(Global: LLVMValueRef, HasUnnamedAddr: LLVMBool);
800
801    pub fn LLVMGetAlignment(V: LLVMValueRef) -> ::libc::c_uint;
802    pub fn LLVMSetAlignment(V: LLVMValueRef, Bytes: ::libc::c_uint);
803
804    pub fn LLVMGlobalSetMetadata(Global: LLVMValueRef, Kind: ::libc::c_uint, MD: LLVMMetadataRef);
805    pub fn LLVMGlobalEraseMetadata(Global: LLVMValueRef, Kind: ::libc::c_uint);
806    pub fn LLVMGlobalClearMetadata(Global: LLVMValueRef);
807    pub fn LLVMGlobalCopyAllMetadata(
808        Value: LLVMValueRef,
809        NumEntries: *mut ::libc::size_t,
810    ) -> *mut LLVMValueMetadataEntry;
811    pub fn LLVMDisposeValueMetadataEntries(Entries: *mut LLVMValueMetadataEntry);
812    pub fn LLVMValueMetadataEntriesGetKind(
813        Entries: *mut LLVMValueMetadataEntry,
814        Index: ::libc::c_uint,
815    ) -> ::libc::c_uint;
816    pub fn LLVMValueMetadataEntriesGetMetadata(
817        Entries: *mut LLVMValueMetadataEntry,
818        Index: ::libc::c_uint,
819    ) -> LLVMMetadataRef;
820
821    // Core->Values->Constants->Global Variables
822    pub fn LLVMAddGlobal(
823        M: LLVMModuleRef,
824        Ty: LLVMTypeRef,
825        Name: *const ::libc::c_char,
826    ) -> LLVMValueRef;
827    pub fn LLVMAddGlobalInAddressSpace(
828        M: LLVMModuleRef,
829        Ty: LLVMTypeRef,
830        Name: *const ::libc::c_char,
831        AddressSpace: ::libc::c_uint,
832    ) -> LLVMValueRef;
833    pub fn LLVMGetNamedGlobal(M: LLVMModuleRef, Name: *const ::libc::c_char) -> LLVMValueRef;
834    pub fn LLVMGetNamedGlobalWithLength(
835        M: LLVMModuleRef,
836        Name: *const ::libc::c_char,
837        Length: ::libc::size_t,
838    ) -> LLVMValueRef;
839    pub fn LLVMGetFirstGlobal(M: LLVMModuleRef) -> LLVMValueRef;
840    pub fn LLVMGetLastGlobal(M: LLVMModuleRef) -> LLVMValueRef;
841    pub fn LLVMGetNextGlobal(GlobalVar: LLVMValueRef) -> LLVMValueRef;
842    pub fn LLVMGetPreviousGlobal(GlobalVar: LLVMValueRef) -> LLVMValueRef;
843    pub fn LLVMDeleteGlobal(GlobalVar: LLVMValueRef);
844    pub fn LLVMGetInitializer(GlobalVar: LLVMValueRef) -> LLVMValueRef;
845    pub fn LLVMSetInitializer(GlobalVar: LLVMValueRef, ConstantVal: LLVMValueRef);
846    pub fn LLVMIsThreadLocal(GlobalVar: LLVMValueRef) -> LLVMBool;
847    pub fn LLVMSetThreadLocal(GlobalVar: LLVMValueRef, IsThreadLocal: LLVMBool);
848    pub fn LLVMIsGlobalConstant(GlobalVar: LLVMValueRef) -> LLVMBool;
849    pub fn LLVMSetGlobalConstant(GlobalVar: LLVMValueRef, IsConstant: LLVMBool);
850    pub fn LLVMGetThreadLocalMode(GlobalVar: LLVMValueRef) -> LLVMThreadLocalMode;
851    pub fn LLVMSetThreadLocalMode(GlobalVar: LLVMValueRef, Mode: LLVMThreadLocalMode);
852    pub fn LLVMIsExternallyInitialized(GlobalVar: LLVMValueRef) -> LLVMBool;
853    pub fn LLVMSetExternallyInitialized(GlobalVar: LLVMValueRef, IsExtInit: LLVMBool);
854
855    // Core->Values->Constants->Global Aliases
856    /// Obtain a GlobalAlias value from a Module by its name.
857    ///
858    /// The returned value corresponds to a llvm::GlobalAlias value.
859    pub fn LLVMGetNamedGlobalAlias(
860        M: LLVMModuleRef,
861        Name: *const ::libc::c_char,
862        NameLen: ::libc::size_t,
863    ) -> LLVMValueRef;
864    /// Obtain an iterator to the first GlobalAlias in a Module.
865    pub fn LLVMGetFirstGlobalAlias(M: LLVMModuleRef) -> LLVMValueRef;
866    /// Obtain an iterator to the last GlobalAlias in a Module.
867    pub fn LLVMGetLastGlobalAlias(M: LLVMModuleRef) -> LLVMValueRef;
868    /// Advance a GlobalAlias iterator to the next GlobalAlias.
869    ///
870    /// Returns NULL if the iterator was already at the end and there are no more global aliases.
871    pub fn LLVMGetNextGlobalAlias(GA: LLVMValueRef) -> LLVMValueRef;
872    /// Decrement a GlobalAlias iterator to the previous GlobalAlias.
873    ///
874    /// Returns NULL if the iterator was already at the beginning and there are no previous global aliases.
875    pub fn LLVMGetPreviousGlobalAlias(GA: LLVMValueRef) -> LLVMValueRef;
876    /// Retrieve the target value of an alias.
877    pub fn LLVMAliasGetAliasee(Alias: LLVMValueRef) -> LLVMValueRef;
878    /// Set the target value of an alias.
879    pub fn LLVMAliasSetAliasee(Alias: LLVMValueRef, Aliasee: LLVMValueRef);
880
881    pub fn LLVMAddAlias2(
882        M: LLVMModuleRef,
883        ValueTy: LLVMTypeRef,
884        AddrSpace: ::libc::c_uint,
885        Aliasee: LLVMValueRef,
886        Name: *const ::libc::c_char,
887    ) -> LLVMValueRef;
888
889    // ..->Function Values
890    pub fn LLVMDeleteFunction(Fn: LLVMValueRef);
891    /// Check whether the given function has a personality function.
892    pub fn LLVMHasPersonalityFn(Fn: LLVMValueRef) -> LLVMBool;
893    /// Obtain the personality function attached to the function.
894    ///
895    /// Added in LLVM 3.7.
896    pub fn LLVMGetPersonalityFn(Fn: LLVMValueRef) -> LLVMValueRef;
897    /// Set the personality function attached to the function.
898    ///
899    /// Added in LLVM 3.7.
900    pub fn LLVMSetPersonalityFn(Fn: LLVMValueRef, PersonalityFn: LLVMValueRef);
901    /// Obtain the intrinsic ID number which matches the given function name.
902    pub fn LLVMLookupIntrinsicID(
903        Name: *const ::libc::c_char,
904        NameLen: ::libc::size_t,
905    ) -> ::libc::c_uint;
906    /// Obtain the ID number from a function instance.
907    pub fn LLVMGetIntrinsicID(Fn: LLVMValueRef) -> ::libc::c_uint;
908    pub fn LLVMGetIntrinsicDeclaration(
909        Mod: LLVMModuleRef,
910        ID: ::libc::c_uint,
911        ParamTypes: *mut LLVMTypeRef,
912        ParamCount: ::libc::size_t,
913    ) -> LLVMValueRef;
914    pub fn LLVMIntrinsicGetType(
915        Ctx: LLVMContextRef,
916        ID: ::libc::c_uint,
917        ParamTypes: *mut LLVMTypeRef,
918        ParamCount: ::libc::size_t,
919    ) -> LLVMTypeRef;
920    pub fn LLVMIntrinsicGetName(
921        ID: ::libc::c_uint,
922        NameLength: *mut ::libc::size_t,
923    ) -> *const ::libc::c_char;
924    #[deprecated = "Use LLVMIntrinsicCopyOverloadedName2 instead."]
925    pub fn LLVMIntrinsicCopyOverloadedName(
926        ID: ::libc::c_uint,
927        ParamTypes: *mut LLVMTypeRef,
928        ParamCount: ::libc::size_t,
929        NameLength: *mut ::libc::size_t,
930    ) -> *const ::libc::c_char;
931    pub fn LLVMIntrinsicCopyOverloadedName2(
932        Mod: LLVMModuleRef,
933        ID: ::libc::c_uint,
934        ParamTypes: *mut LLVMTypeRef,
935        ParamCount: ::libc::size_t,
936        NameLength: *mut ::libc::size_t,
937    ) -> *mut ::libc::c_char;
938    pub fn LLVMIntrinsicIsOverloaded(ID: ::libc::c_uint) -> LLVMBool;
939    pub fn LLVMGetFunctionCallConv(Fn: LLVMValueRef) -> ::libc::c_uint;
940    pub fn LLVMSetFunctionCallConv(Fn: LLVMValueRef, CC: ::libc::c_uint);
941    pub fn LLVMGetGC(Fn: LLVMValueRef) -> *const ::libc::c_char;
942    pub fn LLVMSetGC(Fn: LLVMValueRef, Name: *const ::libc::c_char);
943
944    /// Gets the prefix data associated with a function.
945    ///
946    /// Only valid on functions, and only if LLVMHasPrefixData returns true.
947    pub fn LLVMGetPrefixData(Fn: LLVMValueRef) -> LLVMValueRef;
948
949    /// Check if a given function has prefix data. Only valid on functions.
950    pub fn LLVMHasPrefixData(Fn: LLVMValueRef) -> LLVMBool;
951
952    /// Sets the prefix data for the function. Only valid on functions.
953    pub fn LLVMSetPrefixData(Fn: LLVMValueRef, prefixData: LLVMValueRef);
954
955    /// Gets the prologue data associated with a function.
956    ///
957    /// Only valid on functions, and only if LLVMHasPrologueData returns true.
958    pub fn LLVMGetPrologueData(Fn: LLVMValueRef) -> LLVMValueRef;
959
960    /// Check if a given function has prologue data. Only valid on functions.
961    pub fn LLVMHasPrologueData(Fn: LLVMValueRef) -> LLVMBool;
962
963    /// Sets the prologue data for the function. Only valid on functions.
964    pub fn LLVMSetPrologueData(Fn: LLVMValueRef, prologueData: LLVMValueRef);
965
966    pub fn LLVMAddAttributeAtIndex(F: LLVMValueRef, Idx: LLVMAttributeIndex, A: LLVMAttributeRef);
967    pub fn LLVMGetAttributeCountAtIndex(F: LLVMValueRef, Idx: LLVMAttributeIndex)
968        -> ::libc::c_uint;
969    pub fn LLVMGetAttributesAtIndex(
970        F: LLVMValueRef,
971        Idx: LLVMAttributeIndex,
972        Attrs: *mut LLVMAttributeRef,
973    );
974    pub fn LLVMGetEnumAttributeAtIndex(
975        F: LLVMValueRef,
976        Idx: LLVMAttributeIndex,
977        KindID: ::libc::c_uint,
978    ) -> LLVMAttributeRef;
979    pub fn LLVMGetStringAttributeAtIndex(
980        F: LLVMValueRef,
981        Idx: LLVMAttributeIndex,
982        K: *const ::libc::c_char,
983        KLen: ::libc::c_uint,
984    ) -> LLVMAttributeRef;
985    pub fn LLVMRemoveEnumAttributeAtIndex(
986        F: LLVMValueRef,
987        Idx: LLVMAttributeIndex,
988        KindID: ::libc::c_uint,
989    );
990    pub fn LLVMRemoveStringAttributeAtIndex(
991        F: LLVMValueRef,
992        Idx: LLVMAttributeIndex,
993        K: *const ::libc::c_char,
994        KLen: ::libc::c_uint,
995    );
996    pub fn LLVMAddTargetDependentFunctionAttr(
997        Fn: LLVMValueRef,
998        A: *const ::libc::c_char,
999        V: *const ::libc::c_char,
1000    );
1001
1002    // ..->Function Values->Function Parameters
1003    pub fn LLVMCountParams(Fn: LLVMValueRef) -> ::libc::c_uint;
1004    pub fn LLVMGetParams(Fn: LLVMValueRef, Params: *mut LLVMValueRef);
1005    pub fn LLVMGetParam(Fn: LLVMValueRef, Index: ::libc::c_uint) -> LLVMValueRef;
1006    pub fn LLVMGetParamParent(Inst: LLVMValueRef) -> LLVMValueRef;
1007    pub fn LLVMGetFirstParam(Fn: LLVMValueRef) -> LLVMValueRef;
1008    pub fn LLVMGetLastParam(Fn: LLVMValueRef) -> LLVMValueRef;
1009    pub fn LLVMGetNextParam(Arg: LLVMValueRef) -> LLVMValueRef;
1010    pub fn LLVMGetPreviousParam(Arg: LLVMValueRef) -> LLVMValueRef;
1011    pub fn LLVMSetParamAlignment(Arg: LLVMValueRef, Align: ::libc::c_uint);
1012}
1013
1014// Core->Metadata
1015extern "C" {
1016    #[deprecated(since = "90.0.0", note = "Use LLVMMDStringInContext2 instead.")]
1017    pub fn LLVMMDStringInContext(
1018        C: LLVMContextRef,
1019        Str: *const ::libc::c_char,
1020        SLen: ::libc::c_uint,
1021    ) -> LLVMValueRef;
1022    #[deprecated(since = "90.0.0", note = "Use LLVMMDStringInContext2 instead.")]
1023    pub fn LLVMMDString(Str: *const ::libc::c_char, SLen: ::libc::c_uint) -> LLVMValueRef;
1024    #[deprecated(since = "90.0.0", note = "Use LLVMMDNodeInContext2 instead.")]
1025    pub fn LLVMMDNodeInContext(
1026        C: LLVMContextRef,
1027        Vals: *mut LLVMValueRef,
1028        Count: ::libc::c_uint,
1029    ) -> LLVMValueRef;
1030    #[deprecated(since = "90.0.0", note = "Use LLVMMDNodeInContext2 instead.")]
1031    pub fn LLVMMDNode(Vals: *mut LLVMValueRef, Count: ::libc::c_uint) -> LLVMValueRef;
1032
1033    /// Create a new operand bundle.
1034    ///
1035    /// Every invocation should be paired with LLVMDisposeOperandBundle() or memory
1036    /// will be leaked.
1037    pub fn LLVMCreateOperandBundle(
1038        Tag: *const ::libc::c_char,
1039        TagLen: ::libc::size_t,
1040        Args: *mut LLVMValueRef,
1041        NumArgs: ::libc::c_uint,
1042    ) -> LLVMOperandBundleRef;
1043
1044    /// Destroy an operand bundle.
1045    ///
1046    /// This must be called for every created operand bundle or memory will be
1047    /// leaked.
1048    pub fn LLVMDisposeOperandBundle(Bundle: LLVMOperandBundleRef);
1049
1050    /// Obtain the tag of an operand bundle as a string.
1051    ///
1052    /// @param Bundle Operand bundle to obtain tag of.
1053    /// @param Len Out parameter which holds the length of the returned string.
1054    /// @return The tag name of Bundle.
1055    /// @see OperandBundleDef::getTag()
1056    pub fn LLVMGetOperandBundleTag(
1057        Bundle: LLVMOperandBundleRef,
1058        Len: *mut ::libc::size_t,
1059    ) -> *const ::libc::c_char;
1060
1061    /// Obtain the number of operands for an operand bundle.
1062    pub fn LLVMGetNumOperandBundleArgs(Bundle: LLVMOperandBundleRef) -> ::libc::c_uint;
1063
1064    /// Obtain the operand for an operand bundle at the given index.
1065    pub fn LLVMGetOperandBundleArgAtIndex(
1066        Bundle: LLVMOperandBundleRef,
1067        Index: ::libc::c_uint,
1068    ) -> LLVMValueRef;
1069
1070    /// Add a global indirect function to a module under a specified name.
1071    pub fn LLVMAddGlobalIFunc(
1072        M: LLVMModuleRef,
1073        Name: *const ::libc::c_char,
1074        NameLen: ::libc::size_t,
1075        Ty: LLVMTypeRef,
1076        AddrSpace: ::libc::c_uint,
1077        Resolver: LLVMValueRef,
1078    ) -> LLVMValueRef;
1079
1080    /// Obtain a GlobalIFunc value from a Module by its name.
1081    pub fn LLVMGetNamedGlobalIFunc(
1082        M: LLVMModuleRef,
1083        Name: *const ::libc::c_char,
1084        NameLen: ::libc::size_t,
1085    ) -> LLVMValueRef;
1086
1087    /// Obtain an iterator to the first GlobalIFunc in a Module.
1088    pub fn LLVMGetFirstGlobalIFunc(M: LLVMModuleRef) -> LLVMValueRef;
1089
1090    /// Obtain an iterator to the last GlobalIFunc in a Module.
1091    pub fn LLVMGetLastGlobalIFunc(M: LLVMModuleRef) -> LLVMValueRef;
1092
1093    /// Advance a GlobalIFunc iterator to the next GlobalIFunc.
1094    pub fn LLVMGetNextGlobalIFunc(IFunc: LLVMValueRef) -> LLVMValueRef;
1095
1096    /// Decrement a GlobalIFunc iterator to the previous GlobalIFunc.
1097    pub fn LLVMGetPreviousGlobalIFunc(IFunc: LLVMValueRef) -> LLVMValueRef;
1098
1099    /// Retrieves the resolver function associated with this indirect function, or
1100    /// NULL if it doesn't not exist.
1101    pub fn LLVMGetGlobalIFuncResolver(IFunc: LLVMValueRef) -> LLVMValueRef;
1102
1103    /// Sets the resolver function associated with this indirect function.
1104    pub fn LLVMSetGlobalIFuncResolver(IFunc: LLVMValueRef, Resolver: LLVMValueRef);
1105
1106    /// Remove a global indirect function from its parent module and delete it.
1107    pub fn LLVMEraseGlobalIFunc(IFunc: LLVMValueRef);
1108
1109    /// Remove a global indirect function from its parent module.
1110    pub fn LLVMRemoveGlobalIFunc(IFunc: LLVMValueRef);
1111
1112    /// Create an MDString value from a given string value.
1113    pub fn LLVMMDStringInContext2(
1114        C: LLVMContextRef,
1115        Str: *const ::libc::c_char,
1116        SLen: ::libc::size_t,
1117    ) -> LLVMMetadataRef;
1118
1119    /// Create an MDNode value with the given array of operands.
1120    pub fn LLVMMDNodeInContext2(
1121        C: LLVMContextRef,
1122        MDs: *mut LLVMMetadataRef,
1123        Count: ::libc::size_t,
1124    ) -> LLVMMetadataRef;
1125
1126    /// Obtain Metadata as a Value.
1127    pub fn LLVMMetadataAsValue(C: LLVMContextRef, MD: LLVMMetadataRef) -> LLVMValueRef;
1128    /// Obtain a Value as Metadata.
1129    pub fn LLVMValueAsMetadata(Val: LLVMValueRef) -> LLVMMetadataRef;
1130    /// Obtain the underlying string from a MDString value.
1131    ///
1132    /// `Len` is written to contain the length of the returned string.
1133    pub fn LLVMGetMDString(V: LLVMValueRef, Len: *mut ::libc::c_uint) -> *const ::libc::c_char;
1134    pub fn LLVMGetMDNodeNumOperands(V: LLVMValueRef) -> ::libc::c_uint;
1135    pub fn LLVMGetMDNodeOperands(V: LLVMValueRef, Dest: *mut LLVMValueRef);
1136    /// Replace an operand at a specific index in a llvm::MDNode value.
1137    pub fn LLVMReplaceMDNodeOperandWith(
1138        V: LLVMValueRef,
1139        Index: ::libc::c_uint,
1140        Replacement: LLVMMetadataRef,
1141    );
1142}
1143
1144// Core->Basic Block
1145extern "C" {
1146    pub fn LLVMBasicBlockAsValue(BB: LLVMBasicBlockRef) -> LLVMValueRef;
1147    pub fn LLVMValueIsBasicBlock(Val: LLVMValueRef) -> LLVMBool;
1148    pub fn LLVMValueAsBasicBlock(Val: LLVMValueRef) -> LLVMBasicBlockRef;
1149    /// Get the string name of a basic block.
1150    pub fn LLVMGetBasicBlockName(BB: LLVMBasicBlockRef) -> *const ::libc::c_char;
1151    pub fn LLVMGetBasicBlockParent(BB: LLVMBasicBlockRef) -> LLVMValueRef;
1152    pub fn LLVMGetBasicBlockTerminator(BB: LLVMBasicBlockRef) -> LLVMValueRef;
1153    pub fn LLVMCountBasicBlocks(Fn: LLVMValueRef) -> ::libc::c_uint;
1154    pub fn LLVMGetBasicBlocks(Fn: LLVMValueRef, BasicBlocks: *mut LLVMBasicBlockRef);
1155    pub fn LLVMGetFirstBasicBlock(Fn: LLVMValueRef) -> LLVMBasicBlockRef;
1156    pub fn LLVMGetLastBasicBlock(Fn: LLVMValueRef) -> LLVMBasicBlockRef;
1157    pub fn LLVMGetNextBasicBlock(BB: LLVMBasicBlockRef) -> LLVMBasicBlockRef;
1158    pub fn LLVMGetPreviousBasicBlock(BB: LLVMBasicBlockRef) -> LLVMBasicBlockRef;
1159    pub fn LLVMGetEntryBasicBlock(Fn: LLVMValueRef) -> LLVMBasicBlockRef;
1160    /// Insert the given basic block after the insertion point of the given builder.
1161    pub fn LLVMInsertExistingBasicBlockAfterInsertBlock(
1162        Builder: LLVMBuilderRef,
1163        BB: LLVMBasicBlockRef,
1164    );
1165    /// Append the given basic block to the basic block list of the given function.
1166    pub fn LLVMAppendExistingBasicBlock(Fn: LLVMValueRef, BB: LLVMBasicBlockRef);
1167    pub fn LLVMCreateBasicBlockInContext(
1168        C: LLVMContextRef,
1169        Name: *const ::libc::c_char,
1170    ) -> LLVMBasicBlockRef;
1171    pub fn LLVMAppendBasicBlockInContext(
1172        C: LLVMContextRef,
1173        Fn: LLVMValueRef,
1174        Name: *const ::libc::c_char,
1175    ) -> LLVMBasicBlockRef;
1176    pub fn LLVMAppendBasicBlock(Fn: LLVMValueRef, Name: *const ::libc::c_char)
1177        -> LLVMBasicBlockRef;
1178    pub fn LLVMInsertBasicBlockInContext(
1179        C: LLVMContextRef,
1180        BB: LLVMBasicBlockRef,
1181        Name: *const ::libc::c_char,
1182    ) -> LLVMBasicBlockRef;
1183    pub fn LLVMInsertBasicBlock(
1184        InsertBeforeBB: LLVMBasicBlockRef,
1185        Name: *const ::libc::c_char,
1186    ) -> LLVMBasicBlockRef;
1187    pub fn LLVMDeleteBasicBlock(BB: LLVMBasicBlockRef);
1188    pub fn LLVMRemoveBasicBlockFromParent(BB: LLVMBasicBlockRef);
1189    pub fn LLVMMoveBasicBlockBefore(BB: LLVMBasicBlockRef, MovePos: LLVMBasicBlockRef);
1190    pub fn LLVMMoveBasicBlockAfter(BB: LLVMBasicBlockRef, MovePos: LLVMBasicBlockRef);
1191    pub fn LLVMGetFirstInstruction(BB: LLVMBasicBlockRef) -> LLVMValueRef;
1192    pub fn LLVMGetLastInstruction(BB: LLVMBasicBlockRef) -> LLVMValueRef;
1193}
1194
1195// Core->Instructions
1196extern "C" {
1197    pub fn LLVMHasMetadata(Val: LLVMValueRef) -> ::libc::c_int;
1198    pub fn LLVMGetMetadata(Val: LLVMValueRef, KindID: ::libc::c_uint) -> LLVMValueRef;
1199    pub fn LLVMSetMetadata(Val: LLVMValueRef, KindID: ::libc::c_uint, Node: LLVMValueRef);
1200    pub fn LLVMInstructionGetAllMetadataOtherThanDebugLoc(
1201        Instr: LLVMValueRef,
1202        NumEntries: *mut ::libc::size_t,
1203    ) -> *mut LLVMValueMetadataEntry;
1204    pub fn LLVMGetInstructionParent(Inst: LLVMValueRef) -> LLVMBasicBlockRef;
1205    pub fn LLVMGetNextInstruction(Inst: LLVMValueRef) -> LLVMValueRef;
1206    pub fn LLVMGetPreviousInstruction(Inst: LLVMValueRef) -> LLVMValueRef;
1207    /// Remove the given instruction from its containing building block but
1208    /// kept alive.
1209    pub fn LLVMInstructionRemoveFromParent(Inst: LLVMValueRef);
1210    /// Remove the given instruction from its containing building block and
1211    /// delete it.
1212    pub fn LLVMInstructionEraseFromParent(Inst: LLVMValueRef);
1213    /// Remove the given instruction that is not inserted into a basic block.
1214    /// It must have previously been removed from its containing building block.
1215    pub fn LLVMDeleteInstruction(Inst: LLVMValueRef);
1216    pub fn LLVMGetInstructionOpcode(Inst: LLVMValueRef) -> LLVMOpcode;
1217    pub fn LLVMGetICmpPredicate(Inst: LLVMValueRef) -> LLVMIntPredicate;
1218    pub fn LLVMGetFCmpPredicate(Inst: LLVMValueRef) -> LLVMRealPredicate;
1219    pub fn LLVMInstructionClone(Inst: LLVMValueRef) -> LLVMValueRef;
1220    pub fn LLVMIsATerminatorInst(Inst: LLVMValueRef) -> LLVMValueRef;
1221
1222    /// Obtain the first debug record attached to an instruction.
1223    ///
1224    /// Use LLVMGetNextDbgRecord() and LLVMGetPreviousDbgRecord() to traverse the
1225    /// sequence of DbgRecords.
1226    ///
1227    /// Return the first DbgRecord attached to Inst or NULL if there are none.
1228    pub fn LLVMGetFirstDbgRecord(Inst: LLVMValueRef) -> LLVMDbgRecordRef;
1229    /// Obtain the last debug record attached to an instruction.
1230    ///
1231    /// Return the last DbgRecord attached to Inst or NULL if there are none.
1232    pub fn LLVMGetLastDbgRecord(Inst: LLVMValueRef) -> LLVMDbgRecordRef;
1233    /// Obtain the next DbgRecord in the sequence or NULL if there are no more.
1234    pub fn LLVMGetNextDbgRecord(DbgRecord: LLVMDbgRecordRef) -> LLVMDbgRecordRef;
1235    /// Obtain the previous DbgRecord in the sequence or NULL if there are no more.
1236    pub fn LLVMGetPreviousDbgRecord(DbgRecord: LLVMDbgRecordRef) -> LLVMDbgRecordRef;
1237
1238    // Instructions->Call Sites and Invocations
1239    // Obtain the argument count for a call instruction.
1240    //
1241    // The provided value should be either a CallInst, InvokeInst or FuncletPadInst.
1242    pub fn LLVMGetNumArgOperands(Instr: LLVMValueRef) -> ::libc::c_uint;
1243    pub fn LLVMSetInstructionCallConv(Instr: LLVMValueRef, CC: ::libc::c_uint);
1244    pub fn LLVMGetInstructionCallConv(Instr: LLVMValueRef) -> ::libc::c_uint;
1245    pub fn LLVMSetInstrParamAlignment(
1246        Instr: LLVMValueRef,
1247        Idx: LLVMAttributeIndex,
1248        Align: ::libc::c_uint,
1249    );
1250    pub fn LLVMAddCallSiteAttribute(C: LLVMValueRef, Idx: LLVMAttributeIndex, A: LLVMAttributeRef);
1251    pub fn LLVMGetCallSiteAttributeCount(
1252        C: LLVMValueRef,
1253        Idx: LLVMAttributeIndex,
1254    ) -> ::libc::c_uint;
1255    pub fn LLVMGetCallSiteAttributes(
1256        C: LLVMValueRef,
1257        Idx: LLVMAttributeIndex,
1258        Attrs: *mut LLVMAttributeRef,
1259    );
1260    pub fn LLVMGetCallSiteEnumAttribute(
1261        C: LLVMValueRef,
1262        Idx: LLVMAttributeIndex,
1263        KindID: ::libc::c_uint,
1264    ) -> LLVMAttributeRef;
1265    pub fn LLVMGetCallSiteStringAttribute(
1266        C: LLVMValueRef,
1267        Idx: LLVMAttributeIndex,
1268        K: *const ::libc::c_char,
1269        KLen: ::libc::c_uint,
1270    ) -> LLVMAttributeRef;
1271    pub fn LLVMRemoveCallSiteEnumAttribute(
1272        C: LLVMValueRef,
1273        Idx: LLVMAttributeIndex,
1274        KindID: ::libc::c_uint,
1275    );
1276    pub fn LLVMRemoveCallSiteStringAttribute(
1277        C: LLVMValueRef,
1278        Idx: LLVMAttributeIndex,
1279        K: *const ::libc::c_char,
1280        KLen: ::libc::c_uint,
1281    );
1282    pub fn LLVMGetCalledFunctionType(C: LLVMValueRef) -> LLVMTypeRef;
1283    /// Get a pointer to the function invoked by this instruction.
1284    ///
1285    /// The provided value should be a CallInst or InvokeInst.
1286    pub fn LLVMGetCalledValue(Instr: LLVMValueRef) -> LLVMValueRef;
1287    /// Get the number of operand bundles attached to this instruction.
1288    ///
1289    /// Only works with CallInst and InvokeInst instructions.
1290    pub fn LLVMGetNumOperandBundles(C: LLVMValueRef) -> ::libc::c_uint;
1291    /// Get the operand bundle attached to this instruction at the given index.
1292    ///
1293    /// Use LLVMDisposeOperandBundle to free the operand bundle. This only works
1294    /// on CallInst and InvokeInst instructions.
1295    pub fn LLVMGetOperandBundleAtIndex(
1296        C: LLVMValueRef,
1297        Index: ::libc::c_uint,
1298    ) -> LLVMOperandBundleRef;
1299    /// Get whether a call instruction is a tail call.
1300    pub fn LLVMIsTailCall(CallInst: LLVMValueRef) -> LLVMBool;
1301    pub fn LLVMSetTailCall(CallInst: LLVMValueRef, IsTailCall: LLVMBool);
1302    pub fn LLVMGetTailCallKind(CallInst: LLVMValueRef) -> LLVMTailCallKind;
1303    pub fn LLVMSetTailCallKind(CallInst: LLVMValueRef, kind: LLVMTailCallKind);
1304    /// Return the normal destination basic block of an invoke instruction.
1305    pub fn LLVMGetNormalDest(InvokeInst: LLVMValueRef) -> LLVMBasicBlockRef;
1306    /// Return the unwind destination basic block.
1307    pub fn LLVMGetUnwindDest(InvokeInst: LLVMValueRef) -> LLVMBasicBlockRef;
1308    /// Set the normal destination basic block.
1309    pub fn LLVMSetNormalDest(InvokeInst: LLVMValueRef, B: LLVMBasicBlockRef);
1310    /// Set the unwind destination basic block.
1311    pub fn LLVMSetUnwindDest(InvokeInst: LLVMValueRef, B: LLVMBasicBlockRef);
1312
1313    /// Get the default destination of a CallBr instruction.
1314    pub fn LLVMGetCallBrDefaultDest(CallBr: LLVMValueRef) -> LLVMBasicBlockRef;
1315    /// Get the number of indirect destinations of a CallBr instruction.
1316    pub fn LLVMGetCallBrNumIndirectDests(CallBr: LLVMValueRef) -> ::libc::c_uint;
1317    /// Get the indirect destination of a CallBr instruction at the given index.
1318    pub fn LLVMGetCallBrIndirectDest(
1319        CallBr: LLVMValueRef,
1320        Idx: ::libc::c_uint,
1321    ) -> LLVMBasicBlockRef;
1322
1323    // Instructions->Terminators
1324    pub fn LLVMGetNumSuccessors(Term: LLVMValueRef) -> ::libc::c_uint;
1325    pub fn LLVMGetSuccessor(Term: LLVMValueRef, i: ::libc::c_uint) -> LLVMBasicBlockRef;
1326    pub fn LLVMSetSuccessor(Term: LLVMValueRef, i: ::libc::c_uint, block: LLVMBasicBlockRef);
1327    pub fn LLVMIsConditional(Branch: LLVMValueRef) -> LLVMBool;
1328    pub fn LLVMGetCondition(Branch: LLVMValueRef) -> LLVMValueRef;
1329    pub fn LLVMSetCondition(Branch: LLVMValueRef, Cond: LLVMValueRef);
1330    pub fn LLVMGetSwitchDefaultDest(SwitchInstr: LLVMValueRef) -> LLVMBasicBlockRef;
1331
1332    // Instructions->Allocas
1333    // Obtain the type being allocated by an alloca instruction.
1334    pub fn LLVMGetAllocatedType(Alloca: LLVMValueRef) -> LLVMTypeRef;
1335
1336    // Instructions->GEPs
1337    // Check whether the given GEP operator is inbounds.
1338    pub fn LLVMIsInBounds(GEP: LLVMValueRef) -> LLVMBool;
1339    /// Set the given GEP instruction to be inbounds or not.
1340    pub fn LLVMSetIsInBounds(GEP: LLVMValueRef, InBounds: LLVMBool);
1341
1342    /// Get the source element type of the given GEP operator.
1343    pub fn LLVMGetGEPSourceElementType(GEP: LLVMValueRef) -> LLVMTypeRef;
1344    /// Get the no-wrap related flags for the given GEP instruction.
1345    pub fn LLVMGEPGetNoWrapFlags(GEP: LLVMValueRef) -> LLVMGEPNoWrapFlags;
1346    /// Set the no-wrap related flags for the given GEP instruction.
1347    pub fn LLVMGEPSetNoWrapFlags(GEP: LLVMValueRef, NoWrapFlags: LLVMGEPNoWrapFlags);
1348
1349    // Instruction->PHI Nodes
1350    pub fn LLVMAddIncoming(
1351        PhiNode: LLVMValueRef,
1352        IncomingValues: *mut LLVMValueRef,
1353        IncomingBlocks: *mut LLVMBasicBlockRef,
1354        Count: ::libc::c_uint,
1355    );
1356    pub fn LLVMCountIncoming(PhiNode: LLVMValueRef) -> ::libc::c_uint;
1357    pub fn LLVMGetIncomingValue(PhiNode: LLVMValueRef, Index: ::libc::c_uint) -> LLVMValueRef;
1358    pub fn LLVMGetIncomingBlock(PhiNode: LLVMValueRef, Index: ::libc::c_uint) -> LLVMBasicBlockRef;
1359}
1360
1361// Core->Values again; these don't appear in Doxygen because they're macro-generated.
1362extern "C" {
1363    pub fn LLVMIsAArgument(Val: LLVMValueRef) -> LLVMValueRef;
1364    pub fn LLVMIsABasicBlock(Val: LLVMValueRef) -> LLVMValueRef;
1365    pub fn LLVMIsAInlineAsm(Val: LLVMValueRef) -> LLVMValueRef;
1366    pub fn LLVMIsAUser(Val: LLVMValueRef) -> LLVMValueRef;
1367    pub fn LLVMIsAConstant(Val: LLVMValueRef) -> LLVMValueRef;
1368    pub fn LLVMIsABlockAddress(Val: LLVMValueRef) -> LLVMValueRef;
1369    pub fn LLVMIsAConstantAggregateZero(Val: LLVMValueRef) -> LLVMValueRef;
1370    pub fn LLVMIsAConstantArray(Val: LLVMValueRef) -> LLVMValueRef;
1371    pub fn LLVMIsAConstantDataSequential(Val: LLVMValueRef) -> LLVMValueRef;
1372    pub fn LLVMIsAConstantDataArray(Val: LLVMValueRef) -> LLVMValueRef;
1373    pub fn LLVMIsAConstantDataVector(Val: LLVMValueRef) -> LLVMValueRef;
1374    pub fn LLVMIsAConstantExpr(Val: LLVMValueRef) -> LLVMValueRef;
1375    pub fn LLVMIsAConstantFP(Val: LLVMValueRef) -> LLVMValueRef;
1376    pub fn LLVMIsAConstantInt(Val: LLVMValueRef) -> LLVMValueRef;
1377    pub fn LLVMIsAConstantPointerNull(Val: LLVMValueRef) -> LLVMValueRef;
1378    pub fn LLVMIsAConstantStruct(Val: LLVMValueRef) -> LLVMValueRef;
1379    pub fn LLVMIsAConstantTokenNone(Val: LLVMValueRef) -> LLVMValueRef;
1380    pub fn LLVMIsAConstantVector(Val: LLVMValueRef) -> LLVMValueRef;
1381    pub fn LLVMIsAConstantPtrAuth(Val: LLVMValueRef) -> LLVMValueRef;
1382    pub fn LLVMIsAGlobalValue(Val: LLVMValueRef) -> LLVMValueRef;
1383    pub fn LLVMIsAGlobalAlias(Val: LLVMValueRef) -> LLVMValueRef;
1384    pub fn LLVMIsAGlobalIFunc(Val: LLVMValueRef) -> LLVMValueRef;
1385    pub fn LLVMIsAGlobalObject(Val: LLVMValueRef) -> LLVMValueRef;
1386    pub fn LLVMIsAFunction(Val: LLVMValueRef) -> LLVMValueRef;
1387    pub fn LLVMIsAGlobalVariable(Val: LLVMValueRef) -> LLVMValueRef;
1388    pub fn LLVMIsAUndefValue(Val: LLVMValueRef) -> LLVMValueRef;
1389    pub fn LLVMIsAPoisonValue(Val: LLVMValueRef) -> LLVMValueRef;
1390    pub fn LLVMIsAInstruction(Val: LLVMValueRef) -> LLVMValueRef;
1391    pub fn LLVMIsAUnaryOperator(Val: LLVMValueRef) -> LLVMValueRef;
1392    pub fn LLVMIsABinaryOperator(Val: LLVMValueRef) -> LLVMValueRef;
1393    pub fn LLVMIsACallInst(Val: LLVMValueRef) -> LLVMValueRef;
1394    pub fn LLVMIsAIntrinsicInst(Val: LLVMValueRef) -> LLVMValueRef;
1395    pub fn LLVMIsADbgInfoIntrinsic(Val: LLVMValueRef) -> LLVMValueRef;
1396    pub fn LLVMIsADbgVariableIntrinsic(Val: LLVMValueRef) -> LLVMValueRef;
1397    pub fn LLVMIsADbgDeclareInst(Val: LLVMValueRef) -> LLVMValueRef;
1398    pub fn LLVMIsADbgLabelInst(Val: LLVMValueRef) -> LLVMValueRef;
1399    pub fn LLVMIsAMemIntrinsic(Val: LLVMValueRef) -> LLVMValueRef;
1400    pub fn LLVMIsAMemCpyInst(Val: LLVMValueRef) -> LLVMValueRef;
1401    pub fn LLVMIsAMemMoveInst(Val: LLVMValueRef) -> LLVMValueRef;
1402    pub fn LLVMIsAMemSetInst(Val: LLVMValueRef) -> LLVMValueRef;
1403    pub fn LLVMIsACmpInst(Val: LLVMValueRef) -> LLVMValueRef;
1404    pub fn LLVMIsAFCmpInst(Val: LLVMValueRef) -> LLVMValueRef;
1405    pub fn LLVMIsAICmpInst(Val: LLVMValueRef) -> LLVMValueRef;
1406    pub fn LLVMIsAExtractElementInst(Val: LLVMValueRef) -> LLVMValueRef;
1407    pub fn LLVMIsAGetElementPtrInst(Val: LLVMValueRef) -> LLVMValueRef;
1408    pub fn LLVMIsAInsertElementInst(Val: LLVMValueRef) -> LLVMValueRef;
1409    pub fn LLVMIsAInsertValueInst(Val: LLVMValueRef) -> LLVMValueRef;
1410    pub fn LLVMIsALandingPadInst(Val: LLVMValueRef) -> LLVMValueRef;
1411    pub fn LLVMIsAPHINode(Val: LLVMValueRef) -> LLVMValueRef;
1412    pub fn LLVMIsASelectInst(Val: LLVMValueRef) -> LLVMValueRef;
1413    pub fn LLVMIsAShuffleVectorInst(Val: LLVMValueRef) -> LLVMValueRef;
1414    pub fn LLVMIsAStoreInst(Val: LLVMValueRef) -> LLVMValueRef;
1415    pub fn LLVMIsABranchInst(Val: LLVMValueRef) -> LLVMValueRef;
1416    pub fn LLVMIsAIndirectBrInst(Val: LLVMValueRef) -> LLVMValueRef;
1417    pub fn LLVMIsAInvokeInst(Val: LLVMValueRef) -> LLVMValueRef;
1418    pub fn LLVMIsAReturnInst(Val: LLVMValueRef) -> LLVMValueRef;
1419    pub fn LLVMIsASwitchInst(Val: LLVMValueRef) -> LLVMValueRef;
1420    pub fn LLVMIsAUnreachableInst(Val: LLVMValueRef) -> LLVMValueRef;
1421    pub fn LLVMIsAResumeInst(Val: LLVMValueRef) -> LLVMValueRef;
1422    pub fn LLVMIsACleanupReturnInst(Val: LLVMValueRef) -> LLVMValueRef;
1423    pub fn LLVMIsACatchReturnInst(Val: LLVMValueRef) -> LLVMValueRef;
1424    pub fn LLVMIsACatchSwitchInst(Val: LLVMValueRef) -> LLVMValueRef;
1425    pub fn LLVMIsACallBrInst(Val: LLVMValueRef) -> LLVMValueRef;
1426    pub fn LLVMIsAFuncletPadInst(Val: LLVMValueRef) -> LLVMValueRef;
1427    pub fn LLVMIsACatchPadInst(Val: LLVMValueRef) -> LLVMValueRef;
1428    pub fn LLVMIsACleanupPadInst(Val: LLVMValueRef) -> LLVMValueRef;
1429    pub fn LLVMIsAUnaryInstruction(Val: LLVMValueRef) -> LLVMValueRef;
1430    pub fn LLVMIsAAllocaInst(Val: LLVMValueRef) -> LLVMValueRef;
1431    pub fn LLVMIsACastInst(Val: LLVMValueRef) -> LLVMValueRef;
1432    pub fn LLVMIsAAddrSpaceCastInst(Val: LLVMValueRef) -> LLVMValueRef;
1433    pub fn LLVMIsABitCastInst(Val: LLVMValueRef) -> LLVMValueRef;
1434    pub fn LLVMIsAFPExtInst(Val: LLVMValueRef) -> LLVMValueRef;
1435    pub fn LLVMIsAFPToSIInst(Val: LLVMValueRef) -> LLVMValueRef;
1436    pub fn LLVMIsAFPToUIInst(Val: LLVMValueRef) -> LLVMValueRef;
1437    pub fn LLVMIsAFPTruncInst(Val: LLVMValueRef) -> LLVMValueRef;
1438    pub fn LLVMIsAIntToPtrInst(Val: LLVMValueRef) -> LLVMValueRef;
1439    pub fn LLVMIsAPtrToIntInst(Val: LLVMValueRef) -> LLVMValueRef;
1440    pub fn LLVMIsASExtInst(Val: LLVMValueRef) -> LLVMValueRef;
1441    pub fn LLVMIsASIToFPInst(Val: LLVMValueRef) -> LLVMValueRef;
1442    pub fn LLVMIsATruncInst(Val: LLVMValueRef) -> LLVMValueRef;
1443    pub fn LLVMIsAUIToFPInst(Val: LLVMValueRef) -> LLVMValueRef;
1444    pub fn LLVMIsAZExtInst(Val: LLVMValueRef) -> LLVMValueRef;
1445    pub fn LLVMIsAExtractValueInst(Val: LLVMValueRef) -> LLVMValueRef;
1446    pub fn LLVMIsALoadInst(Val: LLVMValueRef) -> LLVMValueRef;
1447    pub fn LLVMIsAVAArgInst(Val: LLVMValueRef) -> LLVMValueRef;
1448    pub fn LLVMIsAFreezeInst(Val: LLVMValueRef) -> LLVMValueRef;
1449    pub fn LLVMIsAAtomicCmpXchgInst(Val: LLVMValueRef) -> LLVMValueRef;
1450    pub fn LLVMIsAAtomicRMWInst(Val: LLVMValueRef) -> LLVMValueRef;
1451    pub fn LLVMIsAFenceInst(Val: LLVMValueRef) -> LLVMValueRef;
1452}
1453
1454// Core->Extract/Insert Value
1455extern "C" {
1456    /// Get the number of indices on an ExtractValue, InsertValue or GEP operator.
1457    pub fn LLVMGetNumIndices(Inst: LLVMValueRef) -> ::libc::c_uint;
1458    pub fn LLVMGetIndices(Inst: LLVMValueRef) -> *const ::libc::c_uint;
1459}
1460
1461// Core->Instruction Builders
1462extern "C" {
1463    pub fn LLVMCreateBuilderInContext(C: LLVMContextRef) -> LLVMBuilderRef;
1464    pub fn LLVMCreateBuilder() -> LLVMBuilderRef;
1465    /// Set the builder position before Instr but after any attached debug records,
1466    /// or if Instr is null set the position to the end of Block.
1467    pub fn LLVMPositionBuilder(
1468        Builder: LLVMBuilderRef,
1469        Block: LLVMBasicBlockRef,
1470        Instr: LLVMValueRef,
1471    );
1472    /// Set the builder position before Instr and any attached debug records,
1473    /// or if Instr is null set the position to the end of Block.
1474    pub fn LLVMPositionBuilderBeforeDbgRecords(
1475        Builder: LLVMBuilderRef,
1476        Block: LLVMBasicBlockRef,
1477        Inst: LLVMValueRef,
1478    );
1479    /// Set the builder position before Instr but after any attached debug records.
1480    pub fn LLVMPositionBuilderBefore(Builder: LLVMBuilderRef, Instr: LLVMValueRef);
1481    /// Set the builder position before Instr and any attached debug records.
1482    pub fn LLVMPositionBuilderBeforeInstrAndDbgRecords(
1483        Builder: LLVMBuilderRef,
1484        Instr: LLVMValueRef,
1485    );
1486    pub fn LLVMPositionBuilderAtEnd(Builder: LLVMBuilderRef, Block: LLVMBasicBlockRef);
1487    pub fn LLVMGetInsertBlock(Builder: LLVMBuilderRef) -> LLVMBasicBlockRef;
1488    pub fn LLVMClearInsertionPosition(Builder: LLVMBuilderRef);
1489    pub fn LLVMInsertIntoBuilder(Builder: LLVMBuilderRef, Instr: LLVMValueRef);
1490    pub fn LLVMInsertIntoBuilderWithName(
1491        Builder: LLVMBuilderRef,
1492        Instr: LLVMValueRef,
1493        Name: *const ::libc::c_char,
1494    );
1495    pub fn LLVMDisposeBuilder(Builder: LLVMBuilderRef);
1496
1497    // Metadata
1498    /// Get location information used by debugging information.
1499    pub fn LLVMGetCurrentDebugLocation2(Builder: LLVMBuilderRef) -> LLVMMetadataRef;
1500    /// Set location information used by debugging information.
1501    pub fn LLVMSetCurrentDebugLocation2(Builder: LLVMBuilderRef, Loc: LLVMMetadataRef);
1502    /// Attempts to set the debug location for the given instruction using the
1503    /// current debug location for the given builder.  If the builder has no current
1504    /// debug location, this function is a no-op.
1505    #[deprecated(
1506        since = "140.0.0",
1507        note = "Deprecated in favor of the more general LLVMAddMetadataToInst."
1508    )]
1509    pub fn LLVMSetInstDebugLocation(Builder: LLVMBuilderRef, Inst: LLVMValueRef);
1510    /// Adds the metadata registered with the given builder to the given instruction.
1511    pub fn LLVMAddMetadataToInst(Builder: LLVMBuilderRef, Inst: LLVMValueRef);
1512    /// Get the dafult floating-point math metadata for a given builder.
1513    pub fn LLVMBuilderGetDefaultFPMathTag(Builder: LLVMBuilderRef) -> LLVMMetadataRef;
1514    /// Set the default floating-point math metadata for the given builder.
1515    pub fn LLVMBuilderSetDefaultFPMathTag(Builder: LLVMBuilderRef, FPMathTag: LLVMMetadataRef);
1516
1517    /// Obtain the context to which this builder is associated.
1518    pub fn LLVMGetBuilderContext(Builder: LLVMBuilderRef) -> LLVMContextRef;
1519
1520    #[deprecated(since = "90.0.0", note = "Use LLVMGetCurrentDebugLocation2 instead.")]
1521    pub fn LLVMSetCurrentDebugLocation(Builder: LLVMBuilderRef, L: LLVMValueRef);
1522    pub fn LLVMGetCurrentDebugLocation(Builder: LLVMBuilderRef) -> LLVMValueRef;
1523
1524    // Terminators
1525    pub fn LLVMBuildRetVoid(arg1: LLVMBuilderRef) -> LLVMValueRef;
1526    pub fn LLVMBuildRet(arg1: LLVMBuilderRef, V: LLVMValueRef) -> LLVMValueRef;
1527    pub fn LLVMBuildAggregateRet(
1528        arg1: LLVMBuilderRef,
1529        RetVals: *mut LLVMValueRef,
1530        N: ::libc::c_uint,
1531    ) -> LLVMValueRef;
1532    pub fn LLVMBuildBr(arg1: LLVMBuilderRef, Dest: LLVMBasicBlockRef) -> LLVMValueRef;
1533    pub fn LLVMBuildCondBr(
1534        arg1: LLVMBuilderRef,
1535        If: LLVMValueRef,
1536        Then: LLVMBasicBlockRef,
1537        Else: LLVMBasicBlockRef,
1538    ) -> LLVMValueRef;
1539    pub fn LLVMBuildSwitch(
1540        arg1: LLVMBuilderRef,
1541        V: LLVMValueRef,
1542        Else: LLVMBasicBlockRef,
1543        NumCases: ::libc::c_uint,
1544    ) -> LLVMValueRef;
1545    pub fn LLVMBuildIndirectBr(
1546        B: LLVMBuilderRef,
1547        Addr: LLVMValueRef,
1548        NumDests: ::libc::c_uint,
1549    ) -> LLVMValueRef;
1550    pub fn LLVMBuildCallBr(
1551        B: LLVMBuilderRef,
1552        Ty: LLVMTypeRef,
1553        Fn: LLVMValueRef,
1554        DefaultDest: LLVMBasicBlockRef,
1555        IndirectDests: *mut LLVMBasicBlockRef,
1556        NumIndirectDests: ::libc::c_uint,
1557        Args: *mut LLVMValueRef,
1558        NumArgs: ::libc::c_uint,
1559        Bundles: *mut LLVMOperandBundleRef,
1560        NumBundles: ::libc::c_uint,
1561        Name: *const ::libc::c_char,
1562    ) -> LLVMValueRef;
1563    pub fn LLVMBuildInvoke2(
1564        arg1: LLVMBuilderRef,
1565        Ty: LLVMTypeRef,
1566        Fn: LLVMValueRef,
1567        Args: *mut LLVMValueRef,
1568        NumArgs: ::libc::c_uint,
1569        Then: LLVMBasicBlockRef,
1570        Catch: LLVMBasicBlockRef,
1571        Name: *const ::libc::c_char,
1572    ) -> LLVMValueRef;
1573    pub fn LLVMBuildInvokeWithOperandBundles(
1574        arg1: LLVMBuilderRef,
1575        Ty: LLVMTypeRef,
1576        Fn: LLVMValueRef,
1577        Args: *mut LLVMValueRef,
1578        NumArgs: ::libc::c_uint,
1579        Then: LLVMBasicBlockRef,
1580        Catch: LLVMBasicBlockRef,
1581        Bundles: *mut LLVMOperandBundleRef,
1582        NumBundles: ::libc::c_uint,
1583        Name: *const ::libc::c_char,
1584    ) -> LLVMValueRef;
1585    pub fn LLVMBuildUnreachable(B: LLVMBuilderRef) -> LLVMValueRef;
1586
1587    pub fn LLVMBuildResume(B: LLVMBuilderRef, Exn: LLVMValueRef) -> LLVMValueRef;
1588    pub fn LLVMBuildLandingPad(
1589        B: LLVMBuilderRef,
1590        Ty: LLVMTypeRef,
1591        PersFn: LLVMValueRef,
1592        NumClauses: ::libc::c_uint,
1593        Name: *const ::libc::c_char,
1594    ) -> LLVMValueRef;
1595    pub fn LLVMBuildCleanupRet(
1596        B: LLVMBuilderRef,
1597        CatchPad: LLVMValueRef,
1598        BB: LLVMBasicBlockRef,
1599    ) -> LLVMValueRef;
1600    pub fn LLVMBuildCatchRet(
1601        B: LLVMBuilderRef,
1602        CatchPad: LLVMValueRef,
1603        BB: LLVMBasicBlockRef,
1604    ) -> LLVMValueRef;
1605    pub fn LLVMBuildCatchPad(
1606        B: LLVMBuilderRef,
1607        ParentPad: LLVMValueRef,
1608        Args: *mut LLVMValueRef,
1609        NumArgs: ::libc::c_uint,
1610        Name: *const ::libc::c_char,
1611    ) -> LLVMValueRef;
1612    pub fn LLVMBuildCleanupPad(
1613        B: LLVMBuilderRef,
1614        ParentPad: LLVMValueRef,
1615        Args: *mut LLVMValueRef,
1616        NumArgs: ::libc::c_uint,
1617        Name: *const ::libc::c_char,
1618    ) -> LLVMValueRef;
1619    pub fn LLVMBuildCatchSwitch(
1620        B: LLVMBuilderRef,
1621        ParentPad: LLVMValueRef,
1622        UnwindBB: LLVMBasicBlockRef,
1623        NumHandler: ::libc::c_uint,
1624        Name: *const ::libc::c_char,
1625    ) -> LLVMValueRef;
1626
1627    /// Add a case to a `switch` instruction
1628    pub fn LLVMAddCase(Switch: LLVMValueRef, OnVal: LLVMValueRef, Dest: LLVMBasicBlockRef);
1629
1630    /// Add a destination to an `indirectbr` instruction
1631    pub fn LLVMAddDestination(IndirectBr: LLVMValueRef, Dest: LLVMBasicBlockRef);
1632
1633    /// Get the number of clauses on a landingpad instruction.
1634    pub fn LLVMGetNumClauses(LandingPad: LLVMValueRef) -> ::libc::c_uint;
1635
1636    /// Get the value of the clause with the given index on a landingpad instruction.
1637    pub fn LLVMGetClause(LandingPad: LLVMValueRef, Idx: ::libc::c_uint) -> LLVMValueRef;
1638
1639    /// Add a catch or filter clause to a `landingpad` instruction
1640    pub fn LLVMAddClause(LandingPad: LLVMValueRef, ClauseVal: LLVMValueRef);
1641
1642    /// Get the cleanup flag in a landingpad instruction.
1643    pub fn LLVMIsCleanup(LandingPad: LLVMValueRef) -> LLVMBool;
1644
1645    /// Set the cleanup flag in a `landingpad` instruction.
1646    pub fn LLVMSetCleanup(LandingPad: LLVMValueRef, Val: LLVMBool);
1647
1648    /// Add a destination to the catchswitch instruction
1649    pub fn LLVMAddHandler(CatchSwitch: LLVMValueRef, Dest: LLVMBasicBlockRef);
1650
1651    /// Get the number of handlers on the catchswitch instruction
1652    pub fn LLVMGetNumHandlers(CatchSwitch: LLVMValueRef) -> ::libc::c_uint;
1653
1654    /// Obtain the basic blocks acting as handlers for a catchswitch instruction.
1655    ///
1656    /// 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.
1657    pub fn LLVMGetHandlers(CatchSwitch: LLVMValueRef, Handlers: *mut LLVMBasicBlockRef);
1658
1659    // Funclets
1660    /// Get the number of funcletpad arguments.
1661    pub fn LLVMGetArgOperand(Funclet: LLVMValueRef, i: ::libc::c_uint) -> LLVMValueRef;
1662
1663    /// Set a funcletpad argument at the given index.
1664    pub fn LLVMSetArgOperand(Funclet: LLVMValueRef, i: ::libc::c_uint, value: LLVMValueRef);
1665
1666    /// Get the parent catchswitch instruction of a catchpad instruction.
1667    ///
1668    /// This only works on llvm::CatchPadInst instructions.
1669    pub fn LLVMGetParentCatchSwitch(CatchPad: LLVMValueRef) -> LLVMValueRef;
1670
1671    /// Set the parent catchswitch instruction of a catchpad instruction.
1672    /// This only works on llvm::CatchPadInst instructions.
1673    pub fn LLVMSetParentCatchSwitch(CatchPad: LLVMValueRef, CatchSwitch: LLVMValueRef);
1674
1675    // Arithmetic
1676    pub fn LLVMBuildAdd(
1677        arg1: LLVMBuilderRef,
1678        LHS: LLVMValueRef,
1679        RHS: LLVMValueRef,
1680        Name: *const ::libc::c_char,
1681    ) -> LLVMValueRef;
1682    pub fn LLVMBuildNSWAdd(
1683        arg1: LLVMBuilderRef,
1684        LHS: LLVMValueRef,
1685        RHS: LLVMValueRef,
1686        Name: *const ::libc::c_char,
1687    ) -> LLVMValueRef;
1688    pub fn LLVMBuildNUWAdd(
1689        arg1: LLVMBuilderRef,
1690        LHS: LLVMValueRef,
1691        RHS: LLVMValueRef,
1692        Name: *const ::libc::c_char,
1693    ) -> LLVMValueRef;
1694    pub fn LLVMBuildFAdd(
1695        arg1: LLVMBuilderRef,
1696        LHS: LLVMValueRef,
1697        RHS: LLVMValueRef,
1698        Name: *const ::libc::c_char,
1699    ) -> LLVMValueRef;
1700    pub fn LLVMBuildSub(
1701        arg1: LLVMBuilderRef,
1702        LHS: LLVMValueRef,
1703        RHS: LLVMValueRef,
1704        Name: *const ::libc::c_char,
1705    ) -> LLVMValueRef;
1706    pub fn LLVMBuildNSWSub(
1707        arg1: LLVMBuilderRef,
1708        LHS: LLVMValueRef,
1709        RHS: LLVMValueRef,
1710        Name: *const ::libc::c_char,
1711    ) -> LLVMValueRef;
1712    pub fn LLVMBuildNUWSub(
1713        arg1: LLVMBuilderRef,
1714        LHS: LLVMValueRef,
1715        RHS: LLVMValueRef,
1716        Name: *const ::libc::c_char,
1717    ) -> LLVMValueRef;
1718    pub fn LLVMBuildFSub(
1719        arg1: LLVMBuilderRef,
1720        LHS: LLVMValueRef,
1721        RHS: LLVMValueRef,
1722        Name: *const ::libc::c_char,
1723    ) -> LLVMValueRef;
1724    pub fn LLVMBuildMul(
1725        arg1: LLVMBuilderRef,
1726        LHS: LLVMValueRef,
1727        RHS: LLVMValueRef,
1728        Name: *const ::libc::c_char,
1729    ) -> LLVMValueRef;
1730    pub fn LLVMBuildNSWMul(
1731        arg1: LLVMBuilderRef,
1732        LHS: LLVMValueRef,
1733        RHS: LLVMValueRef,
1734        Name: *const ::libc::c_char,
1735    ) -> LLVMValueRef;
1736    pub fn LLVMBuildNUWMul(
1737        arg1: LLVMBuilderRef,
1738        LHS: LLVMValueRef,
1739        RHS: LLVMValueRef,
1740        Name: *const ::libc::c_char,
1741    ) -> LLVMValueRef;
1742    pub fn LLVMBuildFMul(
1743        arg1: LLVMBuilderRef,
1744        LHS: LLVMValueRef,
1745        RHS: LLVMValueRef,
1746        Name: *const ::libc::c_char,
1747    ) -> LLVMValueRef;
1748    pub fn LLVMBuildUDiv(
1749        arg1: LLVMBuilderRef,
1750        LHS: LLVMValueRef,
1751        RHS: LLVMValueRef,
1752        Name: *const ::libc::c_char,
1753    ) -> LLVMValueRef;
1754    pub fn LLVMBuildExactUDiv(
1755        arg1: LLVMBuilderRef,
1756        LHS: LLVMValueRef,
1757        RHS: LLVMValueRef,
1758        Name: *const ::libc::c_char,
1759    ) -> LLVMValueRef;
1760    pub fn LLVMBuildSDiv(
1761        arg1: LLVMBuilderRef,
1762        LHS: LLVMValueRef,
1763        RHS: LLVMValueRef,
1764        Name: *const ::libc::c_char,
1765    ) -> LLVMValueRef;
1766    pub fn LLVMBuildExactSDiv(
1767        arg1: LLVMBuilderRef,
1768        LHS: LLVMValueRef,
1769        RHS: LLVMValueRef,
1770        Name: *const ::libc::c_char,
1771    ) -> LLVMValueRef;
1772    pub fn LLVMBuildFDiv(
1773        arg1: LLVMBuilderRef,
1774        LHS: LLVMValueRef,
1775        RHS: LLVMValueRef,
1776        Name: *const ::libc::c_char,
1777    ) -> LLVMValueRef;
1778    pub fn LLVMBuildURem(
1779        arg1: LLVMBuilderRef,
1780        LHS: LLVMValueRef,
1781        RHS: LLVMValueRef,
1782        Name: *const ::libc::c_char,
1783    ) -> LLVMValueRef;
1784    pub fn LLVMBuildSRem(
1785        arg1: LLVMBuilderRef,
1786        LHS: LLVMValueRef,
1787        RHS: LLVMValueRef,
1788        Name: *const ::libc::c_char,
1789    ) -> LLVMValueRef;
1790    pub fn LLVMBuildFRem(
1791        arg1: LLVMBuilderRef,
1792        LHS: LLVMValueRef,
1793        RHS: LLVMValueRef,
1794        Name: *const ::libc::c_char,
1795    ) -> LLVMValueRef;
1796    pub fn LLVMBuildShl(
1797        arg1: LLVMBuilderRef,
1798        LHS: LLVMValueRef,
1799        RHS: LLVMValueRef,
1800        Name: *const ::libc::c_char,
1801    ) -> LLVMValueRef;
1802    pub fn LLVMBuildLShr(
1803        arg1: LLVMBuilderRef,
1804        LHS: LLVMValueRef,
1805        RHS: LLVMValueRef,
1806        Name: *const ::libc::c_char,
1807    ) -> LLVMValueRef;
1808    pub fn LLVMBuildAShr(
1809        arg1: LLVMBuilderRef,
1810        LHS: LLVMValueRef,
1811        RHS: LLVMValueRef,
1812        Name: *const ::libc::c_char,
1813    ) -> LLVMValueRef;
1814    pub fn LLVMBuildAnd(
1815        arg1: LLVMBuilderRef,
1816        LHS: LLVMValueRef,
1817        RHS: LLVMValueRef,
1818        Name: *const ::libc::c_char,
1819    ) -> LLVMValueRef;
1820    pub fn LLVMBuildOr(
1821        arg1: LLVMBuilderRef,
1822        LHS: LLVMValueRef,
1823        RHS: LLVMValueRef,
1824        Name: *const ::libc::c_char,
1825    ) -> LLVMValueRef;
1826    pub fn LLVMBuildXor(
1827        arg1: LLVMBuilderRef,
1828        LHS: LLVMValueRef,
1829        RHS: LLVMValueRef,
1830        Name: *const ::libc::c_char,
1831    ) -> LLVMValueRef;
1832    pub fn LLVMBuildBinOp(
1833        B: LLVMBuilderRef,
1834        Op: LLVMOpcode,
1835        LHS: LLVMValueRef,
1836        RHS: LLVMValueRef,
1837        Name: *const ::libc::c_char,
1838    ) -> LLVMValueRef;
1839    pub fn LLVMBuildNeg(
1840        arg1: LLVMBuilderRef,
1841        V: LLVMValueRef,
1842        Name: *const ::libc::c_char,
1843    ) -> LLVMValueRef;
1844    pub fn LLVMBuildNSWNeg(
1845        B: LLVMBuilderRef,
1846        V: LLVMValueRef,
1847        Name: *const ::libc::c_char,
1848    ) -> LLVMValueRef;
1849    #[deprecated(since = "191.0.0", note = "Use LLVMBuildNeg + LLVMSetNUW instead.")]
1850    pub fn LLVMBuildNUWNeg(
1851        B: LLVMBuilderRef,
1852        V: LLVMValueRef,
1853        Name: *const ::libc::c_char,
1854    ) -> LLVMValueRef;
1855    pub fn LLVMBuildFNeg(
1856        arg1: LLVMBuilderRef,
1857        V: LLVMValueRef,
1858        Name: *const ::libc::c_char,
1859    ) -> LLVMValueRef;
1860    pub fn LLVMBuildNot(
1861        arg1: LLVMBuilderRef,
1862        V: LLVMValueRef,
1863        Name: *const ::libc::c_char,
1864    ) -> LLVMValueRef;
1865
1866    pub fn LLVMGetNUW(ArithInst: LLVMValueRef) -> LLVMBool;
1867    pub fn LLVMSetNUW(ArithInst: LLVMValueRef, HasNUW: LLVMBool);
1868    pub fn LLVMGetNSW(ArithInst: LLVMValueRef) -> LLVMBool;
1869    pub fn LLVMSetNSW(ArithInst: LLVMValueRef, HasNSW: LLVMBool);
1870    pub fn LLVMGetExact(DivOrShrInst: LLVMValueRef) -> LLVMBool;
1871    pub fn LLVMSetExact(DivOrShrInst: LLVMValueRef, IsExact: LLVMBool);
1872
1873    /// Gets if the instruction has the non-negative flag set.
1874    ///
1875    /// Only valid for zext instructions.
1876    pub fn LLVMGetNNeg(NonNegInst: LLVMValueRef) -> LLVMBool;
1877
1878    /// Sets the non-negative flag for the instruction.
1879    ///
1880    /// Only valid for zext instructions.
1881    pub fn LLVMSetNNeg(NonNegInst: LLVMValueRef, IsNonNeg: LLVMBool);
1882
1883    /// Get the flags for which fast-math-style optimizations are allowed for this value.
1884    ///
1885    /// Only valid on floating point instructions.
1886    pub fn LLVMGetFastMathFlags(FPMathInst: LLVMValueRef) -> LLVMFastMathFlags;
1887
1888    /// Sets the flags for which fast-math-style optimizations are allowed for this value.
1889    ///
1890    /// Only valid on floating point instructions.
1891    pub fn LLVMSetFastMathFlags(FPMathInst: LLVMValueRef, FMF: LLVMFastMathFlags);
1892
1893    /// Check if a given value can potentially have fast math flags.
1894    ///
1895    /// Will return true for floating point arithmetic instructions, and for select,
1896    /// phi, and call instructions whose type is a floating point type, or a vector
1897    /// or array thereof. See <https://llvm.org/docs/LangRef.html#fast-math-flags>
1898    pub fn LLVMCanValueUseFastMathFlags(Inst: LLVMValueRef) -> LLVMBool;
1899
1900    /// Gets whether the instruction has the disjoint flag set.
1901    ///
1902    /// Only valid for or instructions.
1903    pub fn LLVMGetIsDisjoint(Inst: LLVMValueRef) -> LLVMBool;
1904
1905    /// Sets the disjoint flag for the instruction.
1906    ///
1907    /// Only valid for or instructions.
1908    pub fn LLVMSetIsDisjoint(Inst: LLVMValueRef, IsDisjoint: LLVMBool);
1909
1910    // Memory
1911    pub fn LLVMBuildMalloc(
1912        arg1: LLVMBuilderRef,
1913        Ty: LLVMTypeRef,
1914        Name: *const ::libc::c_char,
1915    ) -> LLVMValueRef;
1916    pub fn LLVMBuildArrayMalloc(
1917        arg1: LLVMBuilderRef,
1918        Ty: LLVMTypeRef,
1919        Val: LLVMValueRef,
1920        Name: *const ::libc::c_char,
1921    ) -> LLVMValueRef;
1922    pub fn LLVMBuildMemSet(
1923        B: LLVMBuilderRef,
1924        Ptr: LLVMValueRef,
1925        Val: LLVMValueRef,
1926        Len: LLVMValueRef,
1927        Align: ::libc::c_uint,
1928    ) -> LLVMValueRef;
1929    pub fn LLVMBuildMemCpy(
1930        B: LLVMBuilderRef,
1931        Dst: LLVMValueRef,
1932        DstAlign: ::libc::c_uint,
1933        Src: LLVMValueRef,
1934        SrcAlign: ::libc::c_uint,
1935        Size: LLVMValueRef,
1936    ) -> LLVMValueRef;
1937    pub fn LLVMBuildMemMove(
1938        B: LLVMBuilderRef,
1939        Dst: LLVMValueRef,
1940        DstAlign: ::libc::c_uint,
1941        Src: LLVMValueRef,
1942        SrcAlign: ::libc::c_uint,
1943        Size: LLVMValueRef,
1944    ) -> LLVMValueRef;
1945    pub fn LLVMBuildAlloca(
1946        arg1: LLVMBuilderRef,
1947        Ty: LLVMTypeRef,
1948        Name: *const ::libc::c_char,
1949    ) -> LLVMValueRef;
1950    pub fn LLVMBuildArrayAlloca(
1951        arg1: LLVMBuilderRef,
1952        Ty: LLVMTypeRef,
1953        Val: LLVMValueRef,
1954        Name: *const ::libc::c_char,
1955    ) -> LLVMValueRef;
1956    pub fn LLVMBuildFree(arg1: LLVMBuilderRef, PointerVal: LLVMValueRef) -> LLVMValueRef;
1957    pub fn LLVMBuildLoad2(
1958        arg1: LLVMBuilderRef,
1959        Ty: LLVMTypeRef,
1960        PointerVal: LLVMValueRef,
1961        Name: *const ::libc::c_char,
1962    ) -> LLVMValueRef;
1963    pub fn LLVMBuildStore(
1964        arg1: LLVMBuilderRef,
1965        Val: LLVMValueRef,
1966        Ptr: LLVMValueRef,
1967    ) -> LLVMValueRef;
1968    pub fn LLVMBuildGEP2(
1969        B: LLVMBuilderRef,
1970        Ty: LLVMTypeRef,
1971        Pointer: LLVMValueRef,
1972        Indices: *mut LLVMValueRef,
1973        NumIndices: ::libc::c_uint,
1974        Name: *const ::libc::c_char,
1975    ) -> LLVMValueRef;
1976    pub fn LLVMBuildInBoundsGEP2(
1977        B: LLVMBuilderRef,
1978        Ty: LLVMTypeRef,
1979        Pointer: LLVMValueRef,
1980        Indices: *mut LLVMValueRef,
1981        NumIndices: ::libc::c_uint,
1982        Name: *const ::libc::c_char,
1983    ) -> LLVMValueRef;
1984    /// Creates a GetElementPtr instruction.
1985    ///
1986    /// Similar to LLVMBuildGEP2, but allows specifying the no-wrap flags.
1987    pub fn LLVMBuildGEPWithNoWrapFlags(
1988        B: LLVMBuilderRef,
1989        Ty: LLVMTypeRef,
1990        Pointer: LLVMValueRef,
1991        Indices: *mut LLVMValueRef,
1992        NumIndices: ::libc::c_uint,
1993        Name: *const ::libc::c_char,
1994        NoWrapFlags: LLVMGEPNoWrapFlags,
1995    ) -> LLVMValueRef;
1996    pub fn LLVMBuildStructGEP2(
1997        B: LLVMBuilderRef,
1998        Ty: LLVMTypeRef,
1999        Pointer: LLVMValueRef,
2000        Idx: ::libc::c_uint,
2001        Name: *const ::libc::c_char,
2002    ) -> LLVMValueRef;
2003    pub fn LLVMBuildGlobalString(
2004        B: LLVMBuilderRef,
2005        Str: *const ::libc::c_char,
2006        Name: *const ::libc::c_char,
2007    ) -> LLVMValueRef;
2008    #[deprecated(
2009        since = "201.0.0",
2010        note = "Use LLVMBuildGlobalString instead, which has identical behavior"
2011    )]
2012    pub fn LLVMBuildGlobalStringPtr(
2013        B: LLVMBuilderRef,
2014        Str: *const ::libc::c_char,
2015        Name: *const ::libc::c_char,
2016    ) -> LLVMValueRef;
2017    pub fn LLVMGetVolatile(MemoryAccessInst: LLVMValueRef) -> LLVMBool;
2018    pub fn LLVMSetVolatile(MemoryAccessInst: LLVMValueRef, IsVolatile: LLVMBool);
2019    pub fn LLVMGetWeak(CmpXchgInst: LLVMValueRef) -> LLVMBool;
2020    pub fn LLVMSetWeak(CmpXchgInst: LLVMValueRef, IsWeak: LLVMBool);
2021    pub fn LLVMGetOrdering(MemoryAccessInst: LLVMValueRef) -> LLVMAtomicOrdering;
2022    pub fn LLVMSetOrdering(MemoryAccessInst: LLVMValueRef, Ordering: LLVMAtomicOrdering);
2023    pub fn LLVMGetAtomicRMWBinOp(AtomicRMWInst: LLVMValueRef) -> LLVMAtomicRMWBinOp;
2024    pub fn LLVMSetAtomicRMWBinOp(AtomicRMWInst: LLVMValueRef, BinOp: LLVMAtomicRMWBinOp);
2025
2026    // Casts
2027    pub fn LLVMBuildTrunc(
2028        arg1: LLVMBuilderRef,
2029        Val: LLVMValueRef,
2030        DestTy: LLVMTypeRef,
2031        Name: *const ::libc::c_char,
2032    ) -> LLVMValueRef;
2033    pub fn LLVMBuildZExt(
2034        arg1: LLVMBuilderRef,
2035        Val: LLVMValueRef,
2036        DestTy: LLVMTypeRef,
2037        Name: *const ::libc::c_char,
2038    ) -> LLVMValueRef;
2039    pub fn LLVMBuildSExt(
2040        arg1: LLVMBuilderRef,
2041        Val: LLVMValueRef,
2042        DestTy: LLVMTypeRef,
2043        Name: *const ::libc::c_char,
2044    ) -> LLVMValueRef;
2045    pub fn LLVMBuildFPToUI(
2046        arg1: LLVMBuilderRef,
2047        Val: LLVMValueRef,
2048        DestTy: LLVMTypeRef,
2049        Name: *const ::libc::c_char,
2050    ) -> LLVMValueRef;
2051    pub fn LLVMBuildFPToSI(
2052        arg1: LLVMBuilderRef,
2053        Val: LLVMValueRef,
2054        DestTy: LLVMTypeRef,
2055        Name: *const ::libc::c_char,
2056    ) -> LLVMValueRef;
2057    pub fn LLVMBuildUIToFP(
2058        arg1: LLVMBuilderRef,
2059        Val: LLVMValueRef,
2060        DestTy: LLVMTypeRef,
2061        Name: *const ::libc::c_char,
2062    ) -> LLVMValueRef;
2063    pub fn LLVMBuildSIToFP(
2064        arg1: LLVMBuilderRef,
2065        Val: LLVMValueRef,
2066        DestTy: LLVMTypeRef,
2067        Name: *const ::libc::c_char,
2068    ) -> LLVMValueRef;
2069    pub fn LLVMBuildFPTrunc(
2070        arg1: LLVMBuilderRef,
2071        Val: LLVMValueRef,
2072        DestTy: LLVMTypeRef,
2073        Name: *const ::libc::c_char,
2074    ) -> LLVMValueRef;
2075    pub fn LLVMBuildFPExt(
2076        arg1: LLVMBuilderRef,
2077        Val: LLVMValueRef,
2078        DestTy: LLVMTypeRef,
2079        Name: *const ::libc::c_char,
2080    ) -> LLVMValueRef;
2081    pub fn LLVMBuildPtrToInt(
2082        arg1: LLVMBuilderRef,
2083        Val: LLVMValueRef,
2084        DestTy: LLVMTypeRef,
2085        Name: *const ::libc::c_char,
2086    ) -> LLVMValueRef;
2087    pub fn LLVMBuildIntToPtr(
2088        arg1: LLVMBuilderRef,
2089        Val: LLVMValueRef,
2090        DestTy: LLVMTypeRef,
2091        Name: *const ::libc::c_char,
2092    ) -> LLVMValueRef;
2093    pub fn LLVMBuildBitCast(
2094        arg1: LLVMBuilderRef,
2095        Val: LLVMValueRef,
2096        DestTy: LLVMTypeRef,
2097        Name: *const ::libc::c_char,
2098    ) -> LLVMValueRef;
2099    pub fn LLVMBuildAddrSpaceCast(
2100        arg1: LLVMBuilderRef,
2101        Val: LLVMValueRef,
2102        DestTy: LLVMTypeRef,
2103        Name: *const ::libc::c_char,
2104    ) -> LLVMValueRef;
2105    pub fn LLVMBuildZExtOrBitCast(
2106        arg1: LLVMBuilderRef,
2107        Val: LLVMValueRef,
2108        DestTy: LLVMTypeRef,
2109        Name: *const ::libc::c_char,
2110    ) -> LLVMValueRef;
2111    pub fn LLVMBuildSExtOrBitCast(
2112        arg1: LLVMBuilderRef,
2113        Val: LLVMValueRef,
2114        DestTy: LLVMTypeRef,
2115        Name: *const ::libc::c_char,
2116    ) -> LLVMValueRef;
2117    pub fn LLVMBuildTruncOrBitCast(
2118        arg1: LLVMBuilderRef,
2119        Val: LLVMValueRef,
2120        DestTy: LLVMTypeRef,
2121        Name: *const ::libc::c_char,
2122    ) -> LLVMValueRef;
2123    pub fn LLVMBuildCast(
2124        B: LLVMBuilderRef,
2125        Op: LLVMOpcode,
2126        Val: LLVMValueRef,
2127        DestTy: LLVMTypeRef,
2128        Name: *const ::libc::c_char,
2129    ) -> LLVMValueRef;
2130    pub fn LLVMBuildPointerCast(
2131        arg1: LLVMBuilderRef,
2132        Val: LLVMValueRef,
2133        DestTy: LLVMTypeRef,
2134        Name: *const ::libc::c_char,
2135    ) -> LLVMValueRef;
2136    pub fn LLVMBuildIntCast(
2137        arg1: LLVMBuilderRef,
2138        Val: LLVMValueRef,
2139        DestTy: LLVMTypeRef,
2140        Name: *const ::libc::c_char,
2141    ) -> LLVMValueRef;
2142    pub fn LLVMBuildIntCast2(
2143        arg1: LLVMBuilderRef,
2144        Val: LLVMValueRef,
2145        DestTy: LLVMTypeRef,
2146        IsSigned: LLVMBool,
2147        Name: *const ::libc::c_char,
2148    ) -> LLVMValueRef;
2149    pub fn LLVMBuildFPCast(
2150        arg1: LLVMBuilderRef,
2151        Val: LLVMValueRef,
2152        DestTy: LLVMTypeRef,
2153        Name: *const ::libc::c_char,
2154    ) -> LLVMValueRef;
2155    pub fn LLVMGetCastOpcode(
2156        arg1: LLVMValueRef,
2157        SrcIsSigned: LLVMBool,
2158        DestTy: LLVMTypeRef,
2159        DestIsSigned: LLVMBool,
2160    ) -> LLVMOpcode;
2161
2162    // Comparisons
2163    pub fn LLVMBuildICmp(
2164        arg1: LLVMBuilderRef,
2165        Op: LLVMIntPredicate,
2166        LHS: LLVMValueRef,
2167        RHS: LLVMValueRef,
2168        Name: *const ::libc::c_char,
2169    ) -> LLVMValueRef;
2170    pub fn LLVMBuildFCmp(
2171        arg1: LLVMBuilderRef,
2172        Op: LLVMRealPredicate,
2173        LHS: LLVMValueRef,
2174        RHS: LLVMValueRef,
2175        Name: *const ::libc::c_char,
2176    ) -> LLVMValueRef;
2177
2178    // Miscellaneous instructions
2179    pub fn LLVMBuildPhi(
2180        arg1: LLVMBuilderRef,
2181        Ty: LLVMTypeRef,
2182        Name: *const ::libc::c_char,
2183    ) -> LLVMValueRef;
2184    pub fn LLVMBuildCall2(
2185        arg1: LLVMBuilderRef,
2186        arg2: LLVMTypeRef,
2187        Fn: LLVMValueRef,
2188        Args: *mut LLVMValueRef,
2189        NumArgs: ::libc::c_uint,
2190        Name: *const ::libc::c_char,
2191    ) -> LLVMValueRef;
2192    pub fn LLVMBuildCallWithOperandBundles(
2193        arg1: LLVMBuilderRef,
2194        arg2: LLVMTypeRef,
2195        Fn: LLVMValueRef,
2196        Args: *mut LLVMValueRef,
2197        NumArgs: ::libc::c_uint,
2198        Bundles: *mut LLVMOperandBundleRef,
2199        NumBundles: ::libc::c_uint,
2200        Name: *const ::libc::c_char,
2201    ) -> LLVMValueRef;
2202    pub fn LLVMBuildSelect(
2203        arg1: LLVMBuilderRef,
2204        If: LLVMValueRef,
2205        Then: LLVMValueRef,
2206        Else: LLVMValueRef,
2207        Name: *const ::libc::c_char,
2208    ) -> LLVMValueRef;
2209    pub fn LLVMBuildVAArg(
2210        arg1: LLVMBuilderRef,
2211        List: LLVMValueRef,
2212        Ty: LLVMTypeRef,
2213        Name: *const ::libc::c_char,
2214    ) -> LLVMValueRef;
2215    pub fn LLVMBuildExtractElement(
2216        arg1: LLVMBuilderRef,
2217        VecVal: LLVMValueRef,
2218        Index: LLVMValueRef,
2219        Name: *const ::libc::c_char,
2220    ) -> LLVMValueRef;
2221    pub fn LLVMBuildInsertElement(
2222        arg1: LLVMBuilderRef,
2223        VecVal: LLVMValueRef,
2224        EltVal: LLVMValueRef,
2225        Index: LLVMValueRef,
2226        Name: *const ::libc::c_char,
2227    ) -> LLVMValueRef;
2228    pub fn LLVMBuildShuffleVector(
2229        arg1: LLVMBuilderRef,
2230        V1: LLVMValueRef,
2231        V2: LLVMValueRef,
2232        Mask: LLVMValueRef,
2233        Name: *const ::libc::c_char,
2234    ) -> LLVMValueRef;
2235    pub fn LLVMBuildExtractValue(
2236        arg1: LLVMBuilderRef,
2237        AggVal: LLVMValueRef,
2238        Index: ::libc::c_uint,
2239        Name: *const ::libc::c_char,
2240    ) -> LLVMValueRef;
2241    pub fn LLVMBuildInsertValue(
2242        arg1: LLVMBuilderRef,
2243        AggVal: LLVMValueRef,
2244        EltVal: LLVMValueRef,
2245        Index: ::libc::c_uint,
2246        Name: *const ::libc::c_char,
2247    ) -> LLVMValueRef;
2248    pub fn LLVMBuildFreeze(
2249        arg1: LLVMBuilderRef,
2250        Val: LLVMValueRef,
2251        Name: *const ::libc::c_char,
2252    ) -> LLVMValueRef;
2253    pub fn LLVMBuildIsNull(
2254        arg1: LLVMBuilderRef,
2255        Val: LLVMValueRef,
2256        Name: *const ::libc::c_char,
2257    ) -> LLVMValueRef;
2258    pub fn LLVMBuildIsNotNull(
2259        arg1: LLVMBuilderRef,
2260        Val: LLVMValueRef,
2261        Name: *const ::libc::c_char,
2262    ) -> LLVMValueRef;
2263    pub fn LLVMBuildPtrDiff2(
2264        arg1: LLVMBuilderRef,
2265        ElemTy: LLVMTypeRef,
2266        LHS: LLVMValueRef,
2267        RHS: LLVMValueRef,
2268        Name: *const ::libc::c_char,
2269    ) -> LLVMValueRef;
2270    pub fn LLVMBuildFence(
2271        B: LLVMBuilderRef,
2272        ordering: LLVMAtomicOrdering,
2273        singleThread: LLVMBool,
2274        Name: *const ::libc::c_char,
2275    ) -> LLVMValueRef;
2276    pub fn LLVMBuildFenceSyncScope(
2277        B: LLVMBuilderRef,
2278        ordering: LLVMAtomicOrdering,
2279        SSID: ::libc::c_uint,
2280        Name: *const ::libc::c_char,
2281    ) -> LLVMValueRef;
2282    pub fn LLVMBuildAtomicRMW(
2283        B: LLVMBuilderRef,
2284        op: LLVMAtomicRMWBinOp,
2285        PTR: LLVMValueRef,
2286        Val: LLVMValueRef,
2287        ordering: LLVMAtomicOrdering,
2288        singleThread: LLVMBool,
2289    ) -> LLVMValueRef;
2290    pub fn LLVMBuildAtomicRMWSyncScope(
2291        B: LLVMBuilderRef,
2292        op: LLVMAtomicRMWBinOp,
2293        PTR: LLVMValueRef,
2294        Val: LLVMValueRef,
2295        ordering: LLVMAtomicOrdering,
2296        SSID: ::libc::c_uint,
2297    ) -> LLVMValueRef;
2298    pub fn LLVMBuildAtomicCmpXchg(
2299        B: LLVMBuilderRef,
2300        Ptr: LLVMValueRef,
2301        Cmp: LLVMValueRef,
2302        New: LLVMValueRef,
2303        SuccessOrdering: LLVMAtomicOrdering,
2304        FailureOrdering: LLVMAtomicOrdering,
2305        SingleThread: LLVMBool,
2306    ) -> LLVMValueRef;
2307    pub fn LLVMBuildAtomicCmpXchgSyncScope(
2308        B: LLVMBuilderRef,
2309        Ptr: LLVMValueRef,
2310        Cmp: LLVMValueRef,
2311        New: LLVMValueRef,
2312        SuccessOrdering: LLVMAtomicOrdering,
2313        FailureOrdering: LLVMAtomicOrdering,
2314        SSID: ::libc::c_uint,
2315    ) -> LLVMValueRef;
2316    pub fn LLVMGetNumMaskElements(ShuffleVectorInst: LLVMValueRef) -> ::libc::c_uint;
2317    pub fn LLVMGetUndefMaskElem() -> ::libc::c_int;
2318    pub fn LLVMGetMaskValue(ShuffleVectorInst: LLVMValueRef, Elt: ::libc::c_uint) -> ::libc::c_int;
2319    pub fn LLVMIsAtomicSingleThread(AtomicInst: LLVMValueRef) -> LLVMBool;
2320    pub fn LLVMSetAtomicSingleThread(AtomicInst: LLVMValueRef, SingleThread: LLVMBool);
2321    /// Returns whether an instruction is an atomic instruction, e.g., atomicrmw,
2322    /// cmpxchg, fence, or loads and stores with atomic ordering.
2323    pub fn LLVMIsAtomic(Inst: LLVMValueRef) -> LLVMBool;
2324    /// Returns the synchronization scope ID of an atomic instruction.
2325    pub fn LLVMGetAtomicSyncScopeID(AtomicInst: LLVMValueRef) -> ::libc::c_uint;
2326    /// Sets the synchronization scope ID of an atomic instruction.
2327    pub fn LLVMSetAtomicSyncScopeID(AtomicInst: LLVMValueRef, SSID: ::libc::c_uint);
2328    pub fn LLVMGetCmpXchgSuccessOrdering(CmpXchgInst: LLVMValueRef) -> LLVMAtomicOrdering;
2329    pub fn LLVMSetCmpXchgSuccessOrdering(CmpXchgInst: LLVMValueRef, Ordering: LLVMAtomicOrdering);
2330    pub fn LLVMGetCmpXchgFailureOrdering(CmpXchgInst: LLVMValueRef) -> LLVMAtomicOrdering;
2331    pub fn LLVMSetCmpXchgFailureOrdering(CmpXchgInst: LLVMValueRef, Ordering: LLVMAtomicOrdering);
2332}
2333
2334// Core->Module Providers
2335extern "C" {
2336    pub fn LLVMCreateModuleProviderForExistingModule(M: LLVMModuleRef) -> LLVMModuleProviderRef;
2337    pub fn LLVMDisposeModuleProvider(M: LLVMModuleProviderRef);
2338}
2339
2340// Core->Memory Buffers
2341extern "C" {
2342    pub fn LLVMCreateMemoryBufferWithContentsOfFile(
2343        Path: *const ::libc::c_char,
2344        OutMemBuf: *mut LLVMMemoryBufferRef,
2345        OutMessage: *mut *mut ::libc::c_char,
2346    ) -> LLVMBool;
2347    pub fn LLVMCreateMemoryBufferWithSTDIN(
2348        OutMemBuf: *mut LLVMMemoryBufferRef,
2349        OutMessage: *mut *mut ::libc::c_char,
2350    ) -> LLVMBool;
2351    pub fn LLVMCreateMemoryBufferWithMemoryRange(
2352        InputData: *const ::libc::c_char,
2353        InputDataLength: ::libc::size_t,
2354        BufferName: *const ::libc::c_char,
2355        RequiresNullTerminator: LLVMBool,
2356    ) -> LLVMMemoryBufferRef;
2357    pub fn LLVMCreateMemoryBufferWithMemoryRangeCopy(
2358        InputData: *const ::libc::c_char,
2359        InputDataLength: ::libc::size_t,
2360        BufferName: *const ::libc::c_char,
2361    ) -> LLVMMemoryBufferRef;
2362    pub fn LLVMGetBufferStart(MemBuf: LLVMMemoryBufferRef) -> *const ::libc::c_char;
2363    pub fn LLVMGetBufferSize(MemBuf: LLVMMemoryBufferRef) -> ::libc::size_t;
2364    pub fn LLVMDisposeMemoryBuffer(MemBuf: LLVMMemoryBufferRef);
2365}
2366
2367// Core->Pass managers
2368extern "C" {
2369    pub fn LLVMCreatePassManager() -> LLVMPassManagerRef;
2370    pub fn LLVMCreateFunctionPassManagerForModule(M: LLVMModuleRef) -> LLVMPassManagerRef;
2371    pub fn LLVMCreateFunctionPassManager(MP: LLVMModuleProviderRef) -> LLVMPassManagerRef;
2372    pub fn LLVMRunPassManager(PM: LLVMPassManagerRef, M: LLVMModuleRef) -> LLVMBool;
2373    pub fn LLVMInitializeFunctionPassManager(FPM: LLVMPassManagerRef) -> LLVMBool;
2374    pub fn LLVMRunFunctionPassManager(FPM: LLVMPassManagerRef, F: LLVMValueRef) -> LLVMBool;
2375    pub fn LLVMFinalizeFunctionPassManager(FPM: LLVMPassManagerRef) -> LLVMBool;
2376    pub fn LLVMDisposePassManager(PM: LLVMPassManagerRef);
2377}
2378
2379// Core->Threading
2380extern "C" {
2381    /// Deprecated: LLVM threading is configured at compile-time with `LLVM_ENABLE_THREADS`
2382    pub fn LLVMStartMultithreaded() -> LLVMBool;
2383    /// Deprecated: LLVM threading is configured at compile-time with `LLVM_ENABLE_THREADS`
2384    pub fn LLVMStopMultithreaded();
2385    pub fn LLVMIsMultithreaded() -> LLVMBool;
2386}