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