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