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