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