Skip to main content

llvm_sys/
core.rs

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