Skip to main content

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