1 #![allow(non_camel_case_types)]
2 #![allow(non_upper_case_globals)]
3 
4 use rustc_codegen_ssa::coverageinfo::map as coverage_map;
5 
6 use super::debuginfo::{
7     DIArray, DIBasicType, DIBuilder, DICompositeType, DIDerivedType, DIDescriptor, DIEnumerator,
8     DIFile, DIFlags, DIGlobalVariableExpression, DILexicalBlock, DILocation, DINameSpace,
9     DISPFlags, DIScope, DISubprogram, DISubrange, DITemplateTypeParameter, DIType, DIVariable,
10     DebugEmissionKind,
11 };
12 
13 use libc::{c_char, c_int, c_uint, size_t};
14 use libc::{c_ulonglong, c_void};
15 
16 use std::marker::PhantomData;
17 
18 use super::RustString;
19 
20 pub type Bool = c_uint;
21 
22 pub const True: Bool = 1 as Bool;
23 pub const False: Bool = 0 as Bool;
24 
25 #[derive(Copy, Clone, PartialEq)]
26 #[repr(C)]
27 #[allow(dead_code)] // Variants constructed by C++.
28 pub enum LLVMRustResult {
29     Success,
30     Failure,
31 }
32 
33 // Rust version of the C struct with the same name in rustc_llvm/llvm-wrapper/RustWrapper.cpp.
34 #[repr(C)]
35 pub struct LLVMRustCOFFShortExport {
36     pub name: *const c_char,
37     pub ordinal_present: bool,
38     // value of `ordinal` only important when `ordinal_present` is true
39     pub ordinal: u16,
40 }
41 
42 impl LLVMRustCOFFShortExport {
new(name: *const c_char, ordinal: Option<u16>) -> LLVMRustCOFFShortExport43     pub fn new(name: *const c_char, ordinal: Option<u16>) -> LLVMRustCOFFShortExport {
44         LLVMRustCOFFShortExport {
45             name,
46             ordinal_present: ordinal.is_some(),
47             ordinal: ordinal.unwrap_or(0),
48         }
49     }
50 }
51 
52 /// Translation of LLVM's MachineTypes enum, defined in llvm\include\llvm\BinaryFormat\COFF.h.
53 ///
54 /// We include only architectures supported on Windows.
55 #[derive(Copy, Clone, PartialEq)]
56 #[repr(C)]
57 pub enum LLVMMachineType {
58     AMD64 = 0x8664,
59     I386 = 0x14c,
60     ARM64 = 0xaa64,
61     ARM = 0x01c0,
62 }
63 
64 // Consts for the LLVM CallConv type, pre-cast to usize.
65 
66 /// LLVM CallingConv::ID. Should we wrap this?
67 #[derive(Copy, Clone, PartialEq, Debug)]
68 #[repr(C)]
69 pub enum CallConv {
70     CCallConv = 0,
71     FastCallConv = 8,
72     ColdCallConv = 9,
73     X86StdcallCallConv = 64,
74     X86FastcallCallConv = 65,
75     ArmAapcsCallConv = 67,
76     Msp430Intr = 69,
77     X86_ThisCall = 70,
78     PtxKernel = 71,
79     X86_64_SysV = 78,
80     X86_64_Win64 = 79,
81     X86_VectorCall = 80,
82     X86_Intr = 83,
83     AvrNonBlockingInterrupt = 84,
84     AvrInterrupt = 85,
85     AmdGpuKernel = 91,
86 }
87 
88 /// LLVMRustLinkage
89 #[derive(Copy, Clone, PartialEq)]
90 #[repr(C)]
91 pub enum Linkage {
92     ExternalLinkage = 0,
93     AvailableExternallyLinkage = 1,
94     LinkOnceAnyLinkage = 2,
95     LinkOnceODRLinkage = 3,
96     WeakAnyLinkage = 4,
97     WeakODRLinkage = 5,
98     AppendingLinkage = 6,
99     InternalLinkage = 7,
100     PrivateLinkage = 8,
101     ExternalWeakLinkage = 9,
102     CommonLinkage = 10,
103 }
104 
105 // LLVMRustVisibility
106 #[repr(C)]
107 #[derive(Copy, Clone, PartialEq)]
108 pub enum Visibility {
109     Default = 0,
110     Hidden = 1,
111     Protected = 2,
112 }
113 
114 /// LLVMUnnamedAddr
115 #[repr(C)]
116 pub enum UnnamedAddr {
117     No,
118     Local,
119     Global,
120 }
121 
122 /// LLVMDLLStorageClass
123 #[derive(Copy, Clone)]
124 #[repr(C)]
125 pub enum DLLStorageClass {
126     #[allow(dead_code)]
127     Default = 0,
128     DllImport = 1, // Function to be imported from DLL.
129     #[allow(dead_code)]
130     DllExport = 2, // Function to be accessible from DLL.
131 }
132 
133 /// Matches LLVMRustAttribute in LLVMWrapper.h
134 /// Semantically a subset of the C++ enum llvm::Attribute::AttrKind,
135 /// though it is not ABI compatible (since it's a C++ enum)
136 #[repr(C)]
137 #[derive(Copy, Clone, Debug)]
138 pub enum Attribute {
139     AlwaysInline = 0,
140     ByVal = 1,
141     Cold = 2,
142     InlineHint = 3,
143     MinSize = 4,
144     Naked = 5,
145     NoAlias = 6,
146     NoCapture = 7,
147     NoInline = 8,
148     NonNull = 9,
149     NoRedZone = 10,
150     NoReturn = 11,
151     NoUnwind = 12,
152     OptimizeForSize = 13,
153     ReadOnly = 14,
154     SExt = 15,
155     StructRet = 16,
156     UWTable = 17,
157     ZExt = 18,
158     InReg = 19,
159     SanitizeThread = 20,
160     SanitizeAddress = 21,
161     SanitizeMemory = 22,
162     NonLazyBind = 23,
163     OptimizeNone = 24,
164     ReturnsTwice = 25,
165     ReadNone = 26,
166     InaccessibleMemOnly = 27,
167     SanitizeHWAddress = 28,
168     WillReturn = 29,
169     StackProtectReq = 30,
170     StackProtectStrong = 31,
171     StackProtect = 32,
172 }
173 
174 /// LLVMIntPredicate
175 #[derive(Copy, Clone)]
176 #[repr(C)]
177 pub enum IntPredicate {
178     IntEQ = 32,
179     IntNE = 33,
180     IntUGT = 34,
181     IntUGE = 35,
182     IntULT = 36,
183     IntULE = 37,
184     IntSGT = 38,
185     IntSGE = 39,
186     IntSLT = 40,
187     IntSLE = 41,
188 }
189 
190 impl IntPredicate {
from_generic(intpre: rustc_codegen_ssa::common::IntPredicate) -> Self191     pub fn from_generic(intpre: rustc_codegen_ssa::common::IntPredicate) -> Self {
192         match intpre {
193             rustc_codegen_ssa::common::IntPredicate::IntEQ => IntPredicate::IntEQ,
194             rustc_codegen_ssa::common::IntPredicate::IntNE => IntPredicate::IntNE,
195             rustc_codegen_ssa::common::IntPredicate::IntUGT => IntPredicate::IntUGT,
196             rustc_codegen_ssa::common::IntPredicate::IntUGE => IntPredicate::IntUGE,
197             rustc_codegen_ssa::common::IntPredicate::IntULT => IntPredicate::IntULT,
198             rustc_codegen_ssa::common::IntPredicate::IntULE => IntPredicate::IntULE,
199             rustc_codegen_ssa::common::IntPredicate::IntSGT => IntPredicate::IntSGT,
200             rustc_codegen_ssa::common::IntPredicate::IntSGE => IntPredicate::IntSGE,
201             rustc_codegen_ssa::common::IntPredicate::IntSLT => IntPredicate::IntSLT,
202             rustc_codegen_ssa::common::IntPredicate::IntSLE => IntPredicate::IntSLE,
203         }
204     }
205 }
206 
207 /// LLVMRealPredicate
208 #[derive(Copy, Clone)]
209 #[repr(C)]
210 pub enum RealPredicate {
211     RealPredicateFalse = 0,
212     RealOEQ = 1,
213     RealOGT = 2,
214     RealOGE = 3,
215     RealOLT = 4,
216     RealOLE = 5,
217     RealONE = 6,
218     RealORD = 7,
219     RealUNO = 8,
220     RealUEQ = 9,
221     RealUGT = 10,
222     RealUGE = 11,
223     RealULT = 12,
224     RealULE = 13,
225     RealUNE = 14,
226     RealPredicateTrue = 15,
227 }
228 
229 impl RealPredicate {
from_generic(realp: rustc_codegen_ssa::common::RealPredicate) -> Self230     pub fn from_generic(realp: rustc_codegen_ssa::common::RealPredicate) -> Self {
231         match realp {
232             rustc_codegen_ssa::common::RealPredicate::RealPredicateFalse => {
233                 RealPredicate::RealPredicateFalse
234             }
235             rustc_codegen_ssa::common::RealPredicate::RealOEQ => RealPredicate::RealOEQ,
236             rustc_codegen_ssa::common::RealPredicate::RealOGT => RealPredicate::RealOGT,
237             rustc_codegen_ssa::common::RealPredicate::RealOGE => RealPredicate::RealOGE,
238             rustc_codegen_ssa::common::RealPredicate::RealOLT => RealPredicate::RealOLT,
239             rustc_codegen_ssa::common::RealPredicate::RealOLE => RealPredicate::RealOLE,
240             rustc_codegen_ssa::common::RealPredicate::RealONE => RealPredicate::RealONE,
241             rustc_codegen_ssa::common::RealPredicate::RealORD => RealPredicate::RealORD,
242             rustc_codegen_ssa::common::RealPredicate::RealUNO => RealPredicate::RealUNO,
243             rustc_codegen_ssa::common::RealPredicate::RealUEQ => RealPredicate::RealUEQ,
244             rustc_codegen_ssa::common::RealPredicate::RealUGT => RealPredicate::RealUGT,
245             rustc_codegen_ssa::common::RealPredicate::RealUGE => RealPredicate::RealUGE,
246             rustc_codegen_ssa::common::RealPredicate::RealULT => RealPredicate::RealULT,
247             rustc_codegen_ssa::common::RealPredicate::RealULE => RealPredicate::RealULE,
248             rustc_codegen_ssa::common::RealPredicate::RealUNE => RealPredicate::RealUNE,
249             rustc_codegen_ssa::common::RealPredicate::RealPredicateTrue => {
250                 RealPredicate::RealPredicateTrue
251             }
252         }
253     }
254 }
255 
256 /// LLVMTypeKind
257 #[derive(Copy, Clone, PartialEq, Debug)]
258 #[repr(C)]
259 pub enum TypeKind {
260     Void = 0,
261     Half = 1,
262     Float = 2,
263     Double = 3,
264     X86_FP80 = 4,
265     FP128 = 5,
266     PPC_FP128 = 6,
267     Label = 7,
268     Integer = 8,
269     Function = 9,
270     Struct = 10,
271     Array = 11,
272     Pointer = 12,
273     Vector = 13,
274     Metadata = 14,
275     X86_MMX = 15,
276     Token = 16,
277     ScalableVector = 17,
278     BFloat = 18,
279     X86_AMX = 19,
280 }
281 
282 impl TypeKind {
to_generic(self) -> rustc_codegen_ssa::common::TypeKind283     pub fn to_generic(self) -> rustc_codegen_ssa::common::TypeKind {
284         match self {
285             TypeKind::Void => rustc_codegen_ssa::common::TypeKind::Void,
286             TypeKind::Half => rustc_codegen_ssa::common::TypeKind::Half,
287             TypeKind::Float => rustc_codegen_ssa::common::TypeKind::Float,
288             TypeKind::Double => rustc_codegen_ssa::common::TypeKind::Double,
289             TypeKind::X86_FP80 => rustc_codegen_ssa::common::TypeKind::X86_FP80,
290             TypeKind::FP128 => rustc_codegen_ssa::common::TypeKind::FP128,
291             TypeKind::PPC_FP128 => rustc_codegen_ssa::common::TypeKind::PPC_FP128,
292             TypeKind::Label => rustc_codegen_ssa::common::TypeKind::Label,
293             TypeKind::Integer => rustc_codegen_ssa::common::TypeKind::Integer,
294             TypeKind::Function => rustc_codegen_ssa::common::TypeKind::Function,
295             TypeKind::Struct => rustc_codegen_ssa::common::TypeKind::Struct,
296             TypeKind::Array => rustc_codegen_ssa::common::TypeKind::Array,
297             TypeKind::Pointer => rustc_codegen_ssa::common::TypeKind::Pointer,
298             TypeKind::Vector => rustc_codegen_ssa::common::TypeKind::Vector,
299             TypeKind::Metadata => rustc_codegen_ssa::common::TypeKind::Metadata,
300             TypeKind::X86_MMX => rustc_codegen_ssa::common::TypeKind::X86_MMX,
301             TypeKind::Token => rustc_codegen_ssa::common::TypeKind::Token,
302             TypeKind::ScalableVector => rustc_codegen_ssa::common::TypeKind::ScalableVector,
303             TypeKind::BFloat => rustc_codegen_ssa::common::TypeKind::BFloat,
304             TypeKind::X86_AMX => rustc_codegen_ssa::common::TypeKind::X86_AMX,
305         }
306     }
307 }
308 
309 /// LLVMAtomicRmwBinOp
310 #[derive(Copy, Clone)]
311 #[repr(C)]
312 pub enum AtomicRmwBinOp {
313     AtomicXchg = 0,
314     AtomicAdd = 1,
315     AtomicSub = 2,
316     AtomicAnd = 3,
317     AtomicNand = 4,
318     AtomicOr = 5,
319     AtomicXor = 6,
320     AtomicMax = 7,
321     AtomicMin = 8,
322     AtomicUMax = 9,
323     AtomicUMin = 10,
324 }
325 
326 impl AtomicRmwBinOp {
from_generic(op: rustc_codegen_ssa::common::AtomicRmwBinOp) -> Self327     pub fn from_generic(op: rustc_codegen_ssa::common::AtomicRmwBinOp) -> Self {
328         match op {
329             rustc_codegen_ssa::common::AtomicRmwBinOp::AtomicXchg => AtomicRmwBinOp::AtomicXchg,
330             rustc_codegen_ssa::common::AtomicRmwBinOp::AtomicAdd => AtomicRmwBinOp::AtomicAdd,
331             rustc_codegen_ssa::common::AtomicRmwBinOp::AtomicSub => AtomicRmwBinOp::AtomicSub,
332             rustc_codegen_ssa::common::AtomicRmwBinOp::AtomicAnd => AtomicRmwBinOp::AtomicAnd,
333             rustc_codegen_ssa::common::AtomicRmwBinOp::AtomicNand => AtomicRmwBinOp::AtomicNand,
334             rustc_codegen_ssa::common::AtomicRmwBinOp::AtomicOr => AtomicRmwBinOp::AtomicOr,
335             rustc_codegen_ssa::common::AtomicRmwBinOp::AtomicXor => AtomicRmwBinOp::AtomicXor,
336             rustc_codegen_ssa::common::AtomicRmwBinOp::AtomicMax => AtomicRmwBinOp::AtomicMax,
337             rustc_codegen_ssa::common::AtomicRmwBinOp::AtomicMin => AtomicRmwBinOp::AtomicMin,
338             rustc_codegen_ssa::common::AtomicRmwBinOp::AtomicUMax => AtomicRmwBinOp::AtomicUMax,
339             rustc_codegen_ssa::common::AtomicRmwBinOp::AtomicUMin => AtomicRmwBinOp::AtomicUMin,
340         }
341     }
342 }
343 
344 /// LLVMAtomicOrdering
345 #[derive(Copy, Clone)]
346 #[repr(C)]
347 pub enum AtomicOrdering {
348     #[allow(dead_code)]
349     NotAtomic = 0,
350     Unordered = 1,
351     Monotonic = 2,
352     // Consume = 3,  // Not specified yet.
353     Acquire = 4,
354     Release = 5,
355     AcquireRelease = 6,
356     SequentiallyConsistent = 7,
357 }
358 
359 impl AtomicOrdering {
from_generic(ao: rustc_codegen_ssa::common::AtomicOrdering) -> Self360     pub fn from_generic(ao: rustc_codegen_ssa::common::AtomicOrdering) -> Self {
361         match ao {
362             rustc_codegen_ssa::common::AtomicOrdering::NotAtomic => AtomicOrdering::NotAtomic,
363             rustc_codegen_ssa::common::AtomicOrdering::Unordered => AtomicOrdering::Unordered,
364             rustc_codegen_ssa::common::AtomicOrdering::Monotonic => AtomicOrdering::Monotonic,
365             rustc_codegen_ssa::common::AtomicOrdering::Acquire => AtomicOrdering::Acquire,
366             rustc_codegen_ssa::common::AtomicOrdering::Release => AtomicOrdering::Release,
367             rustc_codegen_ssa::common::AtomicOrdering::AcquireRelease => {
368                 AtomicOrdering::AcquireRelease
369             }
370             rustc_codegen_ssa::common::AtomicOrdering::SequentiallyConsistent => {
371                 AtomicOrdering::SequentiallyConsistent
372             }
373         }
374     }
375 }
376 
377 /// LLVMRustSynchronizationScope
378 #[derive(Copy, Clone)]
379 #[repr(C)]
380 pub enum SynchronizationScope {
381     SingleThread,
382     CrossThread,
383 }
384 
385 impl SynchronizationScope {
from_generic(sc: rustc_codegen_ssa::common::SynchronizationScope) -> Self386     pub fn from_generic(sc: rustc_codegen_ssa::common::SynchronizationScope) -> Self {
387         match sc {
388             rustc_codegen_ssa::common::SynchronizationScope::SingleThread => {
389                 SynchronizationScope::SingleThread
390             }
391             rustc_codegen_ssa::common::SynchronizationScope::CrossThread => {
392                 SynchronizationScope::CrossThread
393             }
394         }
395     }
396 }
397 
398 /// LLVMRustFileType
399 #[derive(Copy, Clone)]
400 #[repr(C)]
401 pub enum FileType {
402     AssemblyFile,
403     ObjectFile,
404 }
405 
406 /// LLVMMetadataType
407 #[derive(Copy, Clone)]
408 #[repr(C)]
409 pub enum MetadataType {
410     MD_dbg = 0,
411     MD_tbaa = 1,
412     MD_prof = 2,
413     MD_fpmath = 3,
414     MD_range = 4,
415     MD_tbaa_struct = 5,
416     MD_invariant_load = 6,
417     MD_alias_scope = 7,
418     MD_noalias = 8,
419     MD_nontemporal = 9,
420     MD_mem_parallel_loop_access = 10,
421     MD_nonnull = 11,
422     MD_type = 19,
423 }
424 
425 /// LLVMRustAsmDialect
426 #[derive(Copy, Clone)]
427 #[repr(C)]
428 pub enum AsmDialect {
429     Att,
430     Intel,
431 }
432 
433 impl AsmDialect {
from_generic(asm: rustc_ast::LlvmAsmDialect) -> Self434     pub fn from_generic(asm: rustc_ast::LlvmAsmDialect) -> Self {
435         match asm {
436             rustc_ast::LlvmAsmDialect::Att => AsmDialect::Att,
437             rustc_ast::LlvmAsmDialect::Intel => AsmDialect::Intel,
438         }
439     }
440 }
441 
442 /// LLVMRustCodeGenOptLevel
443 #[derive(Copy, Clone, PartialEq)]
444 #[repr(C)]
445 pub enum CodeGenOptLevel {
446     None,
447     Less,
448     Default,
449     Aggressive,
450 }
451 
452 /// LLVMRustPassBuilderOptLevel
453 #[repr(C)]
454 pub enum PassBuilderOptLevel {
455     O0,
456     O1,
457     O2,
458     O3,
459     Os,
460     Oz,
461 }
462 
463 /// LLVMRustOptStage
464 #[derive(PartialEq)]
465 #[repr(C)]
466 pub enum OptStage {
467     PreLinkNoLTO,
468     PreLinkThinLTO,
469     PreLinkFatLTO,
470     ThinLTO,
471     FatLTO,
472 }
473 
474 /// LLVMRustSanitizerOptions
475 #[repr(C)]
476 pub struct SanitizerOptions {
477     pub sanitize_address: bool,
478     pub sanitize_address_recover: bool,
479     pub sanitize_memory: bool,
480     pub sanitize_memory_recover: bool,
481     pub sanitize_memory_track_origins: c_int,
482     pub sanitize_thread: bool,
483     pub sanitize_hwaddress: bool,
484     pub sanitize_hwaddress_recover: bool,
485 }
486 
487 /// LLVMRelocMode
488 #[derive(Copy, Clone, PartialEq)]
489 #[repr(C)]
490 pub enum RelocModel {
491     Static,
492     PIC,
493     DynamicNoPic,
494     ROPI,
495     RWPI,
496     ROPI_RWPI,
497 }
498 
499 /// LLVMRustCodeModel
500 #[derive(Copy, Clone)]
501 #[repr(C)]
502 pub enum CodeModel {
503     Tiny,
504     Small,
505     Kernel,
506     Medium,
507     Large,
508     None,
509 }
510 
511 /// LLVMRustDiagnosticKind
512 #[derive(Copy, Clone)]
513 #[repr(C)]
514 #[allow(dead_code)] // Variants constructed by C++.
515 pub enum DiagnosticKind {
516     Other,
517     InlineAsm,
518     StackSize,
519     DebugMetadataVersion,
520     SampleProfile,
521     OptimizationRemark,
522     OptimizationRemarkMissed,
523     OptimizationRemarkAnalysis,
524     OptimizationRemarkAnalysisFPCommute,
525     OptimizationRemarkAnalysisAliasing,
526     OptimizationRemarkOther,
527     OptimizationFailure,
528     PGOProfile,
529     Linker,
530     Unsupported,
531     SrcMgr,
532 }
533 
534 /// LLVMRustDiagnosticLevel
535 #[derive(Copy, Clone)]
536 #[repr(C)]
537 #[allow(dead_code)] // Variants constructed by C++.
538 pub enum DiagnosticLevel {
539     Error,
540     Warning,
541     Note,
542     Remark,
543 }
544 
545 /// LLVMRustArchiveKind
546 #[derive(Copy, Clone)]
547 #[repr(C)]
548 pub enum ArchiveKind {
549     K_GNU,
550     K_BSD,
551     K_DARWIN,
552     K_COFF,
553 }
554 
555 /// LLVMRustPassKind
556 #[derive(Copy, Clone, PartialEq, Debug)]
557 #[repr(C)]
558 #[allow(dead_code)] // Variants constructed by C++.
559 pub enum PassKind {
560     Other,
561     Function,
562     Module,
563 }
564 
565 /// LLVMRustThinLTOData
566 extern "C" {
567     pub type ThinLTOData;
568 }
569 
570 /// LLVMRustThinLTOBuffer
571 extern "C" {
572     pub type ThinLTOBuffer;
573 }
574 
575 // LLVMRustModuleNameCallback
576 pub type ThinLTOModuleNameCallback =
577     unsafe extern "C" fn(*mut c_void, *const c_char, *const c_char);
578 
579 /// LLVMRustThinLTOModule
580 #[repr(C)]
581 pub struct ThinLTOModule {
582     pub identifier: *const c_char,
583     pub data: *const u8,
584     pub len: usize,
585 }
586 
587 /// LLVMThreadLocalMode
588 #[derive(Copy, Clone)]
589 #[repr(C)]
590 pub enum ThreadLocalMode {
591     NotThreadLocal,
592     GeneralDynamic,
593     LocalDynamic,
594     InitialExec,
595     LocalExec,
596 }
597 
598 /// LLVMRustChecksumKind
599 #[derive(Copy, Clone)]
600 #[repr(C)]
601 pub enum ChecksumKind {
602     None,
603     MD5,
604     SHA1,
605     SHA256,
606 }
607 
608 extern "C" {
609     type Opaque;
610 }
611 #[repr(C)]
612 struct InvariantOpaque<'a> {
613     _marker: PhantomData<&'a mut &'a ()>,
614     _opaque: Opaque,
615 }
616 
617 // Opaque pointer types
618 extern "C" {
619     pub type Module;
620 }
621 extern "C" {
622     pub type Context;
623 }
624 extern "C" {
625     pub type Type;
626 }
627 extern "C" {
628     pub type Value;
629 }
630 extern "C" {
631     pub type ConstantInt;
632 }
633 extern "C" {
634     pub type Metadata;
635 }
636 extern "C" {
637     pub type BasicBlock;
638 }
639 #[repr(C)]
640 pub struct Builder<'a>(InvariantOpaque<'a>);
641 extern "C" {
642     pub type MemoryBuffer;
643 }
644 #[repr(C)]
645 pub struct PassManager<'a>(InvariantOpaque<'a>);
646 extern "C" {
647     pub type PassManagerBuilder;
648 }
649 extern "C" {
650     pub type Pass;
651 }
652 extern "C" {
653     pub type TargetMachine;
654 }
655 extern "C" {
656     pub type Archive;
657 }
658 #[repr(C)]
659 pub struct ArchiveIterator<'a>(InvariantOpaque<'a>);
660 #[repr(C)]
661 pub struct ArchiveChild<'a>(InvariantOpaque<'a>);
662 extern "C" {
663     pub type Twine;
664 }
665 extern "C" {
666     pub type DiagnosticInfo;
667 }
668 extern "C" {
669     pub type SMDiagnostic;
670 }
671 #[repr(C)]
672 pub struct RustArchiveMember<'a>(InvariantOpaque<'a>);
673 #[repr(C)]
674 pub struct OperandBundleDef<'a>(InvariantOpaque<'a>);
675 #[repr(C)]
676 pub struct Linker<'a>(InvariantOpaque<'a>);
677 
678 pub type DiagnosticHandler = unsafe extern "C" fn(&DiagnosticInfo, *mut c_void);
679 pub type InlineAsmDiagHandler = unsafe extern "C" fn(&SMDiagnostic, *const c_void, c_uint);
680 
681 pub mod coverageinfo {
682     use super::coverage_map;
683 
684     /// Aligns with [llvm::coverage::CounterMappingRegion::RegionKind](https://github.com/rust-lang/llvm-project/blob/rustc/11.0-2020-10-12/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h#L206-L222)
685     #[derive(Copy, Clone, Debug)]
686     #[repr(C)]
687     pub enum RegionKind {
688         /// A CodeRegion associates some code with a counter
689         CodeRegion = 0,
690 
691         /// An ExpansionRegion represents a file expansion region that associates
692         /// a source range with the expansion of a virtual source file, such as
693         /// for a macro instantiation or #include file.
694         ExpansionRegion = 1,
695 
696         /// A SkippedRegion represents a source range with code that was skipped
697         /// by a preprocessor or similar means.
698         SkippedRegion = 2,
699 
700         /// A GapRegion is like a CodeRegion, but its count is only set as the
701         /// line execution count when its the only region in the line.
702         GapRegion = 3,
703     }
704 
705     /// This struct provides LLVM's representation of a "CoverageMappingRegion", encoded into the
706     /// coverage map, in accordance with the
707     /// [LLVM Code Coverage Mapping Format](https://github.com/rust-lang/llvm-project/blob/rustc/11.0-2020-10-12/llvm/docs/CoverageMappingFormat.rst#llvm-code-coverage-mapping-format).
708     /// The struct composes fields representing the `Counter` type and value(s) (injected counter
709     /// ID, or expression type and operands), the source file (an indirect index into a "filenames
710     /// array", encoded separately), and source location (start and end positions of the represented
711     /// code region).
712     ///
713     /// Matches LLVMRustCounterMappingRegion.
714     #[derive(Copy, Clone, Debug)]
715     #[repr(C)]
716     pub struct CounterMappingRegion {
717         /// The counter type and type-dependent counter data, if any.
718         counter: coverage_map::Counter,
719 
720         /// An indirect reference to the source filename. In the LLVM Coverage Mapping Format, the
721         /// file_id is an index into a function-specific `virtual_file_mapping` array of indexes
722         /// that, in turn, are used to look up the filename for this region.
723         file_id: u32,
724 
725         /// If the `RegionKind` is an `ExpansionRegion`, the `expanded_file_id` can be used to find
726         /// the mapping regions created as a result of macro expansion, by checking if their file id
727         /// matches the expanded file id.
728         expanded_file_id: u32,
729 
730         /// 1-based starting line of the mapping region.
731         start_line: u32,
732 
733         /// 1-based starting column of the mapping region.
734         start_col: u32,
735 
736         /// 1-based ending line of the mapping region.
737         end_line: u32,
738 
739         /// 1-based ending column of the mapping region. If the high bit is set, the current
740         /// mapping region is a gap area.
741         end_col: u32,
742 
743         kind: RegionKind,
744     }
745 
746     impl CounterMappingRegion {
code_region( counter: coverage_map::Counter, file_id: u32, start_line: u32, start_col: u32, end_line: u32, end_col: u32, ) -> Self747         crate fn code_region(
748             counter: coverage_map::Counter,
749             file_id: u32,
750             start_line: u32,
751             start_col: u32,
752             end_line: u32,
753             end_col: u32,
754         ) -> Self {
755             Self {
756                 counter,
757                 file_id,
758                 expanded_file_id: 0,
759                 start_line,
760                 start_col,
761                 end_line,
762                 end_col,
763                 kind: RegionKind::CodeRegion,
764             }
765         }
766 
767         // This function might be used in the future; the LLVM API is still evolving, as is coverage
768         // support.
769         #[allow(dead_code)]
expansion_region( file_id: u32, expanded_file_id: u32, start_line: u32, start_col: u32, end_line: u32, end_col: u32, ) -> Self770         crate fn expansion_region(
771             file_id: u32,
772             expanded_file_id: u32,
773             start_line: u32,
774             start_col: u32,
775             end_line: u32,
776             end_col: u32,
777         ) -> Self {
778             Self {
779                 counter: coverage_map::Counter::zero(),
780                 file_id,
781                 expanded_file_id,
782                 start_line,
783                 start_col,
784                 end_line,
785                 end_col,
786                 kind: RegionKind::ExpansionRegion,
787             }
788         }
789 
790         // This function might be used in the future; the LLVM API is still evolving, as is coverage
791         // support.
792         #[allow(dead_code)]
skipped_region( file_id: u32, start_line: u32, start_col: u32, end_line: u32, end_col: u32, ) -> Self793         crate fn skipped_region(
794             file_id: u32,
795             start_line: u32,
796             start_col: u32,
797             end_line: u32,
798             end_col: u32,
799         ) -> Self {
800             Self {
801                 counter: coverage_map::Counter::zero(),
802                 file_id,
803                 expanded_file_id: 0,
804                 start_line,
805                 start_col,
806                 end_line,
807                 end_col,
808                 kind: RegionKind::SkippedRegion,
809             }
810         }
811 
812         // This function might be used in the future; the LLVM API is still evolving, as is coverage
813         // support.
814         #[allow(dead_code)]
gap_region( counter: coverage_map::Counter, file_id: u32, start_line: u32, start_col: u32, end_line: u32, end_col: u32, ) -> Self815         crate fn gap_region(
816             counter: coverage_map::Counter,
817             file_id: u32,
818             start_line: u32,
819             start_col: u32,
820             end_line: u32,
821             end_col: u32,
822         ) -> Self {
823             Self {
824                 counter,
825                 file_id,
826                 expanded_file_id: 0,
827                 start_line,
828                 start_col,
829                 end_line,
830                 end_col: (1_u32 << 31) | end_col,
831                 kind: RegionKind::GapRegion,
832             }
833         }
834     }
835 }
836 
837 pub mod debuginfo {
838     use super::{InvariantOpaque, Metadata};
839     use bitflags::bitflags;
840 
841     #[repr(C)]
842     pub struct DIBuilder<'a>(InvariantOpaque<'a>);
843 
844     pub type DIDescriptor = Metadata;
845     pub type DILocation = Metadata;
846     pub type DIScope = DIDescriptor;
847     pub type DIFile = DIScope;
848     pub type DILexicalBlock = DIScope;
849     pub type DISubprogram = DIScope;
850     pub type DINameSpace = DIScope;
851     pub type DIType = DIDescriptor;
852     pub type DIBasicType = DIType;
853     pub type DIDerivedType = DIType;
854     pub type DICompositeType = DIDerivedType;
855     pub type DIVariable = DIDescriptor;
856     pub type DIGlobalVariableExpression = DIDescriptor;
857     pub type DIArray = DIDescriptor;
858     pub type DISubrange = DIDescriptor;
859     pub type DIEnumerator = DIDescriptor;
860     pub type DITemplateTypeParameter = DIDescriptor;
861 
862     // These values **must** match with LLVMRustDIFlags!!
863     bitflags! {
864         #[repr(transparent)]
865         #[derive(Default)]
866         pub struct DIFlags: u32 {
867             const FlagZero                = 0;
868             const FlagPrivate             = 1;
869             const FlagProtected           = 2;
870             const FlagPublic              = 3;
871             const FlagFwdDecl             = (1 << 2);
872             const FlagAppleBlock          = (1 << 3);
873             const FlagBlockByrefStruct    = (1 << 4);
874             const FlagVirtual             = (1 << 5);
875             const FlagArtificial          = (1 << 6);
876             const FlagExplicit            = (1 << 7);
877             const FlagPrototyped          = (1 << 8);
878             const FlagObjcClassComplete   = (1 << 9);
879             const FlagObjectPointer       = (1 << 10);
880             const FlagVector              = (1 << 11);
881             const FlagStaticMember        = (1 << 12);
882             const FlagLValueReference     = (1 << 13);
883             const FlagRValueReference     = (1 << 14);
884             const FlagExternalTypeRef     = (1 << 15);
885             const FlagIntroducedVirtual   = (1 << 18);
886             const FlagBitField            = (1 << 19);
887             const FlagNoReturn            = (1 << 20);
888         }
889     }
890 
891     // These values **must** match with LLVMRustDISPFlags!!
892     bitflags! {
893         #[repr(transparent)]
894         #[derive(Default)]
895         pub struct DISPFlags: u32 {
896             const SPFlagZero              = 0;
897             const SPFlagVirtual           = 1;
898             const SPFlagPureVirtual       = 2;
899             const SPFlagLocalToUnit       = (1 << 2);
900             const SPFlagDefinition        = (1 << 3);
901             const SPFlagOptimized         = (1 << 4);
902             const SPFlagMainSubprogram    = (1 << 5);
903         }
904     }
905 
906     /// LLVMRustDebugEmissionKind
907     #[derive(Copy, Clone)]
908     #[repr(C)]
909     pub enum DebugEmissionKind {
910         NoDebug,
911         FullDebug,
912         LineTablesOnly,
913     }
914 
915     impl DebugEmissionKind {
from_generic(kind: rustc_session::config::DebugInfo) -> Self916         pub fn from_generic(kind: rustc_session::config::DebugInfo) -> Self {
917             use rustc_session::config::DebugInfo;
918             match kind {
919                 DebugInfo::None => DebugEmissionKind::NoDebug,
920                 DebugInfo::Limited => DebugEmissionKind::LineTablesOnly,
921                 DebugInfo::Full => DebugEmissionKind::FullDebug,
922             }
923         }
924     }
925 }
926 
927 extern "C" {
928     pub type ModuleBuffer;
929 }
930 
931 pub type SelfProfileBeforePassCallback =
932     unsafe extern "C" fn(*mut c_void, *const c_char, *const c_char);
933 pub type SelfProfileAfterPassCallback = unsafe extern "C" fn(*mut c_void);
934 
935 extern "C" {
LLVMRustInstallFatalErrorHandler()936     pub fn LLVMRustInstallFatalErrorHandler();
937 
938     // Create and destroy contexts.
LLVMRustContextCreate(shouldDiscardNames: bool) -> &'static mut Context939     pub fn LLVMRustContextCreate(shouldDiscardNames: bool) -> &'static mut Context;
LLVMContextDispose(C: &'static mut Context)940     pub fn LLVMContextDispose(C: &'static mut Context);
LLVMGetMDKindIDInContext(C: &Context, Name: *const c_char, SLen: c_uint) -> c_uint941     pub fn LLVMGetMDKindIDInContext(C: &Context, Name: *const c_char, SLen: c_uint) -> c_uint;
942 
943     // Create modules.
LLVMModuleCreateWithNameInContext(ModuleID: *const c_char, C: &Context) -> &Module944     pub fn LLVMModuleCreateWithNameInContext(ModuleID: *const c_char, C: &Context) -> &Module;
LLVMGetModuleContext(M: &Module) -> &Context945     pub fn LLVMGetModuleContext(M: &Module) -> &Context;
LLVMCloneModule(M: &Module) -> &Module946     pub fn LLVMCloneModule(M: &Module) -> &Module;
947 
948     /// Data layout. See Module::getDataLayout.
LLVMGetDataLayoutStr(M: &Module) -> *const c_char949     pub fn LLVMGetDataLayoutStr(M: &Module) -> *const c_char;
LLVMSetDataLayout(M: &Module, Triple: *const c_char)950     pub fn LLVMSetDataLayout(M: &Module, Triple: *const c_char);
951 
952     /// See Module::setModuleInlineAsm.
LLVMSetModuleInlineAsm2(M: &Module, Asm: *const c_char, AsmLen: size_t)953     pub fn LLVMSetModuleInlineAsm2(M: &Module, Asm: *const c_char, AsmLen: size_t);
LLVMRustAppendModuleInlineAsm(M: &Module, Asm: *const c_char, AsmLen: size_t)954     pub fn LLVMRustAppendModuleInlineAsm(M: &Module, Asm: *const c_char, AsmLen: size_t);
955 
956     /// See llvm::LLVMTypeKind::getTypeID.
LLVMRustGetTypeKind(Ty: &Type) -> TypeKind957     pub fn LLVMRustGetTypeKind(Ty: &Type) -> TypeKind;
958 
959     // Operations on integer types
LLVMInt1TypeInContext(C: &Context) -> &Type960     pub fn LLVMInt1TypeInContext(C: &Context) -> &Type;
LLVMInt8TypeInContext(C: &Context) -> &Type961     pub fn LLVMInt8TypeInContext(C: &Context) -> &Type;
LLVMInt16TypeInContext(C: &Context) -> &Type962     pub fn LLVMInt16TypeInContext(C: &Context) -> &Type;
LLVMInt32TypeInContext(C: &Context) -> &Type963     pub fn LLVMInt32TypeInContext(C: &Context) -> &Type;
LLVMInt64TypeInContext(C: &Context) -> &Type964     pub fn LLVMInt64TypeInContext(C: &Context) -> &Type;
LLVMIntTypeInContext(C: &Context, NumBits: c_uint) -> &Type965     pub fn LLVMIntTypeInContext(C: &Context, NumBits: c_uint) -> &Type;
966 
LLVMGetIntTypeWidth(IntegerTy: &Type) -> c_uint967     pub fn LLVMGetIntTypeWidth(IntegerTy: &Type) -> c_uint;
968 
969     // Operations on real types
LLVMFloatTypeInContext(C: &Context) -> &Type970     pub fn LLVMFloatTypeInContext(C: &Context) -> &Type;
LLVMDoubleTypeInContext(C: &Context) -> &Type971     pub fn LLVMDoubleTypeInContext(C: &Context) -> &Type;
972 
973     // Operations on function types
LLVMFunctionType( ReturnType: &'a Type, ParamTypes: *const &'a Type, ParamCount: c_uint, IsVarArg: Bool, ) -> &'a Type974     pub fn LLVMFunctionType(
975         ReturnType: &'a Type,
976         ParamTypes: *const &'a Type,
977         ParamCount: c_uint,
978         IsVarArg: Bool,
979     ) -> &'a Type;
LLVMCountParamTypes(FunctionTy: &Type) -> c_uint980     pub fn LLVMCountParamTypes(FunctionTy: &Type) -> c_uint;
LLVMGetParamTypes(FunctionTy: &'a Type, Dest: *mut &'a Type)981     pub fn LLVMGetParamTypes(FunctionTy: &'a Type, Dest: *mut &'a Type);
982 
983     // Operations on struct types
LLVMStructTypeInContext( C: &'a Context, ElementTypes: *const &'a Type, ElementCount: c_uint, Packed: Bool, ) -> &'a Type984     pub fn LLVMStructTypeInContext(
985         C: &'a Context,
986         ElementTypes: *const &'a Type,
987         ElementCount: c_uint,
988         Packed: Bool,
989     ) -> &'a Type;
990 
991     // Operations on array, pointer, and vector types (sequence types)
LLVMRustArrayType(ElementType: &Type, ElementCount: u64) -> &Type992     pub fn LLVMRustArrayType(ElementType: &Type, ElementCount: u64) -> &Type;
LLVMPointerType(ElementType: &Type, AddressSpace: c_uint) -> &Type993     pub fn LLVMPointerType(ElementType: &Type, AddressSpace: c_uint) -> &Type;
LLVMVectorType(ElementType: &Type, ElementCount: c_uint) -> &Type994     pub fn LLVMVectorType(ElementType: &Type, ElementCount: c_uint) -> &Type;
995 
LLVMGetElementType(Ty: &Type) -> &Type996     pub fn LLVMGetElementType(Ty: &Type) -> &Type;
LLVMGetVectorSize(VectorTy: &Type) -> c_uint997     pub fn LLVMGetVectorSize(VectorTy: &Type) -> c_uint;
998 
999     // Operations on other types
LLVMVoidTypeInContext(C: &Context) -> &Type1000     pub fn LLVMVoidTypeInContext(C: &Context) -> &Type;
LLVMRustMetadataTypeInContext(C: &Context) -> &Type1001     pub fn LLVMRustMetadataTypeInContext(C: &Context) -> &Type;
1002 
1003     // Operations on all values
LLVMTypeOf(Val: &Value) -> &Type1004     pub fn LLVMTypeOf(Val: &Value) -> &Type;
LLVMGetValueName2(Val: &Value, Length: *mut size_t) -> *const c_char1005     pub fn LLVMGetValueName2(Val: &Value, Length: *mut size_t) -> *const c_char;
LLVMSetValueName2(Val: &Value, Name: *const c_char, NameLen: size_t)1006     pub fn LLVMSetValueName2(Val: &Value, Name: *const c_char, NameLen: size_t);
LLVMReplaceAllUsesWith(OldVal: &'a Value, NewVal: &'a Value)1007     pub fn LLVMReplaceAllUsesWith(OldVal: &'a Value, NewVal: &'a Value);
LLVMSetMetadata(Val: &'a Value, KindID: c_uint, Node: &'a Value)1008     pub fn LLVMSetMetadata(Val: &'a Value, KindID: c_uint, Node: &'a Value);
LLVMGlobalSetMetadata(Val: &'a Value, KindID: c_uint, Metadata: &'a Metadata)1009     pub fn LLVMGlobalSetMetadata(Val: &'a Value, KindID: c_uint, Metadata: &'a Metadata);
LLVMValueAsMetadata(Node: &'a Value) -> &Metadata1010     pub fn LLVMValueAsMetadata(Node: &'a Value) -> &Metadata;
1011 
1012     // Operations on constants of any type
LLVMConstNull(Ty: &Type) -> &Value1013     pub fn LLVMConstNull(Ty: &Type) -> &Value;
LLVMGetUndef(Ty: &Type) -> &Value1014     pub fn LLVMGetUndef(Ty: &Type) -> &Value;
1015 
1016     // Operations on metadata
LLVMMDStringInContext(C: &Context, Str: *const c_char, SLen: c_uint) -> &Value1017     pub fn LLVMMDStringInContext(C: &Context, Str: *const c_char, SLen: c_uint) -> &Value;
LLVMMDNodeInContext(C: &'a Context, Vals: *const &'a Value, Count: c_uint) -> &'a Value1018     pub fn LLVMMDNodeInContext(C: &'a Context, Vals: *const &'a Value, Count: c_uint) -> &'a Value;
LLVMAddNamedMetadataOperand(M: &'a Module, Name: *const c_char, Val: &'a Value)1019     pub fn LLVMAddNamedMetadataOperand(M: &'a Module, Name: *const c_char, Val: &'a Value);
1020 
1021     // Operations on scalar constants
LLVMConstInt(IntTy: &Type, N: c_ulonglong, SignExtend: Bool) -> &Value1022     pub fn LLVMConstInt(IntTy: &Type, N: c_ulonglong, SignExtend: Bool) -> &Value;
LLVMConstIntOfArbitraryPrecision(IntTy: &Type, Wn: c_uint, Ws: *const u64) -> &Value1023     pub fn LLVMConstIntOfArbitraryPrecision(IntTy: &Type, Wn: c_uint, Ws: *const u64) -> &Value;
LLVMConstReal(RealTy: &Type, N: f64) -> &Value1024     pub fn LLVMConstReal(RealTy: &Type, N: f64) -> &Value;
LLVMConstIntGetZExtValue(ConstantVal: &ConstantInt) -> c_ulonglong1025     pub fn LLVMConstIntGetZExtValue(ConstantVal: &ConstantInt) -> c_ulonglong;
LLVMRustConstInt128Get( ConstantVal: &ConstantInt, SExt: bool, high: &mut u64, low: &mut u64, ) -> bool1026     pub fn LLVMRustConstInt128Get(
1027         ConstantVal: &ConstantInt,
1028         SExt: bool,
1029         high: &mut u64,
1030         low: &mut u64,
1031     ) -> bool;
1032 
1033     // Operations on composite constants
LLVMConstStringInContext( C: &Context, Str: *const c_char, Length: c_uint, DontNullTerminate: Bool, ) -> &Value1034     pub fn LLVMConstStringInContext(
1035         C: &Context,
1036         Str: *const c_char,
1037         Length: c_uint,
1038         DontNullTerminate: Bool,
1039     ) -> &Value;
LLVMConstStructInContext( C: &'a Context, ConstantVals: *const &'a Value, Count: c_uint, Packed: Bool, ) -> &'a Value1040     pub fn LLVMConstStructInContext(
1041         C: &'a Context,
1042         ConstantVals: *const &'a Value,
1043         Count: c_uint,
1044         Packed: Bool,
1045     ) -> &'a Value;
1046 
LLVMConstArray( ElementTy: &'a Type, ConstantVals: *const &'a Value, Length: c_uint, ) -> &'a Value1047     pub fn LLVMConstArray(
1048         ElementTy: &'a Type,
1049         ConstantVals: *const &'a Value,
1050         Length: c_uint,
1051     ) -> &'a Value;
LLVMConstVector(ScalarConstantVals: *const &Value, Size: c_uint) -> &Value1052     pub fn LLVMConstVector(ScalarConstantVals: *const &Value, Size: c_uint) -> &Value;
1053 
1054     // Constant expressions
LLVMRustConstInBoundsGEP2( ty: &'a Type, ConstantVal: &'a Value, ConstantIndices: *const &'a Value, NumIndices: c_uint, ) -> &'a Value1055     pub fn LLVMRustConstInBoundsGEP2(
1056         ty: &'a Type,
1057         ConstantVal: &'a Value,
1058         ConstantIndices: *const &'a Value,
1059         NumIndices: c_uint,
1060     ) -> &'a Value;
LLVMConstZExt(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value1061     pub fn LLVMConstZExt(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
LLVMConstPtrToInt(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value1062     pub fn LLVMConstPtrToInt(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
LLVMConstIntToPtr(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value1063     pub fn LLVMConstIntToPtr(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
LLVMConstBitCast(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value1064     pub fn LLVMConstBitCast(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
LLVMConstPointerCast(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value1065     pub fn LLVMConstPointerCast(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
LLVMConstExtractValue( AggConstant: &Value, IdxList: *const c_uint, NumIdx: c_uint, ) -> &Value1066     pub fn LLVMConstExtractValue(
1067         AggConstant: &Value,
1068         IdxList: *const c_uint,
1069         NumIdx: c_uint,
1070     ) -> &Value;
1071 
1072     // Operations on global variables, functions, and aliases (globals)
LLVMIsDeclaration(Global: &Value) -> Bool1073     pub fn LLVMIsDeclaration(Global: &Value) -> Bool;
LLVMRustGetLinkage(Global: &Value) -> Linkage1074     pub fn LLVMRustGetLinkage(Global: &Value) -> Linkage;
LLVMRustSetLinkage(Global: &Value, RustLinkage: Linkage)1075     pub fn LLVMRustSetLinkage(Global: &Value, RustLinkage: Linkage);
LLVMSetSection(Global: &Value, Section: *const c_char)1076     pub fn LLVMSetSection(Global: &Value, Section: *const c_char);
LLVMRustGetVisibility(Global: &Value) -> Visibility1077     pub fn LLVMRustGetVisibility(Global: &Value) -> Visibility;
LLVMRustSetVisibility(Global: &Value, Viz: Visibility)1078     pub fn LLVMRustSetVisibility(Global: &Value, Viz: Visibility);
LLVMRustSetDSOLocal(Global: &Value, is_dso_local: bool)1079     pub fn LLVMRustSetDSOLocal(Global: &Value, is_dso_local: bool);
LLVMGetAlignment(Global: &Value) -> c_uint1080     pub fn LLVMGetAlignment(Global: &Value) -> c_uint;
LLVMSetAlignment(Global: &Value, Bytes: c_uint)1081     pub fn LLVMSetAlignment(Global: &Value, Bytes: c_uint);
LLVMSetDLLStorageClass(V: &Value, C: DLLStorageClass)1082     pub fn LLVMSetDLLStorageClass(V: &Value, C: DLLStorageClass);
1083 
1084     // Operations on global variables
LLVMIsAGlobalVariable(GlobalVar: &Value) -> Option<&Value>1085     pub fn LLVMIsAGlobalVariable(GlobalVar: &Value) -> Option<&Value>;
LLVMAddGlobal(M: &'a Module, Ty: &'a Type, Name: *const c_char) -> &'a Value1086     pub fn LLVMAddGlobal(M: &'a Module, Ty: &'a Type, Name: *const c_char) -> &'a Value;
LLVMGetNamedGlobal(M: &Module, Name: *const c_char) -> Option<&Value>1087     pub fn LLVMGetNamedGlobal(M: &Module, Name: *const c_char) -> Option<&Value>;
LLVMRustGetOrInsertGlobal( M: &'a Module, Name: *const c_char, NameLen: size_t, T: &'a Type, ) -> &'a Value1088     pub fn LLVMRustGetOrInsertGlobal(
1089         M: &'a Module,
1090         Name: *const c_char,
1091         NameLen: size_t,
1092         T: &'a Type,
1093     ) -> &'a Value;
LLVMRustInsertPrivateGlobal(M: &'a Module, T: &'a Type) -> &'a Value1094     pub fn LLVMRustInsertPrivateGlobal(M: &'a Module, T: &'a Type) -> &'a Value;
LLVMGetFirstGlobal(M: &Module) -> Option<&Value>1095     pub fn LLVMGetFirstGlobal(M: &Module) -> Option<&Value>;
LLVMGetNextGlobal(GlobalVar: &Value) -> Option<&Value>1096     pub fn LLVMGetNextGlobal(GlobalVar: &Value) -> Option<&Value>;
LLVMDeleteGlobal(GlobalVar: &Value)1097     pub fn LLVMDeleteGlobal(GlobalVar: &Value);
LLVMGetInitializer(GlobalVar: &Value) -> Option<&Value>1098     pub fn LLVMGetInitializer(GlobalVar: &Value) -> Option<&Value>;
LLVMSetInitializer(GlobalVar: &'a Value, ConstantVal: &'a Value)1099     pub fn LLVMSetInitializer(GlobalVar: &'a Value, ConstantVal: &'a Value);
LLVMIsThreadLocal(GlobalVar: &Value) -> Bool1100     pub fn LLVMIsThreadLocal(GlobalVar: &Value) -> Bool;
LLVMSetThreadLocal(GlobalVar: &Value, IsThreadLocal: Bool)1101     pub fn LLVMSetThreadLocal(GlobalVar: &Value, IsThreadLocal: Bool);
LLVMSetThreadLocalMode(GlobalVar: &Value, Mode: ThreadLocalMode)1102     pub fn LLVMSetThreadLocalMode(GlobalVar: &Value, Mode: ThreadLocalMode);
LLVMIsGlobalConstant(GlobalVar: &Value) -> Bool1103     pub fn LLVMIsGlobalConstant(GlobalVar: &Value) -> Bool;
LLVMSetGlobalConstant(GlobalVar: &Value, IsConstant: Bool)1104     pub fn LLVMSetGlobalConstant(GlobalVar: &Value, IsConstant: Bool);
LLVMRustGetNamedValue( M: &Module, Name: *const c_char, NameLen: size_t, ) -> Option<&Value>1105     pub fn LLVMRustGetNamedValue(
1106         M: &Module,
1107         Name: *const c_char,
1108         NameLen: size_t,
1109     ) -> Option<&Value>;
LLVMSetTailCall(CallInst: &Value, IsTailCall: Bool)1110     pub fn LLVMSetTailCall(CallInst: &Value, IsTailCall: Bool);
1111 
1112     // Operations on functions
LLVMRustGetOrInsertFunction( M: &'a Module, Name: *const c_char, NameLen: size_t, FunctionTy: &'a Type, ) -> &'a Value1113     pub fn LLVMRustGetOrInsertFunction(
1114         M: &'a Module,
1115         Name: *const c_char,
1116         NameLen: size_t,
1117         FunctionTy: &'a Type,
1118     ) -> &'a Value;
LLVMSetFunctionCallConv(Fn: &Value, CC: c_uint)1119     pub fn LLVMSetFunctionCallConv(Fn: &Value, CC: c_uint);
LLVMRustAddAlignmentAttr(Fn: &Value, index: c_uint, bytes: u32)1120     pub fn LLVMRustAddAlignmentAttr(Fn: &Value, index: c_uint, bytes: u32);
LLVMRustAddDereferenceableAttr(Fn: &Value, index: c_uint, bytes: u64)1121     pub fn LLVMRustAddDereferenceableAttr(Fn: &Value, index: c_uint, bytes: u64);
LLVMRustAddDereferenceableOrNullAttr(Fn: &Value, index: c_uint, bytes: u64)1122     pub fn LLVMRustAddDereferenceableOrNullAttr(Fn: &Value, index: c_uint, bytes: u64);
LLVMRustAddByValAttr(Fn: &Value, index: c_uint, ty: &Type)1123     pub fn LLVMRustAddByValAttr(Fn: &Value, index: c_uint, ty: &Type);
LLVMRustAddStructRetAttr(Fn: &Value, index: c_uint, ty: &Type)1124     pub fn LLVMRustAddStructRetAttr(Fn: &Value, index: c_uint, ty: &Type);
LLVMRustAddFunctionAttribute(Fn: &Value, index: c_uint, attr: Attribute)1125     pub fn LLVMRustAddFunctionAttribute(Fn: &Value, index: c_uint, attr: Attribute);
LLVMRustAddFunctionAttrStringValue( Fn: &Value, index: c_uint, Name: *const c_char, Value: *const c_char, )1126     pub fn LLVMRustAddFunctionAttrStringValue(
1127         Fn: &Value,
1128         index: c_uint,
1129         Name: *const c_char,
1130         Value: *const c_char,
1131     );
LLVMRustRemoveFunctionAttributes(Fn: &Value, index: c_uint, attr: Attribute)1132     pub fn LLVMRustRemoveFunctionAttributes(Fn: &Value, index: c_uint, attr: Attribute);
1133 
1134     // Operations on parameters
LLVMIsAArgument(Val: &Value) -> Option<&Value>1135     pub fn LLVMIsAArgument(Val: &Value) -> Option<&Value>;
LLVMCountParams(Fn: &Value) -> c_uint1136     pub fn LLVMCountParams(Fn: &Value) -> c_uint;
LLVMGetParam(Fn: &Value, Index: c_uint) -> &Value1137     pub fn LLVMGetParam(Fn: &Value, Index: c_uint) -> &Value;
1138 
1139     // Operations on basic blocks
LLVMGetBasicBlockParent(BB: &BasicBlock) -> &Value1140     pub fn LLVMGetBasicBlockParent(BB: &BasicBlock) -> &Value;
LLVMAppendBasicBlockInContext( C: &'a Context, Fn: &'a Value, Name: *const c_char, ) -> &'a BasicBlock1141     pub fn LLVMAppendBasicBlockInContext(
1142         C: &'a Context,
1143         Fn: &'a Value,
1144         Name: *const c_char,
1145     ) -> &'a BasicBlock;
1146 
1147     // Operations on instructions
LLVMIsAInstruction(Val: &Value) -> Option<&Value>1148     pub fn LLVMIsAInstruction(Val: &Value) -> Option<&Value>;
LLVMGetFirstBasicBlock(Fn: &Value) -> &BasicBlock1149     pub fn LLVMGetFirstBasicBlock(Fn: &Value) -> &BasicBlock;
1150 
1151     // Operations on call sites
LLVMSetInstructionCallConv(Instr: &Value, CC: c_uint)1152     pub fn LLVMSetInstructionCallConv(Instr: &Value, CC: c_uint);
LLVMRustAddCallSiteAttribute(Instr: &Value, index: c_uint, attr: Attribute)1153     pub fn LLVMRustAddCallSiteAttribute(Instr: &Value, index: c_uint, attr: Attribute);
LLVMRustAddCallSiteAttrString(Instr: &Value, index: c_uint, Name: *const c_char)1154     pub fn LLVMRustAddCallSiteAttrString(Instr: &Value, index: c_uint, Name: *const c_char);
LLVMRustAddAlignmentCallSiteAttr(Instr: &Value, index: c_uint, bytes: u32)1155     pub fn LLVMRustAddAlignmentCallSiteAttr(Instr: &Value, index: c_uint, bytes: u32);
LLVMRustAddDereferenceableCallSiteAttr(Instr: &Value, index: c_uint, bytes: u64)1156     pub fn LLVMRustAddDereferenceableCallSiteAttr(Instr: &Value, index: c_uint, bytes: u64);
LLVMRustAddDereferenceableOrNullCallSiteAttr(Instr: &Value, index: c_uint, bytes: u64)1157     pub fn LLVMRustAddDereferenceableOrNullCallSiteAttr(Instr: &Value, index: c_uint, bytes: u64);
LLVMRustAddByValCallSiteAttr(Instr: &Value, index: c_uint, ty: &Type)1158     pub fn LLVMRustAddByValCallSiteAttr(Instr: &Value, index: c_uint, ty: &Type);
LLVMRustAddStructRetCallSiteAttr(Instr: &Value, index: c_uint, ty: &Type)1159     pub fn LLVMRustAddStructRetCallSiteAttr(Instr: &Value, index: c_uint, ty: &Type);
1160 
1161     // Operations on load/store instructions (only)
LLVMSetVolatile(MemoryAccessInst: &Value, volatile: Bool)1162     pub fn LLVMSetVolatile(MemoryAccessInst: &Value, volatile: Bool);
1163 
1164     // Operations on phi nodes
LLVMAddIncoming( PhiNode: &'a Value, IncomingValues: *const &'a Value, IncomingBlocks: *const &'a BasicBlock, Count: c_uint, )1165     pub fn LLVMAddIncoming(
1166         PhiNode: &'a Value,
1167         IncomingValues: *const &'a Value,
1168         IncomingBlocks: *const &'a BasicBlock,
1169         Count: c_uint,
1170     );
1171 
1172     // Instruction builders
LLVMCreateBuilderInContext(C: &'a Context) -> &'a mut Builder<'a>1173     pub fn LLVMCreateBuilderInContext(C: &'a Context) -> &'a mut Builder<'a>;
LLVMPositionBuilderAtEnd(Builder: &Builder<'a>, Block: &'a BasicBlock)1174     pub fn LLVMPositionBuilderAtEnd(Builder: &Builder<'a>, Block: &'a BasicBlock);
LLVMGetInsertBlock(Builder: &Builder<'a>) -> &'a BasicBlock1175     pub fn LLVMGetInsertBlock(Builder: &Builder<'a>) -> &'a BasicBlock;
LLVMDisposeBuilder(Builder: &'a mut Builder<'a>)1176     pub fn LLVMDisposeBuilder(Builder: &'a mut Builder<'a>);
1177 
1178     // Metadata
LLVMSetCurrentDebugLocation(Builder: &Builder<'a>, L: &'a Value)1179     pub fn LLVMSetCurrentDebugLocation(Builder: &Builder<'a>, L: &'a Value);
1180 
1181     // Terminators
LLVMBuildRetVoid(B: &Builder<'a>) -> &'a Value1182     pub fn LLVMBuildRetVoid(B: &Builder<'a>) -> &'a Value;
LLVMBuildRet(B: &Builder<'a>, V: &'a Value) -> &'a Value1183     pub fn LLVMBuildRet(B: &Builder<'a>, V: &'a Value) -> &'a Value;
LLVMBuildBr(B: &Builder<'a>, Dest: &'a BasicBlock) -> &'a Value1184     pub fn LLVMBuildBr(B: &Builder<'a>, Dest: &'a BasicBlock) -> &'a Value;
LLVMBuildCondBr( B: &Builder<'a>, If: &'a Value, Then: &'a BasicBlock, Else: &'a BasicBlock, ) -> &'a Value1185     pub fn LLVMBuildCondBr(
1186         B: &Builder<'a>,
1187         If: &'a Value,
1188         Then: &'a BasicBlock,
1189         Else: &'a BasicBlock,
1190     ) -> &'a Value;
LLVMBuildSwitch( B: &Builder<'a>, V: &'a Value, Else: &'a BasicBlock, NumCases: c_uint, ) -> &'a Value1191     pub fn LLVMBuildSwitch(
1192         B: &Builder<'a>,
1193         V: &'a Value,
1194         Else: &'a BasicBlock,
1195         NumCases: c_uint,
1196     ) -> &'a Value;
LLVMRustBuildInvoke( B: &Builder<'a>, Ty: &'a Type, Fn: &'a Value, Args: *const &'a Value, NumArgs: c_uint, Then: &'a BasicBlock, Catch: &'a BasicBlock, Bundle: Option<&OperandBundleDef<'a>>, Name: *const c_char, ) -> &'a Value1197     pub fn LLVMRustBuildInvoke(
1198         B: &Builder<'a>,
1199         Ty: &'a Type,
1200         Fn: &'a Value,
1201         Args: *const &'a Value,
1202         NumArgs: c_uint,
1203         Then: &'a BasicBlock,
1204         Catch: &'a BasicBlock,
1205         Bundle: Option<&OperandBundleDef<'a>>,
1206         Name: *const c_char,
1207     ) -> &'a Value;
LLVMBuildLandingPad( B: &Builder<'a>, Ty: &'a Type, PersFn: Option<&'a Value>, NumClauses: c_uint, Name: *const c_char, ) -> &'a Value1208     pub fn LLVMBuildLandingPad(
1209         B: &Builder<'a>,
1210         Ty: &'a Type,
1211         PersFn: Option<&'a Value>,
1212         NumClauses: c_uint,
1213         Name: *const c_char,
1214     ) -> &'a Value;
LLVMBuildResume(B: &Builder<'a>, Exn: &'a Value) -> &'a Value1215     pub fn LLVMBuildResume(B: &Builder<'a>, Exn: &'a Value) -> &'a Value;
LLVMBuildUnreachable(B: &Builder<'a>) -> &'a Value1216     pub fn LLVMBuildUnreachable(B: &Builder<'a>) -> &'a Value;
1217 
LLVMRustBuildCleanupPad( B: &Builder<'a>, ParentPad: Option<&'a Value>, ArgCnt: c_uint, Args: *const &'a Value, Name: *const c_char, ) -> Option<&'a Value>1218     pub fn LLVMRustBuildCleanupPad(
1219         B: &Builder<'a>,
1220         ParentPad: Option<&'a Value>,
1221         ArgCnt: c_uint,
1222         Args: *const &'a Value,
1223         Name: *const c_char,
1224     ) -> Option<&'a Value>;
LLVMRustBuildCleanupRet( B: &Builder<'a>, CleanupPad: &'a Value, UnwindBB: Option<&'a BasicBlock>, ) -> Option<&'a Value>1225     pub fn LLVMRustBuildCleanupRet(
1226         B: &Builder<'a>,
1227         CleanupPad: &'a Value,
1228         UnwindBB: Option<&'a BasicBlock>,
1229     ) -> Option<&'a Value>;
LLVMRustBuildCatchPad( B: &Builder<'a>, ParentPad: &'a Value, ArgCnt: c_uint, Args: *const &'a Value, Name: *const c_char, ) -> Option<&'a Value>1230     pub fn LLVMRustBuildCatchPad(
1231         B: &Builder<'a>,
1232         ParentPad: &'a Value,
1233         ArgCnt: c_uint,
1234         Args: *const &'a Value,
1235         Name: *const c_char,
1236     ) -> Option<&'a Value>;
LLVMRustBuildCatchRet( B: &Builder<'a>, Pad: &'a Value, BB: &'a BasicBlock, ) -> Option<&'a Value>1237     pub fn LLVMRustBuildCatchRet(
1238         B: &Builder<'a>,
1239         Pad: &'a Value,
1240         BB: &'a BasicBlock,
1241     ) -> Option<&'a Value>;
LLVMRustBuildCatchSwitch( Builder: &Builder<'a>, ParentPad: Option<&'a Value>, BB: Option<&'a BasicBlock>, NumHandlers: c_uint, Name: *const c_char, ) -> Option<&'a Value>1242     pub fn LLVMRustBuildCatchSwitch(
1243         Builder: &Builder<'a>,
1244         ParentPad: Option<&'a Value>,
1245         BB: Option<&'a BasicBlock>,
1246         NumHandlers: c_uint,
1247         Name: *const c_char,
1248     ) -> Option<&'a Value>;
LLVMRustAddHandler(CatchSwitch: &'a Value, Handler: &'a BasicBlock)1249     pub fn LLVMRustAddHandler(CatchSwitch: &'a Value, Handler: &'a BasicBlock);
LLVMSetPersonalityFn(Func: &'a Value, Pers: &'a Value)1250     pub fn LLVMSetPersonalityFn(Func: &'a Value, Pers: &'a Value);
1251 
1252     // Add a case to the switch instruction
LLVMAddCase(Switch: &'a Value, OnVal: &'a Value, Dest: &'a BasicBlock)1253     pub fn LLVMAddCase(Switch: &'a Value, OnVal: &'a Value, Dest: &'a BasicBlock);
1254 
1255     // Add a clause to the landing pad instruction
LLVMAddClause(LandingPad: &'a Value, ClauseVal: &'a Value)1256     pub fn LLVMAddClause(LandingPad: &'a Value, ClauseVal: &'a Value);
1257 
1258     // Set the cleanup on a landing pad instruction
LLVMSetCleanup(LandingPad: &Value, Val: Bool)1259     pub fn LLVMSetCleanup(LandingPad: &Value, Val: Bool);
1260 
1261     // Arithmetic
LLVMBuildAdd( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1262     pub fn LLVMBuildAdd(
1263         B: &Builder<'a>,
1264         LHS: &'a Value,
1265         RHS: &'a Value,
1266         Name: *const c_char,
1267     ) -> &'a Value;
LLVMBuildFAdd( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1268     pub fn LLVMBuildFAdd(
1269         B: &Builder<'a>,
1270         LHS: &'a Value,
1271         RHS: &'a Value,
1272         Name: *const c_char,
1273     ) -> &'a Value;
LLVMBuildSub( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1274     pub fn LLVMBuildSub(
1275         B: &Builder<'a>,
1276         LHS: &'a Value,
1277         RHS: &'a Value,
1278         Name: *const c_char,
1279     ) -> &'a Value;
LLVMBuildFSub( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1280     pub fn LLVMBuildFSub(
1281         B: &Builder<'a>,
1282         LHS: &'a Value,
1283         RHS: &'a Value,
1284         Name: *const c_char,
1285     ) -> &'a Value;
LLVMBuildMul( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1286     pub fn LLVMBuildMul(
1287         B: &Builder<'a>,
1288         LHS: &'a Value,
1289         RHS: &'a Value,
1290         Name: *const c_char,
1291     ) -> &'a Value;
LLVMBuildFMul( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1292     pub fn LLVMBuildFMul(
1293         B: &Builder<'a>,
1294         LHS: &'a Value,
1295         RHS: &'a Value,
1296         Name: *const c_char,
1297     ) -> &'a Value;
LLVMBuildUDiv( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1298     pub fn LLVMBuildUDiv(
1299         B: &Builder<'a>,
1300         LHS: &'a Value,
1301         RHS: &'a Value,
1302         Name: *const c_char,
1303     ) -> &'a Value;
LLVMBuildExactUDiv( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1304     pub fn LLVMBuildExactUDiv(
1305         B: &Builder<'a>,
1306         LHS: &'a Value,
1307         RHS: &'a Value,
1308         Name: *const c_char,
1309     ) -> &'a Value;
LLVMBuildSDiv( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1310     pub fn LLVMBuildSDiv(
1311         B: &Builder<'a>,
1312         LHS: &'a Value,
1313         RHS: &'a Value,
1314         Name: *const c_char,
1315     ) -> &'a Value;
LLVMBuildExactSDiv( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1316     pub fn LLVMBuildExactSDiv(
1317         B: &Builder<'a>,
1318         LHS: &'a Value,
1319         RHS: &'a Value,
1320         Name: *const c_char,
1321     ) -> &'a Value;
LLVMBuildFDiv( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1322     pub fn LLVMBuildFDiv(
1323         B: &Builder<'a>,
1324         LHS: &'a Value,
1325         RHS: &'a Value,
1326         Name: *const c_char,
1327     ) -> &'a Value;
LLVMBuildURem( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1328     pub fn LLVMBuildURem(
1329         B: &Builder<'a>,
1330         LHS: &'a Value,
1331         RHS: &'a Value,
1332         Name: *const c_char,
1333     ) -> &'a Value;
LLVMBuildSRem( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1334     pub fn LLVMBuildSRem(
1335         B: &Builder<'a>,
1336         LHS: &'a Value,
1337         RHS: &'a Value,
1338         Name: *const c_char,
1339     ) -> &'a Value;
LLVMBuildFRem( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1340     pub fn LLVMBuildFRem(
1341         B: &Builder<'a>,
1342         LHS: &'a Value,
1343         RHS: &'a Value,
1344         Name: *const c_char,
1345     ) -> &'a Value;
LLVMBuildShl( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1346     pub fn LLVMBuildShl(
1347         B: &Builder<'a>,
1348         LHS: &'a Value,
1349         RHS: &'a Value,
1350         Name: *const c_char,
1351     ) -> &'a Value;
LLVMBuildLShr( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1352     pub fn LLVMBuildLShr(
1353         B: &Builder<'a>,
1354         LHS: &'a Value,
1355         RHS: &'a Value,
1356         Name: *const c_char,
1357     ) -> &'a Value;
LLVMBuildAShr( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1358     pub fn LLVMBuildAShr(
1359         B: &Builder<'a>,
1360         LHS: &'a Value,
1361         RHS: &'a Value,
1362         Name: *const c_char,
1363     ) -> &'a Value;
LLVMBuildNSWAdd( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1364     pub fn LLVMBuildNSWAdd(
1365         B: &Builder<'a>,
1366         LHS: &'a Value,
1367         RHS: &'a Value,
1368         Name: *const c_char,
1369     ) -> &'a Value;
LLVMBuildNUWAdd( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1370     pub fn LLVMBuildNUWAdd(
1371         B: &Builder<'a>,
1372         LHS: &'a Value,
1373         RHS: &'a Value,
1374         Name: *const c_char,
1375     ) -> &'a Value;
LLVMBuildNSWSub( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1376     pub fn LLVMBuildNSWSub(
1377         B: &Builder<'a>,
1378         LHS: &'a Value,
1379         RHS: &'a Value,
1380         Name: *const c_char,
1381     ) -> &'a Value;
LLVMBuildNUWSub( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1382     pub fn LLVMBuildNUWSub(
1383         B: &Builder<'a>,
1384         LHS: &'a Value,
1385         RHS: &'a Value,
1386         Name: *const c_char,
1387     ) -> &'a Value;
LLVMBuildNSWMul( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1388     pub fn LLVMBuildNSWMul(
1389         B: &Builder<'a>,
1390         LHS: &'a Value,
1391         RHS: &'a Value,
1392         Name: *const c_char,
1393     ) -> &'a Value;
LLVMBuildNUWMul( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1394     pub fn LLVMBuildNUWMul(
1395         B: &Builder<'a>,
1396         LHS: &'a Value,
1397         RHS: &'a Value,
1398         Name: *const c_char,
1399     ) -> &'a Value;
LLVMBuildAnd( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1400     pub fn LLVMBuildAnd(
1401         B: &Builder<'a>,
1402         LHS: &'a Value,
1403         RHS: &'a Value,
1404         Name: *const c_char,
1405     ) -> &'a Value;
LLVMBuildOr( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1406     pub fn LLVMBuildOr(
1407         B: &Builder<'a>,
1408         LHS: &'a Value,
1409         RHS: &'a Value,
1410         Name: *const c_char,
1411     ) -> &'a Value;
LLVMBuildXor( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1412     pub fn LLVMBuildXor(
1413         B: &Builder<'a>,
1414         LHS: &'a Value,
1415         RHS: &'a Value,
1416         Name: *const c_char,
1417     ) -> &'a Value;
LLVMBuildNeg(B: &Builder<'a>, V: &'a Value, Name: *const c_char) -> &'a Value1418     pub fn LLVMBuildNeg(B: &Builder<'a>, V: &'a Value, Name: *const c_char) -> &'a Value;
LLVMBuildFNeg(B: &Builder<'a>, V: &'a Value, Name: *const c_char) -> &'a Value1419     pub fn LLVMBuildFNeg(B: &Builder<'a>, V: &'a Value, Name: *const c_char) -> &'a Value;
LLVMBuildNot(B: &Builder<'a>, V: &'a Value, Name: *const c_char) -> &'a Value1420     pub fn LLVMBuildNot(B: &Builder<'a>, V: &'a Value, Name: *const c_char) -> &'a Value;
LLVMRustSetFastMath(Instr: &Value)1421     pub fn LLVMRustSetFastMath(Instr: &Value);
1422 
1423     // Memory
LLVMBuildAlloca(B: &Builder<'a>, Ty: &'a Type, Name: *const c_char) -> &'a Value1424     pub fn LLVMBuildAlloca(B: &Builder<'a>, Ty: &'a Type, Name: *const c_char) -> &'a Value;
LLVMBuildArrayAlloca( B: &Builder<'a>, Ty: &'a Type, Val: &'a Value, Name: *const c_char, ) -> &'a Value1425     pub fn LLVMBuildArrayAlloca(
1426         B: &Builder<'a>,
1427         Ty: &'a Type,
1428         Val: &'a Value,
1429         Name: *const c_char,
1430     ) -> &'a Value;
LLVMBuildLoad2( B: &Builder<'a>, Ty: &'a Type, PointerVal: &'a Value, Name: *const c_char, ) -> &'a Value1431     pub fn LLVMBuildLoad2(
1432         B: &Builder<'a>,
1433         Ty: &'a Type,
1434         PointerVal: &'a Value,
1435         Name: *const c_char,
1436     ) -> &'a Value;
1437 
LLVMBuildStore(B: &Builder<'a>, Val: &'a Value, Ptr: &'a Value) -> &'a Value1438     pub fn LLVMBuildStore(B: &Builder<'a>, Val: &'a Value, Ptr: &'a Value) -> &'a Value;
1439 
LLVMBuildGEP2( B: &Builder<'a>, Ty: &'a Type, Pointer: &'a Value, Indices: *const &'a Value, NumIndices: c_uint, Name: *const c_char, ) -> &'a Value1440     pub fn LLVMBuildGEP2(
1441         B: &Builder<'a>,
1442         Ty: &'a Type,
1443         Pointer: &'a Value,
1444         Indices: *const &'a Value,
1445         NumIndices: c_uint,
1446         Name: *const c_char,
1447     ) -> &'a Value;
LLVMBuildInBoundsGEP2( B: &Builder<'a>, Ty: &'a Type, Pointer: &'a Value, Indices: *const &'a Value, NumIndices: c_uint, Name: *const c_char, ) -> &'a Value1448     pub fn LLVMBuildInBoundsGEP2(
1449         B: &Builder<'a>,
1450         Ty: &'a Type,
1451         Pointer: &'a Value,
1452         Indices: *const &'a Value,
1453         NumIndices: c_uint,
1454         Name: *const c_char,
1455     ) -> &'a Value;
LLVMBuildStructGEP2( B: &Builder<'a>, Ty: &'a Type, Pointer: &'a Value, Idx: c_uint, Name: *const c_char, ) -> &'a Value1456     pub fn LLVMBuildStructGEP2(
1457         B: &Builder<'a>,
1458         Ty: &'a Type,
1459         Pointer: &'a Value,
1460         Idx: c_uint,
1461         Name: *const c_char,
1462     ) -> &'a Value;
1463 
1464     // Casts
LLVMBuildTrunc( B: &Builder<'a>, Val: &'a Value, DestTy: &'a Type, Name: *const c_char, ) -> &'a Value1465     pub fn LLVMBuildTrunc(
1466         B: &Builder<'a>,
1467         Val: &'a Value,
1468         DestTy: &'a Type,
1469         Name: *const c_char,
1470     ) -> &'a Value;
LLVMBuildZExt( B: &Builder<'a>, Val: &'a Value, DestTy: &'a Type, Name: *const c_char, ) -> &'a Value1471     pub fn LLVMBuildZExt(
1472         B: &Builder<'a>,
1473         Val: &'a Value,
1474         DestTy: &'a Type,
1475         Name: *const c_char,
1476     ) -> &'a Value;
LLVMBuildSExt( B: &Builder<'a>, Val: &'a Value, DestTy: &'a Type, Name: *const c_char, ) -> &'a Value1477     pub fn LLVMBuildSExt(
1478         B: &Builder<'a>,
1479         Val: &'a Value,
1480         DestTy: &'a Type,
1481         Name: *const c_char,
1482     ) -> &'a Value;
LLVMBuildFPToUI( B: &Builder<'a>, Val: &'a Value, DestTy: &'a Type, Name: *const c_char, ) -> &'a Value1483     pub fn LLVMBuildFPToUI(
1484         B: &Builder<'a>,
1485         Val: &'a Value,
1486         DestTy: &'a Type,
1487         Name: *const c_char,
1488     ) -> &'a Value;
LLVMBuildFPToSI( B: &Builder<'a>, Val: &'a Value, DestTy: &'a Type, Name: *const c_char, ) -> &'a Value1489     pub fn LLVMBuildFPToSI(
1490         B: &Builder<'a>,
1491         Val: &'a Value,
1492         DestTy: &'a Type,
1493         Name: *const c_char,
1494     ) -> &'a Value;
LLVMBuildUIToFP( B: &Builder<'a>, Val: &'a Value, DestTy: &'a Type, Name: *const c_char, ) -> &'a Value1495     pub fn LLVMBuildUIToFP(
1496         B: &Builder<'a>,
1497         Val: &'a Value,
1498         DestTy: &'a Type,
1499         Name: *const c_char,
1500     ) -> &'a Value;
LLVMBuildSIToFP( B: &Builder<'a>, Val: &'a Value, DestTy: &'a Type, Name: *const c_char, ) -> &'a Value1501     pub fn LLVMBuildSIToFP(
1502         B: &Builder<'a>,
1503         Val: &'a Value,
1504         DestTy: &'a Type,
1505         Name: *const c_char,
1506     ) -> &'a Value;
LLVMBuildFPTrunc( B: &Builder<'a>, Val: &'a Value, DestTy: &'a Type, Name: *const c_char, ) -> &'a Value1507     pub fn LLVMBuildFPTrunc(
1508         B: &Builder<'a>,
1509         Val: &'a Value,
1510         DestTy: &'a Type,
1511         Name: *const c_char,
1512     ) -> &'a Value;
LLVMBuildFPExt( B: &Builder<'a>, Val: &'a Value, DestTy: &'a Type, Name: *const c_char, ) -> &'a Value1513     pub fn LLVMBuildFPExt(
1514         B: &Builder<'a>,
1515         Val: &'a Value,
1516         DestTy: &'a Type,
1517         Name: *const c_char,
1518     ) -> &'a Value;
LLVMBuildPtrToInt( B: &Builder<'a>, Val: &'a Value, DestTy: &'a Type, Name: *const c_char, ) -> &'a Value1519     pub fn LLVMBuildPtrToInt(
1520         B: &Builder<'a>,
1521         Val: &'a Value,
1522         DestTy: &'a Type,
1523         Name: *const c_char,
1524     ) -> &'a Value;
LLVMBuildIntToPtr( B: &Builder<'a>, Val: &'a Value, DestTy: &'a Type, Name: *const c_char, ) -> &'a Value1525     pub fn LLVMBuildIntToPtr(
1526         B: &Builder<'a>,
1527         Val: &'a Value,
1528         DestTy: &'a Type,
1529         Name: *const c_char,
1530     ) -> &'a Value;
LLVMBuildBitCast( B: &Builder<'a>, Val: &'a Value, DestTy: &'a Type, Name: *const c_char, ) -> &'a Value1531     pub fn LLVMBuildBitCast(
1532         B: &Builder<'a>,
1533         Val: &'a Value,
1534         DestTy: &'a Type,
1535         Name: *const c_char,
1536     ) -> &'a Value;
LLVMBuildPointerCast( B: &Builder<'a>, Val: &'a Value, DestTy: &'a Type, Name: *const c_char, ) -> &'a Value1537     pub fn LLVMBuildPointerCast(
1538         B: &Builder<'a>,
1539         Val: &'a Value,
1540         DestTy: &'a Type,
1541         Name: *const c_char,
1542     ) -> &'a Value;
LLVMRustBuildIntCast( B: &Builder<'a>, Val: &'a Value, DestTy: &'a Type, IsSized: bool, ) -> &'a Value1543     pub fn LLVMRustBuildIntCast(
1544         B: &Builder<'a>,
1545         Val: &'a Value,
1546         DestTy: &'a Type,
1547         IsSized: bool,
1548     ) -> &'a Value;
1549 
1550     // Comparisons
LLVMBuildICmp( B: &Builder<'a>, Op: c_uint, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1551     pub fn LLVMBuildICmp(
1552         B: &Builder<'a>,
1553         Op: c_uint,
1554         LHS: &'a Value,
1555         RHS: &'a Value,
1556         Name: *const c_char,
1557     ) -> &'a Value;
LLVMBuildFCmp( B: &Builder<'a>, Op: c_uint, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1558     pub fn LLVMBuildFCmp(
1559         B: &Builder<'a>,
1560         Op: c_uint,
1561         LHS: &'a Value,
1562         RHS: &'a Value,
1563         Name: *const c_char,
1564     ) -> &'a Value;
1565 
1566     // Miscellaneous instructions
LLVMBuildPhi(B: &Builder<'a>, Ty: &'a Type, Name: *const c_char) -> &'a Value1567     pub fn LLVMBuildPhi(B: &Builder<'a>, Ty: &'a Type, Name: *const c_char) -> &'a Value;
LLVMRustGetInstrProfIncrementIntrinsic(M: &Module) -> &'a Value1568     pub fn LLVMRustGetInstrProfIncrementIntrinsic(M: &Module) -> &'a Value;
LLVMRustBuildCall( B: &Builder<'a>, Ty: &'a Type, Fn: &'a Value, Args: *const &'a Value, NumArgs: c_uint, Bundle: Option<&OperandBundleDef<'a>>, ) -> &'a Value1569     pub fn LLVMRustBuildCall(
1570         B: &Builder<'a>,
1571         Ty: &'a Type,
1572         Fn: &'a Value,
1573         Args: *const &'a Value,
1574         NumArgs: c_uint,
1575         Bundle: Option<&OperandBundleDef<'a>>,
1576     ) -> &'a Value;
LLVMRustBuildMemCpy( B: &Builder<'a>, Dst: &'a Value, DstAlign: c_uint, Src: &'a Value, SrcAlign: c_uint, Size: &'a Value, IsVolatile: bool, ) -> &'a Value1577     pub fn LLVMRustBuildMemCpy(
1578         B: &Builder<'a>,
1579         Dst: &'a Value,
1580         DstAlign: c_uint,
1581         Src: &'a Value,
1582         SrcAlign: c_uint,
1583         Size: &'a Value,
1584         IsVolatile: bool,
1585     ) -> &'a Value;
LLVMRustBuildMemMove( B: &Builder<'a>, Dst: &'a Value, DstAlign: c_uint, Src: &'a Value, SrcAlign: c_uint, Size: &'a Value, IsVolatile: bool, ) -> &'a Value1586     pub fn LLVMRustBuildMemMove(
1587         B: &Builder<'a>,
1588         Dst: &'a Value,
1589         DstAlign: c_uint,
1590         Src: &'a Value,
1591         SrcAlign: c_uint,
1592         Size: &'a Value,
1593         IsVolatile: bool,
1594     ) -> &'a Value;
LLVMRustBuildMemSet( B: &Builder<'a>, Dst: &'a Value, DstAlign: c_uint, Val: &'a Value, Size: &'a Value, IsVolatile: bool, ) -> &'a Value1595     pub fn LLVMRustBuildMemSet(
1596         B: &Builder<'a>,
1597         Dst: &'a Value,
1598         DstAlign: c_uint,
1599         Val: &'a Value,
1600         Size: &'a Value,
1601         IsVolatile: bool,
1602     ) -> &'a Value;
LLVMBuildSelect( B: &Builder<'a>, If: &'a Value, Then: &'a Value, Else: &'a Value, Name: *const c_char, ) -> &'a Value1603     pub fn LLVMBuildSelect(
1604         B: &Builder<'a>,
1605         If: &'a Value,
1606         Then: &'a Value,
1607         Else: &'a Value,
1608         Name: *const c_char,
1609     ) -> &'a Value;
LLVMBuildVAArg( B: &Builder<'a>, list: &'a Value, Ty: &'a Type, Name: *const c_char, ) -> &'a Value1610     pub fn LLVMBuildVAArg(
1611         B: &Builder<'a>,
1612         list: &'a Value,
1613         Ty: &'a Type,
1614         Name: *const c_char,
1615     ) -> &'a Value;
LLVMBuildExtractElement( B: &Builder<'a>, VecVal: &'a Value, Index: &'a Value, Name: *const c_char, ) -> &'a Value1616     pub fn LLVMBuildExtractElement(
1617         B: &Builder<'a>,
1618         VecVal: &'a Value,
1619         Index: &'a Value,
1620         Name: *const c_char,
1621     ) -> &'a Value;
LLVMBuildInsertElement( B: &Builder<'a>, VecVal: &'a Value, EltVal: &'a Value, Index: &'a Value, Name: *const c_char, ) -> &'a Value1622     pub fn LLVMBuildInsertElement(
1623         B: &Builder<'a>,
1624         VecVal: &'a Value,
1625         EltVal: &'a Value,
1626         Index: &'a Value,
1627         Name: *const c_char,
1628     ) -> &'a Value;
LLVMBuildShuffleVector( B: &Builder<'a>, V1: &'a Value, V2: &'a Value, Mask: &'a Value, Name: *const c_char, ) -> &'a Value1629     pub fn LLVMBuildShuffleVector(
1630         B: &Builder<'a>,
1631         V1: &'a Value,
1632         V2: &'a Value,
1633         Mask: &'a Value,
1634         Name: *const c_char,
1635     ) -> &'a Value;
LLVMBuildExtractValue( B: &Builder<'a>, AggVal: &'a Value, Index: c_uint, Name: *const c_char, ) -> &'a Value1636     pub fn LLVMBuildExtractValue(
1637         B: &Builder<'a>,
1638         AggVal: &'a Value,
1639         Index: c_uint,
1640         Name: *const c_char,
1641     ) -> &'a Value;
LLVMBuildInsertValue( B: &Builder<'a>, AggVal: &'a Value, EltVal: &'a Value, Index: c_uint, Name: *const c_char, ) -> &'a Value1642     pub fn LLVMBuildInsertValue(
1643         B: &Builder<'a>,
1644         AggVal: &'a Value,
1645         EltVal: &'a Value,
1646         Index: c_uint,
1647         Name: *const c_char,
1648     ) -> &'a Value;
1649 
LLVMRustBuildVectorReduceFAdd( B: &Builder<'a>, Acc: &'a Value, Src: &'a Value, ) -> &'a Value1650     pub fn LLVMRustBuildVectorReduceFAdd(
1651         B: &Builder<'a>,
1652         Acc: &'a Value,
1653         Src: &'a Value,
1654     ) -> &'a Value;
LLVMRustBuildVectorReduceFMul( B: &Builder<'a>, Acc: &'a Value, Src: &'a Value, ) -> &'a Value1655     pub fn LLVMRustBuildVectorReduceFMul(
1656         B: &Builder<'a>,
1657         Acc: &'a Value,
1658         Src: &'a Value,
1659     ) -> &'a Value;
LLVMRustBuildVectorReduceAdd(B: &Builder<'a>, Src: &'a Value) -> &'a Value1660     pub fn LLVMRustBuildVectorReduceAdd(B: &Builder<'a>, Src: &'a Value) -> &'a Value;
LLVMRustBuildVectorReduceMul(B: &Builder<'a>, Src: &'a Value) -> &'a Value1661     pub fn LLVMRustBuildVectorReduceMul(B: &Builder<'a>, Src: &'a Value) -> &'a Value;
LLVMRustBuildVectorReduceAnd(B: &Builder<'a>, Src: &'a Value) -> &'a Value1662     pub fn LLVMRustBuildVectorReduceAnd(B: &Builder<'a>, Src: &'a Value) -> &'a Value;
LLVMRustBuildVectorReduceOr(B: &Builder<'a>, Src: &'a Value) -> &'a Value1663     pub fn LLVMRustBuildVectorReduceOr(B: &Builder<'a>, Src: &'a Value) -> &'a Value;
LLVMRustBuildVectorReduceXor(B: &Builder<'a>, Src: &'a Value) -> &'a Value1664     pub fn LLVMRustBuildVectorReduceXor(B: &Builder<'a>, Src: &'a Value) -> &'a Value;
LLVMRustBuildVectorReduceMin( B: &Builder<'a>, Src: &'a Value, IsSigned: bool, ) -> &'a Value1665     pub fn LLVMRustBuildVectorReduceMin(
1666         B: &Builder<'a>,
1667         Src: &'a Value,
1668         IsSigned: bool,
1669     ) -> &'a Value;
LLVMRustBuildVectorReduceMax( B: &Builder<'a>, Src: &'a Value, IsSigned: bool, ) -> &'a Value1670     pub fn LLVMRustBuildVectorReduceMax(
1671         B: &Builder<'a>,
1672         Src: &'a Value,
1673         IsSigned: bool,
1674     ) -> &'a Value;
LLVMRustBuildVectorReduceFMin(B: &Builder<'a>, Src: &'a Value, IsNaN: bool) -> &'a Value1675     pub fn LLVMRustBuildVectorReduceFMin(B: &Builder<'a>, Src: &'a Value, IsNaN: bool)
1676     -> &'a Value;
LLVMRustBuildVectorReduceFMax(B: &Builder<'a>, Src: &'a Value, IsNaN: bool) -> &'a Value1677     pub fn LLVMRustBuildVectorReduceFMax(B: &Builder<'a>, Src: &'a Value, IsNaN: bool)
1678     -> &'a Value;
1679 
LLVMRustBuildMinNum(B: &Builder<'a>, LHS: &'a Value, LHS: &'a Value) -> &'a Value1680     pub fn LLVMRustBuildMinNum(B: &Builder<'a>, LHS: &'a Value, LHS: &'a Value) -> &'a Value;
LLVMRustBuildMaxNum(B: &Builder<'a>, LHS: &'a Value, LHS: &'a Value) -> &'a Value1681     pub fn LLVMRustBuildMaxNum(B: &Builder<'a>, LHS: &'a Value, LHS: &'a Value) -> &'a Value;
1682 
1683     // Atomic Operations
LLVMRustBuildAtomicLoad( B: &Builder<'a>, ElementType: &'a Type, PointerVal: &'a Value, Name: *const c_char, Order: AtomicOrdering, ) -> &'a Value1684     pub fn LLVMRustBuildAtomicLoad(
1685         B: &Builder<'a>,
1686         ElementType: &'a Type,
1687         PointerVal: &'a Value,
1688         Name: *const c_char,
1689         Order: AtomicOrdering,
1690     ) -> &'a Value;
1691 
LLVMRustBuildAtomicStore( B: &Builder<'a>, Val: &'a Value, Ptr: &'a Value, Order: AtomicOrdering, ) -> &'a Value1692     pub fn LLVMRustBuildAtomicStore(
1693         B: &Builder<'a>,
1694         Val: &'a Value,
1695         Ptr: &'a Value,
1696         Order: AtomicOrdering,
1697     ) -> &'a Value;
1698 
LLVMRustBuildAtomicCmpXchg( B: &Builder<'a>, LHS: &'a Value, CMP: &'a Value, RHS: &'a Value, Order: AtomicOrdering, FailureOrder: AtomicOrdering, Weak: Bool, ) -> &'a Value1699     pub fn LLVMRustBuildAtomicCmpXchg(
1700         B: &Builder<'a>,
1701         LHS: &'a Value,
1702         CMP: &'a Value,
1703         RHS: &'a Value,
1704         Order: AtomicOrdering,
1705         FailureOrder: AtomicOrdering,
1706         Weak: Bool,
1707     ) -> &'a Value;
1708 
LLVMBuildAtomicRMW( B: &Builder<'a>, Op: AtomicRmwBinOp, LHS: &'a Value, RHS: &'a Value, Order: AtomicOrdering, SingleThreaded: Bool, ) -> &'a Value1709     pub fn LLVMBuildAtomicRMW(
1710         B: &Builder<'a>,
1711         Op: AtomicRmwBinOp,
1712         LHS: &'a Value,
1713         RHS: &'a Value,
1714         Order: AtomicOrdering,
1715         SingleThreaded: Bool,
1716     ) -> &'a Value;
1717 
LLVMRustBuildAtomicFence( B: &Builder<'_>, Order: AtomicOrdering, Scope: SynchronizationScope, )1718     pub fn LLVMRustBuildAtomicFence(
1719         B: &Builder<'_>,
1720         Order: AtomicOrdering,
1721         Scope: SynchronizationScope,
1722     );
1723 
1724     /// Writes a module to the specified path. Returns 0 on success.
LLVMWriteBitcodeToFile(M: &Module, Path: *const c_char) -> c_int1725     pub fn LLVMWriteBitcodeToFile(M: &Module, Path: *const c_char) -> c_int;
1726 
1727     /// Creates a pass manager.
LLVMCreatePassManager() -> &'a mut PassManager<'a>1728     pub fn LLVMCreatePassManager() -> &'a mut PassManager<'a>;
1729 
1730     /// Creates a function-by-function pass manager
LLVMCreateFunctionPassManagerForModule(M: &'a Module) -> &'a mut PassManager<'a>1731     pub fn LLVMCreateFunctionPassManagerForModule(M: &'a Module) -> &'a mut PassManager<'a>;
1732 
1733     /// Disposes a pass manager.
LLVMDisposePassManager(PM: &'a mut PassManager<'a>)1734     pub fn LLVMDisposePassManager(PM: &'a mut PassManager<'a>);
1735 
1736     /// Runs a pass manager on a module.
LLVMRunPassManager(PM: &PassManager<'a>, M: &'a Module) -> Bool1737     pub fn LLVMRunPassManager(PM: &PassManager<'a>, M: &'a Module) -> Bool;
1738 
LLVMInitializePasses()1739     pub fn LLVMInitializePasses();
1740 
LLVMTimeTraceProfilerInitialize()1741     pub fn LLVMTimeTraceProfilerInitialize();
1742 
LLVMTimeTraceProfilerFinishThread()1743     pub fn LLVMTimeTraceProfilerFinishThread();
1744 
LLVMTimeTraceProfilerFinish(FileName: *const c_char)1745     pub fn LLVMTimeTraceProfilerFinish(FileName: *const c_char);
1746 
LLVMAddAnalysisPasses(T: &'a TargetMachine, PM: &PassManager<'a>)1747     pub fn LLVMAddAnalysisPasses(T: &'a TargetMachine, PM: &PassManager<'a>);
1748 
LLVMPassManagerBuilderCreate() -> &'static mut PassManagerBuilder1749     pub fn LLVMPassManagerBuilderCreate() -> &'static mut PassManagerBuilder;
LLVMPassManagerBuilderDispose(PMB: &'static mut PassManagerBuilder)1750     pub fn LLVMPassManagerBuilderDispose(PMB: &'static mut PassManagerBuilder);
LLVMPassManagerBuilderSetSizeLevel(PMB: &PassManagerBuilder, Value: Bool)1751     pub fn LLVMPassManagerBuilderSetSizeLevel(PMB: &PassManagerBuilder, Value: Bool);
LLVMPassManagerBuilderSetDisableUnrollLoops(PMB: &PassManagerBuilder, Value: Bool)1752     pub fn LLVMPassManagerBuilderSetDisableUnrollLoops(PMB: &PassManagerBuilder, Value: Bool);
LLVMPassManagerBuilderUseInlinerWithThreshold( PMB: &PassManagerBuilder, threshold: c_uint, )1753     pub fn LLVMPassManagerBuilderUseInlinerWithThreshold(
1754         PMB: &PassManagerBuilder,
1755         threshold: c_uint,
1756     );
LLVMPassManagerBuilderPopulateModulePassManager( PMB: &PassManagerBuilder, PM: &PassManager<'_>, )1757     pub fn LLVMPassManagerBuilderPopulateModulePassManager(
1758         PMB: &PassManagerBuilder,
1759         PM: &PassManager<'_>,
1760     );
1761 
LLVMPassManagerBuilderPopulateFunctionPassManager( PMB: &PassManagerBuilder, PM: &PassManager<'_>, )1762     pub fn LLVMPassManagerBuilderPopulateFunctionPassManager(
1763         PMB: &PassManagerBuilder,
1764         PM: &PassManager<'_>,
1765     );
LLVMPassManagerBuilderPopulateLTOPassManager( PMB: &PassManagerBuilder, PM: &PassManager<'_>, Internalize: Bool, RunInliner: Bool, )1766     pub fn LLVMPassManagerBuilderPopulateLTOPassManager(
1767         PMB: &PassManagerBuilder,
1768         PM: &PassManager<'_>,
1769         Internalize: Bool,
1770         RunInliner: Bool,
1771     );
LLVMRustPassManagerBuilderPopulateThinLTOPassManager( PMB: &PassManagerBuilder, PM: &PassManager<'_>, )1772     pub fn LLVMRustPassManagerBuilderPopulateThinLTOPassManager(
1773         PMB: &PassManagerBuilder,
1774         PM: &PassManager<'_>,
1775     );
1776 
LLVMGetHostCPUFeatures() -> *mut c_char1777     pub fn LLVMGetHostCPUFeatures() -> *mut c_char;
1778 
LLVMDisposeMessage(message: *mut c_char)1779     pub fn LLVMDisposeMessage(message: *mut c_char);
1780 
LLVMIsMultithreaded() -> Bool1781     pub fn LLVMIsMultithreaded() -> Bool;
1782 
1783     /// Returns a string describing the last error caused by an LLVMRust* call.
LLVMRustGetLastError() -> *const c_char1784     pub fn LLVMRustGetLastError() -> *const c_char;
1785 
1786     /// Print the pass timings since static dtors aren't picking them up.
LLVMRustPrintPassTimings()1787     pub fn LLVMRustPrintPassTimings();
1788 
LLVMStructCreateNamed(C: &Context, Name: *const c_char) -> &Type1789     pub fn LLVMStructCreateNamed(C: &Context, Name: *const c_char) -> &Type;
1790 
LLVMStructSetBody( StructTy: &'a Type, ElementTypes: *const &'a Type, ElementCount: c_uint, Packed: Bool, )1791     pub fn LLVMStructSetBody(
1792         StructTy: &'a Type,
1793         ElementTypes: *const &'a Type,
1794         ElementCount: c_uint,
1795         Packed: Bool,
1796     );
1797 
1798     /// Prepares inline assembly.
LLVMRustInlineAsm( Ty: &Type, AsmString: *const c_char, AsmStringLen: size_t, Constraints: *const c_char, ConstraintsLen: size_t, SideEffects: Bool, AlignStack: Bool, Dialect: AsmDialect, ) -> &Value1799     pub fn LLVMRustInlineAsm(
1800         Ty: &Type,
1801         AsmString: *const c_char,
1802         AsmStringLen: size_t,
1803         Constraints: *const c_char,
1804         ConstraintsLen: size_t,
1805         SideEffects: Bool,
1806         AlignStack: Bool,
1807         Dialect: AsmDialect,
1808     ) -> &Value;
LLVMRustInlineAsmVerify( Ty: &Type, Constraints: *const c_char, ConstraintsLen: size_t, ) -> bool1809     pub fn LLVMRustInlineAsmVerify(
1810         Ty: &Type,
1811         Constraints: *const c_char,
1812         ConstraintsLen: size_t,
1813     ) -> bool;
1814 
1815     #[allow(improper_ctypes)]
LLVMRustCoverageWriteFilenamesSectionToBuffer( Filenames: *const *const c_char, FilenamesLen: size_t, BufferOut: &RustString, )1816     pub fn LLVMRustCoverageWriteFilenamesSectionToBuffer(
1817         Filenames: *const *const c_char,
1818         FilenamesLen: size_t,
1819         BufferOut: &RustString,
1820     );
1821 
1822     #[allow(improper_ctypes)]
LLVMRustCoverageWriteMappingToBuffer( VirtualFileMappingIDs: *const c_uint, NumVirtualFileMappingIDs: c_uint, Expressions: *const coverage_map::CounterExpression, NumExpressions: c_uint, MappingRegions: *const coverageinfo::CounterMappingRegion, NumMappingRegions: c_uint, BufferOut: &RustString, )1823     pub fn LLVMRustCoverageWriteMappingToBuffer(
1824         VirtualFileMappingIDs: *const c_uint,
1825         NumVirtualFileMappingIDs: c_uint,
1826         Expressions: *const coverage_map::CounterExpression,
1827         NumExpressions: c_uint,
1828         MappingRegions: *const coverageinfo::CounterMappingRegion,
1829         NumMappingRegions: c_uint,
1830         BufferOut: &RustString,
1831     );
1832 
LLVMRustCoverageCreatePGOFuncNameVar(F: &'a Value, FuncName: *const c_char) -> &'a Value1833     pub fn LLVMRustCoverageCreatePGOFuncNameVar(F: &'a Value, FuncName: *const c_char)
1834     -> &'a Value;
LLVMRustCoverageHashCString(StrVal: *const c_char) -> u641835     pub fn LLVMRustCoverageHashCString(StrVal: *const c_char) -> u64;
LLVMRustCoverageHashByteArray(Bytes: *const c_char, NumBytes: size_t) -> u641836     pub fn LLVMRustCoverageHashByteArray(Bytes: *const c_char, NumBytes: size_t) -> u64;
1837 
1838     #[allow(improper_ctypes)]
LLVMRustCoverageWriteMapSectionNameToString(M: &Module, Str: &RustString)1839     pub fn LLVMRustCoverageWriteMapSectionNameToString(M: &Module, Str: &RustString);
1840 
1841     #[allow(improper_ctypes)]
LLVMRustCoverageWriteFuncSectionNameToString(M: &Module, Str: &RustString)1842     pub fn LLVMRustCoverageWriteFuncSectionNameToString(M: &Module, Str: &RustString);
1843 
1844     #[allow(improper_ctypes)]
LLVMRustCoverageWriteMappingVarNameToString(Str: &RustString)1845     pub fn LLVMRustCoverageWriteMappingVarNameToString(Str: &RustString);
1846 
LLVMRustCoverageMappingVersion() -> u321847     pub fn LLVMRustCoverageMappingVersion() -> u32;
LLVMRustDebugMetadataVersion() -> u321848     pub fn LLVMRustDebugMetadataVersion() -> u32;
LLVMRustVersionMajor() -> u321849     pub fn LLVMRustVersionMajor() -> u32;
LLVMRustVersionMinor() -> u321850     pub fn LLVMRustVersionMinor() -> u32;
LLVMRustVersionPatch() -> u321851     pub fn LLVMRustVersionPatch() -> u32;
1852 
LLVMRustAddModuleFlag(M: &Module, name: *const c_char, value: u32)1853     pub fn LLVMRustAddModuleFlag(M: &Module, name: *const c_char, value: u32);
1854 
LLVMRustMetadataAsValue(C: &'a Context, MD: &'a Metadata) -> &'a Value1855     pub fn LLVMRustMetadataAsValue(C: &'a Context, MD: &'a Metadata) -> &'a Value;
1856 
LLVMRustDIBuilderCreate(M: &'a Module) -> &'a mut DIBuilder<'a>1857     pub fn LLVMRustDIBuilderCreate(M: &'a Module) -> &'a mut DIBuilder<'a>;
1858 
LLVMRustDIBuilderDispose(Builder: &'a mut DIBuilder<'a>)1859     pub fn LLVMRustDIBuilderDispose(Builder: &'a mut DIBuilder<'a>);
1860 
LLVMRustDIBuilderFinalize(Builder: &DIBuilder<'_>)1861     pub fn LLVMRustDIBuilderFinalize(Builder: &DIBuilder<'_>);
1862 
LLVMRustDIBuilderCreateCompileUnit( Builder: &DIBuilder<'a>, Lang: c_uint, File: &'a DIFile, Producer: *const c_char, ProducerLen: size_t, isOptimized: bool, Flags: *const c_char, RuntimeVer: c_uint, SplitName: *const c_char, SplitNameLen: size_t, kind: DebugEmissionKind, DWOId: u64, SplitDebugInlining: bool, ) -> &'a DIDescriptor1863     pub fn LLVMRustDIBuilderCreateCompileUnit(
1864         Builder: &DIBuilder<'a>,
1865         Lang: c_uint,
1866         File: &'a DIFile,
1867         Producer: *const c_char,
1868         ProducerLen: size_t,
1869         isOptimized: bool,
1870         Flags: *const c_char,
1871         RuntimeVer: c_uint,
1872         SplitName: *const c_char,
1873         SplitNameLen: size_t,
1874         kind: DebugEmissionKind,
1875         DWOId: u64,
1876         SplitDebugInlining: bool,
1877     ) -> &'a DIDescriptor;
1878 
LLVMRustDIBuilderCreateFile( Builder: &DIBuilder<'a>, Filename: *const c_char, FilenameLen: size_t, Directory: *const c_char, DirectoryLen: size_t, CSKind: ChecksumKind, Checksum: *const c_char, ChecksumLen: size_t, ) -> &'a DIFile1879     pub fn LLVMRustDIBuilderCreateFile(
1880         Builder: &DIBuilder<'a>,
1881         Filename: *const c_char,
1882         FilenameLen: size_t,
1883         Directory: *const c_char,
1884         DirectoryLen: size_t,
1885         CSKind: ChecksumKind,
1886         Checksum: *const c_char,
1887         ChecksumLen: size_t,
1888     ) -> &'a DIFile;
1889 
LLVMRustDIBuilderCreateSubroutineType( Builder: &DIBuilder<'a>, ParameterTypes: &'a DIArray, ) -> &'a DICompositeType1890     pub fn LLVMRustDIBuilderCreateSubroutineType(
1891         Builder: &DIBuilder<'a>,
1892         ParameterTypes: &'a DIArray,
1893     ) -> &'a DICompositeType;
1894 
LLVMRustDIBuilderCreateFunction( Builder: &DIBuilder<'a>, Scope: &'a DIDescriptor, Name: *const c_char, NameLen: size_t, LinkageName: *const c_char, LinkageNameLen: size_t, File: &'a DIFile, LineNo: c_uint, Ty: &'a DIType, ScopeLine: c_uint, Flags: DIFlags, SPFlags: DISPFlags, MaybeFn: Option<&'a Value>, TParam: &'a DIArray, Decl: Option<&'a DIDescriptor>, ) -> &'a DISubprogram1895     pub fn LLVMRustDIBuilderCreateFunction(
1896         Builder: &DIBuilder<'a>,
1897         Scope: &'a DIDescriptor,
1898         Name: *const c_char,
1899         NameLen: size_t,
1900         LinkageName: *const c_char,
1901         LinkageNameLen: size_t,
1902         File: &'a DIFile,
1903         LineNo: c_uint,
1904         Ty: &'a DIType,
1905         ScopeLine: c_uint,
1906         Flags: DIFlags,
1907         SPFlags: DISPFlags,
1908         MaybeFn: Option<&'a Value>,
1909         TParam: &'a DIArray,
1910         Decl: Option<&'a DIDescriptor>,
1911     ) -> &'a DISubprogram;
1912 
LLVMRustDIBuilderCreateBasicType( Builder: &DIBuilder<'a>, Name: *const c_char, NameLen: size_t, SizeInBits: u64, Encoding: c_uint, ) -> &'a DIBasicType1913     pub fn LLVMRustDIBuilderCreateBasicType(
1914         Builder: &DIBuilder<'a>,
1915         Name: *const c_char,
1916         NameLen: size_t,
1917         SizeInBits: u64,
1918         Encoding: c_uint,
1919     ) -> &'a DIBasicType;
1920 
LLVMRustDIBuilderCreateTypedef( Builder: &DIBuilder<'a>, Type: &'a DIBasicType, Name: *const c_char, NameLen: size_t, File: &'a DIFile, LineNo: c_uint, Scope: Option<&'a DIScope>, ) -> &'a DIDerivedType1921     pub fn LLVMRustDIBuilderCreateTypedef(
1922         Builder: &DIBuilder<'a>,
1923         Type: &'a DIBasicType,
1924         Name: *const c_char,
1925         NameLen: size_t,
1926         File: &'a DIFile,
1927         LineNo: c_uint,
1928         Scope: Option<&'a DIScope>,
1929     ) -> &'a DIDerivedType;
1930 
LLVMRustDIBuilderCreatePointerType( Builder: &DIBuilder<'a>, PointeeTy: &'a DIType, SizeInBits: u64, AlignInBits: u32, AddressSpace: c_uint, Name: *const c_char, NameLen: size_t, ) -> &'a DIDerivedType1931     pub fn LLVMRustDIBuilderCreatePointerType(
1932         Builder: &DIBuilder<'a>,
1933         PointeeTy: &'a DIType,
1934         SizeInBits: u64,
1935         AlignInBits: u32,
1936         AddressSpace: c_uint,
1937         Name: *const c_char,
1938         NameLen: size_t,
1939     ) -> &'a DIDerivedType;
1940 
LLVMRustDIBuilderCreateStructType( Builder: &DIBuilder<'a>, Scope: Option<&'a DIDescriptor>, Name: *const c_char, NameLen: size_t, File: &'a DIFile, LineNumber: c_uint, SizeInBits: u64, AlignInBits: u32, Flags: DIFlags, DerivedFrom: Option<&'a DIType>, Elements: &'a DIArray, RunTimeLang: c_uint, VTableHolder: Option<&'a DIType>, UniqueId: *const c_char, UniqueIdLen: size_t, ) -> &'a DICompositeType1941     pub fn LLVMRustDIBuilderCreateStructType(
1942         Builder: &DIBuilder<'a>,
1943         Scope: Option<&'a DIDescriptor>,
1944         Name: *const c_char,
1945         NameLen: size_t,
1946         File: &'a DIFile,
1947         LineNumber: c_uint,
1948         SizeInBits: u64,
1949         AlignInBits: u32,
1950         Flags: DIFlags,
1951         DerivedFrom: Option<&'a DIType>,
1952         Elements: &'a DIArray,
1953         RunTimeLang: c_uint,
1954         VTableHolder: Option<&'a DIType>,
1955         UniqueId: *const c_char,
1956         UniqueIdLen: size_t,
1957     ) -> &'a DICompositeType;
1958 
LLVMRustDIBuilderCreateMemberType( Builder: &DIBuilder<'a>, Scope: &'a DIDescriptor, Name: *const c_char, NameLen: size_t, File: &'a DIFile, LineNo: c_uint, SizeInBits: u64, AlignInBits: u32, OffsetInBits: u64, Flags: DIFlags, Ty: &'a DIType, ) -> &'a DIDerivedType1959     pub fn LLVMRustDIBuilderCreateMemberType(
1960         Builder: &DIBuilder<'a>,
1961         Scope: &'a DIDescriptor,
1962         Name: *const c_char,
1963         NameLen: size_t,
1964         File: &'a DIFile,
1965         LineNo: c_uint,
1966         SizeInBits: u64,
1967         AlignInBits: u32,
1968         OffsetInBits: u64,
1969         Flags: DIFlags,
1970         Ty: &'a DIType,
1971     ) -> &'a DIDerivedType;
1972 
LLVMRustDIBuilderCreateVariantMemberType( Builder: &DIBuilder<'a>, Scope: &'a DIScope, Name: *const c_char, NameLen: size_t, File: &'a DIFile, LineNumber: c_uint, SizeInBits: u64, AlignInBits: u32, OffsetInBits: u64, Discriminant: Option<&'a Value>, Flags: DIFlags, Ty: &'a DIType, ) -> &'a DIType1973     pub fn LLVMRustDIBuilderCreateVariantMemberType(
1974         Builder: &DIBuilder<'a>,
1975         Scope: &'a DIScope,
1976         Name: *const c_char,
1977         NameLen: size_t,
1978         File: &'a DIFile,
1979         LineNumber: c_uint,
1980         SizeInBits: u64,
1981         AlignInBits: u32,
1982         OffsetInBits: u64,
1983         Discriminant: Option<&'a Value>,
1984         Flags: DIFlags,
1985         Ty: &'a DIType,
1986     ) -> &'a DIType;
1987 
LLVMRustDIBuilderCreateLexicalBlock( Builder: &DIBuilder<'a>, Scope: &'a DIScope, File: &'a DIFile, Line: c_uint, Col: c_uint, ) -> &'a DILexicalBlock1988     pub fn LLVMRustDIBuilderCreateLexicalBlock(
1989         Builder: &DIBuilder<'a>,
1990         Scope: &'a DIScope,
1991         File: &'a DIFile,
1992         Line: c_uint,
1993         Col: c_uint,
1994     ) -> &'a DILexicalBlock;
1995 
LLVMRustDIBuilderCreateLexicalBlockFile( Builder: &DIBuilder<'a>, Scope: &'a DIScope, File: &'a DIFile, ) -> &'a DILexicalBlock1996     pub fn LLVMRustDIBuilderCreateLexicalBlockFile(
1997         Builder: &DIBuilder<'a>,
1998         Scope: &'a DIScope,
1999         File: &'a DIFile,
2000     ) -> &'a DILexicalBlock;
2001 
LLVMRustDIBuilderCreateStaticVariable( Builder: &DIBuilder<'a>, Context: Option<&'a DIScope>, Name: *const c_char, NameLen: size_t, LinkageName: *const c_char, LinkageNameLen: size_t, File: &'a DIFile, LineNo: c_uint, Ty: &'a DIType, isLocalToUnit: bool, Val: &'a Value, Decl: Option<&'a DIDescriptor>, AlignInBits: u32, ) -> &'a DIGlobalVariableExpression2002     pub fn LLVMRustDIBuilderCreateStaticVariable(
2003         Builder: &DIBuilder<'a>,
2004         Context: Option<&'a DIScope>,
2005         Name: *const c_char,
2006         NameLen: size_t,
2007         LinkageName: *const c_char,
2008         LinkageNameLen: size_t,
2009         File: &'a DIFile,
2010         LineNo: c_uint,
2011         Ty: &'a DIType,
2012         isLocalToUnit: bool,
2013         Val: &'a Value,
2014         Decl: Option<&'a DIDescriptor>,
2015         AlignInBits: u32,
2016     ) -> &'a DIGlobalVariableExpression;
2017 
LLVMRustDIBuilderCreateVariable( Builder: &DIBuilder<'a>, Tag: c_uint, Scope: &'a DIDescriptor, Name: *const c_char, NameLen: size_t, File: &'a DIFile, LineNo: c_uint, Ty: &'a DIType, AlwaysPreserve: bool, Flags: DIFlags, ArgNo: c_uint, AlignInBits: u32, ) -> &'a DIVariable2018     pub fn LLVMRustDIBuilderCreateVariable(
2019         Builder: &DIBuilder<'a>,
2020         Tag: c_uint,
2021         Scope: &'a DIDescriptor,
2022         Name: *const c_char,
2023         NameLen: size_t,
2024         File: &'a DIFile,
2025         LineNo: c_uint,
2026         Ty: &'a DIType,
2027         AlwaysPreserve: bool,
2028         Flags: DIFlags,
2029         ArgNo: c_uint,
2030         AlignInBits: u32,
2031     ) -> &'a DIVariable;
2032 
LLVMRustDIBuilderCreateArrayType( Builder: &DIBuilder<'a>, Size: u64, AlignInBits: u32, Ty: &'a DIType, Subscripts: &'a DIArray, ) -> &'a DIType2033     pub fn LLVMRustDIBuilderCreateArrayType(
2034         Builder: &DIBuilder<'a>,
2035         Size: u64,
2036         AlignInBits: u32,
2037         Ty: &'a DIType,
2038         Subscripts: &'a DIArray,
2039     ) -> &'a DIType;
2040 
LLVMRustDIBuilderGetOrCreateSubrange( Builder: &DIBuilder<'a>, Lo: i64, Count: i64, ) -> &'a DISubrange2041     pub fn LLVMRustDIBuilderGetOrCreateSubrange(
2042         Builder: &DIBuilder<'a>,
2043         Lo: i64,
2044         Count: i64,
2045     ) -> &'a DISubrange;
2046 
LLVMRustDIBuilderGetOrCreateArray( Builder: &DIBuilder<'a>, Ptr: *const Option<&'a DIDescriptor>, Count: c_uint, ) -> &'a DIArray2047     pub fn LLVMRustDIBuilderGetOrCreateArray(
2048         Builder: &DIBuilder<'a>,
2049         Ptr: *const Option<&'a DIDescriptor>,
2050         Count: c_uint,
2051     ) -> &'a DIArray;
2052 
LLVMRustDIBuilderInsertDeclareAtEnd( Builder: &DIBuilder<'a>, Val: &'a Value, VarInfo: &'a DIVariable, AddrOps: *const i64, AddrOpsCount: c_uint, DL: &'a DILocation, InsertAtEnd: &'a BasicBlock, ) -> &'a Value2053     pub fn LLVMRustDIBuilderInsertDeclareAtEnd(
2054         Builder: &DIBuilder<'a>,
2055         Val: &'a Value,
2056         VarInfo: &'a DIVariable,
2057         AddrOps: *const i64,
2058         AddrOpsCount: c_uint,
2059         DL: &'a DILocation,
2060         InsertAtEnd: &'a BasicBlock,
2061     ) -> &'a Value;
2062 
LLVMRustDIBuilderCreateEnumerator( Builder: &DIBuilder<'a>, Name: *const c_char, NameLen: size_t, Value: i64, IsUnsigned: bool, ) -> &'a DIEnumerator2063     pub fn LLVMRustDIBuilderCreateEnumerator(
2064         Builder: &DIBuilder<'a>,
2065         Name: *const c_char,
2066         NameLen: size_t,
2067         Value: i64,
2068         IsUnsigned: bool,
2069     ) -> &'a DIEnumerator;
2070 
LLVMRustDIBuilderCreateEnumerationType( Builder: &DIBuilder<'a>, Scope: &'a DIScope, Name: *const c_char, NameLen: size_t, File: &'a DIFile, LineNumber: c_uint, SizeInBits: u64, AlignInBits: u32, Elements: &'a DIArray, ClassType: &'a DIType, IsScoped: bool, ) -> &'a DIType2071     pub fn LLVMRustDIBuilderCreateEnumerationType(
2072         Builder: &DIBuilder<'a>,
2073         Scope: &'a DIScope,
2074         Name: *const c_char,
2075         NameLen: size_t,
2076         File: &'a DIFile,
2077         LineNumber: c_uint,
2078         SizeInBits: u64,
2079         AlignInBits: u32,
2080         Elements: &'a DIArray,
2081         ClassType: &'a DIType,
2082         IsScoped: bool,
2083     ) -> &'a DIType;
2084 
LLVMRustDIBuilderCreateUnionType( Builder: &DIBuilder<'a>, Scope: Option<&'a DIScope>, Name: *const c_char, NameLen: size_t, File: &'a DIFile, LineNumber: c_uint, SizeInBits: u64, AlignInBits: u32, Flags: DIFlags, Elements: Option<&'a DIArray>, RunTimeLang: c_uint, UniqueId: *const c_char, UniqueIdLen: size_t, ) -> &'a DIType2085     pub fn LLVMRustDIBuilderCreateUnionType(
2086         Builder: &DIBuilder<'a>,
2087         Scope: Option<&'a DIScope>,
2088         Name: *const c_char,
2089         NameLen: size_t,
2090         File: &'a DIFile,
2091         LineNumber: c_uint,
2092         SizeInBits: u64,
2093         AlignInBits: u32,
2094         Flags: DIFlags,
2095         Elements: Option<&'a DIArray>,
2096         RunTimeLang: c_uint,
2097         UniqueId: *const c_char,
2098         UniqueIdLen: size_t,
2099     ) -> &'a DIType;
2100 
LLVMRustDIBuilderCreateVariantPart( Builder: &DIBuilder<'a>, Scope: &'a DIScope, Name: *const c_char, NameLen: size_t, File: &'a DIFile, LineNo: c_uint, SizeInBits: u64, AlignInBits: u32, Flags: DIFlags, Discriminator: Option<&'a DIDerivedType>, Elements: &'a DIArray, UniqueId: *const c_char, UniqueIdLen: size_t, ) -> &'a DIDerivedType2101     pub fn LLVMRustDIBuilderCreateVariantPart(
2102         Builder: &DIBuilder<'a>,
2103         Scope: &'a DIScope,
2104         Name: *const c_char,
2105         NameLen: size_t,
2106         File: &'a DIFile,
2107         LineNo: c_uint,
2108         SizeInBits: u64,
2109         AlignInBits: u32,
2110         Flags: DIFlags,
2111         Discriminator: Option<&'a DIDerivedType>,
2112         Elements: &'a DIArray,
2113         UniqueId: *const c_char,
2114         UniqueIdLen: size_t,
2115     ) -> &'a DIDerivedType;
2116 
LLVMSetUnnamedAddress(Global: &Value, UnnamedAddr: UnnamedAddr)2117     pub fn LLVMSetUnnamedAddress(Global: &Value, UnnamedAddr: UnnamedAddr);
2118 
LLVMRustDIBuilderCreateTemplateTypeParameter( Builder: &DIBuilder<'a>, Scope: Option<&'a DIScope>, Name: *const c_char, NameLen: size_t, Ty: &'a DIType, ) -> &'a DITemplateTypeParameter2119     pub fn LLVMRustDIBuilderCreateTemplateTypeParameter(
2120         Builder: &DIBuilder<'a>,
2121         Scope: Option<&'a DIScope>,
2122         Name: *const c_char,
2123         NameLen: size_t,
2124         Ty: &'a DIType,
2125     ) -> &'a DITemplateTypeParameter;
2126 
LLVMRustDIBuilderCreateNameSpace( Builder: &DIBuilder<'a>, Scope: Option<&'a DIScope>, Name: *const c_char, NameLen: size_t, ExportSymbols: bool, ) -> &'a DINameSpace2127     pub fn LLVMRustDIBuilderCreateNameSpace(
2128         Builder: &DIBuilder<'a>,
2129         Scope: Option<&'a DIScope>,
2130         Name: *const c_char,
2131         NameLen: size_t,
2132         ExportSymbols: bool,
2133     ) -> &'a DINameSpace;
2134 
LLVMRustDICompositeTypeReplaceArrays( Builder: &DIBuilder<'a>, CompositeType: &'a DIType, Elements: Option<&'a DIArray>, Params: Option<&'a DIArray>, )2135     pub fn LLVMRustDICompositeTypeReplaceArrays(
2136         Builder: &DIBuilder<'a>,
2137         CompositeType: &'a DIType,
2138         Elements: Option<&'a DIArray>,
2139         Params: Option<&'a DIArray>,
2140     );
2141 
LLVMRustDIBuilderCreateDebugLocation( Line: c_uint, Column: c_uint, Scope: &'a DIScope, InlinedAt: Option<&'a DILocation>, ) -> &'a DILocation2142     pub fn LLVMRustDIBuilderCreateDebugLocation(
2143         Line: c_uint,
2144         Column: c_uint,
2145         Scope: &'a DIScope,
2146         InlinedAt: Option<&'a DILocation>,
2147     ) -> &'a DILocation;
LLVMRustDIBuilderCreateOpDeref() -> i642148     pub fn LLVMRustDIBuilderCreateOpDeref() -> i64;
LLVMRustDIBuilderCreateOpPlusUconst() -> i642149     pub fn LLVMRustDIBuilderCreateOpPlusUconst() -> i64;
2150 
2151     #[allow(improper_ctypes)]
LLVMRustWriteTypeToString(Type: &Type, s: &RustString)2152     pub fn LLVMRustWriteTypeToString(Type: &Type, s: &RustString);
2153     #[allow(improper_ctypes)]
LLVMRustWriteValueToString(value_ref: &Value, s: &RustString)2154     pub fn LLVMRustWriteValueToString(value_ref: &Value, s: &RustString);
2155 
LLVMIsAConstantInt(value_ref: &Value) -> Option<&ConstantInt>2156     pub fn LLVMIsAConstantInt(value_ref: &Value) -> Option<&ConstantInt>;
2157 
LLVMRustPassKind(Pass: &Pass) -> PassKind2158     pub fn LLVMRustPassKind(Pass: &Pass) -> PassKind;
LLVMRustFindAndCreatePass(Pass: *const c_char) -> Option<&'static mut Pass>2159     pub fn LLVMRustFindAndCreatePass(Pass: *const c_char) -> Option<&'static mut Pass>;
LLVMRustCreateAddressSanitizerFunctionPass(Recover: bool) -> &'static mut Pass2160     pub fn LLVMRustCreateAddressSanitizerFunctionPass(Recover: bool) -> &'static mut Pass;
LLVMRustCreateModuleAddressSanitizerPass(Recover: bool) -> &'static mut Pass2161     pub fn LLVMRustCreateModuleAddressSanitizerPass(Recover: bool) -> &'static mut Pass;
LLVMRustCreateMemorySanitizerPass( TrackOrigins: c_int, Recover: bool, ) -> &'static mut Pass2162     pub fn LLVMRustCreateMemorySanitizerPass(
2163         TrackOrigins: c_int,
2164         Recover: bool,
2165     ) -> &'static mut Pass;
LLVMRustCreateThreadSanitizerPass() -> &'static mut Pass2166     pub fn LLVMRustCreateThreadSanitizerPass() -> &'static mut Pass;
LLVMRustCreateHWAddressSanitizerPass(Recover: bool) -> &'static mut Pass2167     pub fn LLVMRustCreateHWAddressSanitizerPass(Recover: bool) -> &'static mut Pass;
LLVMRustAddPass(PM: &PassManager<'_>, Pass: &'static mut Pass)2168     pub fn LLVMRustAddPass(PM: &PassManager<'_>, Pass: &'static mut Pass);
LLVMRustAddLastExtensionPasses( PMB: &PassManagerBuilder, Passes: *const &'static mut Pass, NumPasses: size_t, )2169     pub fn LLVMRustAddLastExtensionPasses(
2170         PMB: &PassManagerBuilder,
2171         Passes: *const &'static mut Pass,
2172         NumPasses: size_t,
2173     );
2174 
LLVMRustHasFeature(T: &TargetMachine, s: *const c_char) -> bool2175     pub fn LLVMRustHasFeature(T: &TargetMachine, s: *const c_char) -> bool;
2176 
LLVMRustPrintTargetCPUs(T: &TargetMachine)2177     pub fn LLVMRustPrintTargetCPUs(T: &TargetMachine);
LLVMRustGetTargetFeaturesCount(T: &TargetMachine) -> size_t2178     pub fn LLVMRustGetTargetFeaturesCount(T: &TargetMachine) -> size_t;
LLVMRustGetTargetFeature( T: &TargetMachine, Index: size_t, Feature: &mut *const c_char, Desc: &mut *const c_char, )2179     pub fn LLVMRustGetTargetFeature(
2180         T: &TargetMachine,
2181         Index: size_t,
2182         Feature: &mut *const c_char,
2183         Desc: &mut *const c_char,
2184     );
2185 
LLVMRustGetHostCPUName(len: *mut usize) -> *const c_char2186     pub fn LLVMRustGetHostCPUName(len: *mut usize) -> *const c_char;
LLVMRustCreateTargetMachine( Triple: *const c_char, CPU: *const c_char, Features: *const c_char, Abi: *const c_char, Model: CodeModel, Reloc: RelocModel, Level: CodeGenOptLevel, UseSoftFP: bool, FunctionSections: bool, DataSections: bool, UniqueSectionNames: bool, TrapUnreachable: bool, Singlethread: bool, AsmComments: bool, EmitStackSizeSection: bool, RelaxELFRelocations: bool, UseInitArray: bool, SplitDwarfFile: *const c_char, ) -> Option<&'static mut TargetMachine>2187     pub fn LLVMRustCreateTargetMachine(
2188         Triple: *const c_char,
2189         CPU: *const c_char,
2190         Features: *const c_char,
2191         Abi: *const c_char,
2192         Model: CodeModel,
2193         Reloc: RelocModel,
2194         Level: CodeGenOptLevel,
2195         UseSoftFP: bool,
2196         FunctionSections: bool,
2197         DataSections: bool,
2198         UniqueSectionNames: bool,
2199         TrapUnreachable: bool,
2200         Singlethread: bool,
2201         AsmComments: bool,
2202         EmitStackSizeSection: bool,
2203         RelaxELFRelocations: bool,
2204         UseInitArray: bool,
2205         SplitDwarfFile: *const c_char,
2206     ) -> Option<&'static mut TargetMachine>;
LLVMRustDisposeTargetMachine(T: &'static mut TargetMachine)2207     pub fn LLVMRustDisposeTargetMachine(T: &'static mut TargetMachine);
LLVMRustAddBuilderLibraryInfo( PMB: &'a PassManagerBuilder, M: &'a Module, DisableSimplifyLibCalls: bool, )2208     pub fn LLVMRustAddBuilderLibraryInfo(
2209         PMB: &'a PassManagerBuilder,
2210         M: &'a Module,
2211         DisableSimplifyLibCalls: bool,
2212     );
LLVMRustConfigurePassManagerBuilder( PMB: &PassManagerBuilder, OptLevel: CodeGenOptLevel, MergeFunctions: bool, SLPVectorize: bool, LoopVectorize: bool, PrepareForThinLTO: bool, PGOGenPath: *const c_char, PGOUsePath: *const c_char, PGOSampleUsePath: *const c_char, )2213     pub fn LLVMRustConfigurePassManagerBuilder(
2214         PMB: &PassManagerBuilder,
2215         OptLevel: CodeGenOptLevel,
2216         MergeFunctions: bool,
2217         SLPVectorize: bool,
2218         LoopVectorize: bool,
2219         PrepareForThinLTO: bool,
2220         PGOGenPath: *const c_char,
2221         PGOUsePath: *const c_char,
2222         PGOSampleUsePath: *const c_char,
2223     );
LLVMRustAddLibraryInfo( PM: &PassManager<'a>, M: &'a Module, DisableSimplifyLibCalls: bool, )2224     pub fn LLVMRustAddLibraryInfo(
2225         PM: &PassManager<'a>,
2226         M: &'a Module,
2227         DisableSimplifyLibCalls: bool,
2228     );
LLVMRustRunFunctionPassManager(PM: &PassManager<'a>, M: &'a Module)2229     pub fn LLVMRustRunFunctionPassManager(PM: &PassManager<'a>, M: &'a Module);
LLVMRustWriteOutputFile( T: &'a TargetMachine, PM: &PassManager<'a>, M: &'a Module, Output: *const c_char, DwoOutput: *const c_char, FileType: FileType, ) -> LLVMRustResult2230     pub fn LLVMRustWriteOutputFile(
2231         T: &'a TargetMachine,
2232         PM: &PassManager<'a>,
2233         M: &'a Module,
2234         Output: *const c_char,
2235         DwoOutput: *const c_char,
2236         FileType: FileType,
2237     ) -> LLVMRustResult;
LLVMRustOptimizeWithNewPassManager( M: &'a Module, TM: &'a TargetMachine, OptLevel: PassBuilderOptLevel, OptStage: OptStage, NoPrepopulatePasses: bool, VerifyIR: bool, UseThinLTOBuffers: bool, MergeFunctions: bool, UnrollLoops: bool, SLPVectorize: bool, LoopVectorize: bool, DisableSimplifyLibCalls: bool, EmitLifetimeMarkers: bool, SanitizerOptions: Option<&SanitizerOptions>, PGOGenPath: *const c_char, PGOUsePath: *const c_char, InstrumentCoverage: bool, InstrumentGCOV: bool, PGOSampleUsePath: *const c_char, DebugInfoForProfiling: bool, llvm_selfprofiler: *mut c_void, begin_callback: SelfProfileBeforePassCallback, end_callback: SelfProfileAfterPassCallback, ExtraPasses: *const c_char, ExtraPassesLen: size_t, ) -> LLVMRustResult2238     pub fn LLVMRustOptimizeWithNewPassManager(
2239         M: &'a Module,
2240         TM: &'a TargetMachine,
2241         OptLevel: PassBuilderOptLevel,
2242         OptStage: OptStage,
2243         NoPrepopulatePasses: bool,
2244         VerifyIR: bool,
2245         UseThinLTOBuffers: bool,
2246         MergeFunctions: bool,
2247         UnrollLoops: bool,
2248         SLPVectorize: bool,
2249         LoopVectorize: bool,
2250         DisableSimplifyLibCalls: bool,
2251         EmitLifetimeMarkers: bool,
2252         SanitizerOptions: Option<&SanitizerOptions>,
2253         PGOGenPath: *const c_char,
2254         PGOUsePath: *const c_char,
2255         InstrumentCoverage: bool,
2256         InstrumentGCOV: bool,
2257         PGOSampleUsePath: *const c_char,
2258         DebugInfoForProfiling: bool,
2259         llvm_selfprofiler: *mut c_void,
2260         begin_callback: SelfProfileBeforePassCallback,
2261         end_callback: SelfProfileAfterPassCallback,
2262         ExtraPasses: *const c_char,
2263         ExtraPassesLen: size_t,
2264     ) -> LLVMRustResult;
LLVMRustPrintModule( M: &'a Module, Output: *const c_char, Demangle: extern "C" fn(*const c_char, size_t, *mut c_char, size_t) -> size_t, ) -> LLVMRustResult2265     pub fn LLVMRustPrintModule(
2266         M: &'a Module,
2267         Output: *const c_char,
2268         Demangle: extern "C" fn(*const c_char, size_t, *mut c_char, size_t) -> size_t,
2269     ) -> LLVMRustResult;
LLVMRustSetLLVMOptions(Argc: c_int, Argv: *const *const c_char)2270     pub fn LLVMRustSetLLVMOptions(Argc: c_int, Argv: *const *const c_char);
LLVMRustPrintPasses()2271     pub fn LLVMRustPrintPasses();
LLVMRustGetInstructionCount(M: &Module) -> u322272     pub fn LLVMRustGetInstructionCount(M: &Module) -> u32;
LLVMRustSetNormalizedTarget(M: &Module, triple: *const c_char)2273     pub fn LLVMRustSetNormalizedTarget(M: &Module, triple: *const c_char);
LLVMRustAddAlwaysInlinePass(P: &PassManagerBuilder, AddLifetimes: bool)2274     pub fn LLVMRustAddAlwaysInlinePass(P: &PassManagerBuilder, AddLifetimes: bool);
LLVMRustRunRestrictionPass(M: &Module, syms: *const *const c_char, len: size_t)2275     pub fn LLVMRustRunRestrictionPass(M: &Module, syms: *const *const c_char, len: size_t);
LLVMRustMarkAllFunctionsNounwind(M: &Module)2276     pub fn LLVMRustMarkAllFunctionsNounwind(M: &Module);
2277 
LLVMRustOpenArchive(path: *const c_char) -> Option<&'static mut Archive>2278     pub fn LLVMRustOpenArchive(path: *const c_char) -> Option<&'static mut Archive>;
LLVMRustArchiveIteratorNew(AR: &'a Archive) -> &'a mut ArchiveIterator<'a>2279     pub fn LLVMRustArchiveIteratorNew(AR: &'a Archive) -> &'a mut ArchiveIterator<'a>;
LLVMRustArchiveIteratorNext( AIR: &ArchiveIterator<'a>, ) -> Option<&'a mut ArchiveChild<'a>>2280     pub fn LLVMRustArchiveIteratorNext(
2281         AIR: &ArchiveIterator<'a>,
2282     ) -> Option<&'a mut ArchiveChild<'a>>;
LLVMRustArchiveChildName(ACR: &ArchiveChild<'_>, size: &mut size_t) -> *const c_char2283     pub fn LLVMRustArchiveChildName(ACR: &ArchiveChild<'_>, size: &mut size_t) -> *const c_char;
LLVMRustArchiveChildData(ACR: &ArchiveChild<'_>, size: &mut size_t) -> *const c_char2284     pub fn LLVMRustArchiveChildData(ACR: &ArchiveChild<'_>, size: &mut size_t) -> *const c_char;
LLVMRustArchiveChildFree(ACR: &'a mut ArchiveChild<'a>)2285     pub fn LLVMRustArchiveChildFree(ACR: &'a mut ArchiveChild<'a>);
LLVMRustArchiveIteratorFree(AIR: &'a mut ArchiveIterator<'a>)2286     pub fn LLVMRustArchiveIteratorFree(AIR: &'a mut ArchiveIterator<'a>);
LLVMRustDestroyArchive(AR: &'static mut Archive)2287     pub fn LLVMRustDestroyArchive(AR: &'static mut Archive);
2288 
2289     #[allow(improper_ctypes)]
LLVMRustWriteTwineToString(T: &Twine, s: &RustString)2290     pub fn LLVMRustWriteTwineToString(T: &Twine, s: &RustString);
2291 
LLVMContextSetDiagnosticHandler( C: &Context, Handler: DiagnosticHandler, DiagnosticContext: *mut c_void, )2292     pub fn LLVMContextSetDiagnosticHandler(
2293         C: &Context,
2294         Handler: DiagnosticHandler,
2295         DiagnosticContext: *mut c_void,
2296     );
2297 
2298     #[allow(improper_ctypes)]
LLVMRustUnpackOptimizationDiagnostic( DI: &'a DiagnosticInfo, pass_name_out: &RustString, function_out: &mut Option<&'a Value>, loc_line_out: &mut c_uint, loc_column_out: &mut c_uint, loc_filename_out: &RustString, message_out: &RustString, )2299     pub fn LLVMRustUnpackOptimizationDiagnostic(
2300         DI: &'a DiagnosticInfo,
2301         pass_name_out: &RustString,
2302         function_out: &mut Option<&'a Value>,
2303         loc_line_out: &mut c_uint,
2304         loc_column_out: &mut c_uint,
2305         loc_filename_out: &RustString,
2306         message_out: &RustString,
2307     );
2308 
LLVMRustUnpackInlineAsmDiagnostic( DI: &'a DiagnosticInfo, level_out: &mut DiagnosticLevel, cookie_out: &mut c_uint, message_out: &mut Option<&'a Twine>, )2309     pub fn LLVMRustUnpackInlineAsmDiagnostic(
2310         DI: &'a DiagnosticInfo,
2311         level_out: &mut DiagnosticLevel,
2312         cookie_out: &mut c_uint,
2313         message_out: &mut Option<&'a Twine>,
2314     );
2315 
2316     #[allow(improper_ctypes)]
LLVMRustWriteDiagnosticInfoToString(DI: &DiagnosticInfo, s: &RustString)2317     pub fn LLVMRustWriteDiagnosticInfoToString(DI: &DiagnosticInfo, s: &RustString);
LLVMRustGetDiagInfoKind(DI: &DiagnosticInfo) -> DiagnosticKind2318     pub fn LLVMRustGetDiagInfoKind(DI: &DiagnosticInfo) -> DiagnosticKind;
2319 
LLVMRustGetSMDiagnostic( DI: &'a DiagnosticInfo, cookie_out: &mut c_uint, ) -> &'a SMDiagnostic2320     pub fn LLVMRustGetSMDiagnostic(
2321         DI: &'a DiagnosticInfo,
2322         cookie_out: &mut c_uint,
2323     ) -> &'a SMDiagnostic;
2324 
LLVMRustSetInlineAsmDiagnosticHandler( C: &Context, H: InlineAsmDiagHandler, CX: *mut c_void, )2325     pub fn LLVMRustSetInlineAsmDiagnosticHandler(
2326         C: &Context,
2327         H: InlineAsmDiagHandler,
2328         CX: *mut c_void,
2329     );
2330 
2331     #[allow(improper_ctypes)]
LLVMRustUnpackSMDiagnostic( d: &SMDiagnostic, message_out: &RustString, buffer_out: &RustString, level_out: &mut DiagnosticLevel, loc_out: &mut c_uint, ranges_out: *mut c_uint, num_ranges: &mut usize, ) -> bool2332     pub fn LLVMRustUnpackSMDiagnostic(
2333         d: &SMDiagnostic,
2334         message_out: &RustString,
2335         buffer_out: &RustString,
2336         level_out: &mut DiagnosticLevel,
2337         loc_out: &mut c_uint,
2338         ranges_out: *mut c_uint,
2339         num_ranges: &mut usize,
2340     ) -> bool;
2341 
LLVMRustWriteArchive( Dst: *const c_char, NumMembers: size_t, Members: *const &RustArchiveMember<'_>, WriteSymbtab: bool, Kind: ArchiveKind, ) -> LLVMRustResult2342     pub fn LLVMRustWriteArchive(
2343         Dst: *const c_char,
2344         NumMembers: size_t,
2345         Members: *const &RustArchiveMember<'_>,
2346         WriteSymbtab: bool,
2347         Kind: ArchiveKind,
2348     ) -> LLVMRustResult;
LLVMRustArchiveMemberNew( Filename: *const c_char, Name: *const c_char, Child: Option<&ArchiveChild<'a>>, ) -> &'a mut RustArchiveMember<'a>2349     pub fn LLVMRustArchiveMemberNew(
2350         Filename: *const c_char,
2351         Name: *const c_char,
2352         Child: Option<&ArchiveChild<'a>>,
2353     ) -> &'a mut RustArchiveMember<'a>;
LLVMRustArchiveMemberFree(Member: &'a mut RustArchiveMember<'a>)2354     pub fn LLVMRustArchiveMemberFree(Member: &'a mut RustArchiveMember<'a>);
2355 
LLVMRustWriteImportLibrary( ImportName: *const c_char, Path: *const c_char, Exports: *const LLVMRustCOFFShortExport, NumExports: usize, Machine: u16, MinGW: bool, ) -> LLVMRustResult2356     pub fn LLVMRustWriteImportLibrary(
2357         ImportName: *const c_char,
2358         Path: *const c_char,
2359         Exports: *const LLVMRustCOFFShortExport,
2360         NumExports: usize,
2361         Machine: u16,
2362         MinGW: bool,
2363     ) -> LLVMRustResult;
2364 
LLVMRustSetDataLayoutFromTargetMachine(M: &'a Module, TM: &'a TargetMachine)2365     pub fn LLVMRustSetDataLayoutFromTargetMachine(M: &'a Module, TM: &'a TargetMachine);
2366 
LLVMRustBuildOperandBundleDef( Name: *const c_char, Inputs: *const &'a Value, NumInputs: c_uint, ) -> &'a mut OperandBundleDef<'a>2367     pub fn LLVMRustBuildOperandBundleDef(
2368         Name: *const c_char,
2369         Inputs: *const &'a Value,
2370         NumInputs: c_uint,
2371     ) -> &'a mut OperandBundleDef<'a>;
LLVMRustFreeOperandBundleDef(Bundle: &'a mut OperandBundleDef<'a>)2372     pub fn LLVMRustFreeOperandBundleDef(Bundle: &'a mut OperandBundleDef<'a>);
2373 
LLVMRustPositionBuilderAtStart(B: &Builder<'a>, BB: &'a BasicBlock)2374     pub fn LLVMRustPositionBuilderAtStart(B: &Builder<'a>, BB: &'a BasicBlock);
2375 
LLVMRustSetComdat(M: &'a Module, V: &'a Value, Name: *const c_char, NameLen: size_t)2376     pub fn LLVMRustSetComdat(M: &'a Module, V: &'a Value, Name: *const c_char, NameLen: size_t);
LLVMRustUnsetComdat(V: &Value)2377     pub fn LLVMRustUnsetComdat(V: &Value);
LLVMRustSetModulePICLevel(M: &Module)2378     pub fn LLVMRustSetModulePICLevel(M: &Module);
LLVMRustSetModulePIELevel(M: &Module)2379     pub fn LLVMRustSetModulePIELevel(M: &Module);
LLVMRustSetModuleCodeModel(M: &Module, Model: CodeModel)2380     pub fn LLVMRustSetModuleCodeModel(M: &Module, Model: CodeModel);
LLVMRustModuleBufferCreate(M: &Module) -> &'static mut ModuleBuffer2381     pub fn LLVMRustModuleBufferCreate(M: &Module) -> &'static mut ModuleBuffer;
LLVMRustModuleBufferPtr(p: &ModuleBuffer) -> *const u82382     pub fn LLVMRustModuleBufferPtr(p: &ModuleBuffer) -> *const u8;
LLVMRustModuleBufferLen(p: &ModuleBuffer) -> usize2383     pub fn LLVMRustModuleBufferLen(p: &ModuleBuffer) -> usize;
LLVMRustModuleBufferFree(p: &'static mut ModuleBuffer)2384     pub fn LLVMRustModuleBufferFree(p: &'static mut ModuleBuffer);
LLVMRustModuleCost(M: &Module) -> u642385     pub fn LLVMRustModuleCost(M: &Module) -> u64;
2386 
LLVMRustThinLTOBufferCreate(M: &Module) -> &'static mut ThinLTOBuffer2387     pub fn LLVMRustThinLTOBufferCreate(M: &Module) -> &'static mut ThinLTOBuffer;
LLVMRustThinLTOBufferFree(M: &'static mut ThinLTOBuffer)2388     pub fn LLVMRustThinLTOBufferFree(M: &'static mut ThinLTOBuffer);
LLVMRustThinLTOBufferPtr(M: &ThinLTOBuffer) -> *const c_char2389     pub fn LLVMRustThinLTOBufferPtr(M: &ThinLTOBuffer) -> *const c_char;
LLVMRustThinLTOBufferLen(M: &ThinLTOBuffer) -> size_t2390     pub fn LLVMRustThinLTOBufferLen(M: &ThinLTOBuffer) -> size_t;
LLVMRustCreateThinLTOData( Modules: *const ThinLTOModule, NumModules: c_uint, PreservedSymbols: *const *const c_char, PreservedSymbolsLen: c_uint, ) -> Option<&'static mut ThinLTOData>2391     pub fn LLVMRustCreateThinLTOData(
2392         Modules: *const ThinLTOModule,
2393         NumModules: c_uint,
2394         PreservedSymbols: *const *const c_char,
2395         PreservedSymbolsLen: c_uint,
2396     ) -> Option<&'static mut ThinLTOData>;
LLVMRustPrepareThinLTORename( Data: &ThinLTOData, Module: &Module, Target: &TargetMachine, ) -> bool2397     pub fn LLVMRustPrepareThinLTORename(
2398         Data: &ThinLTOData,
2399         Module: &Module,
2400         Target: &TargetMachine,
2401     ) -> bool;
LLVMRustPrepareThinLTOResolveWeak(Data: &ThinLTOData, Module: &Module) -> bool2402     pub fn LLVMRustPrepareThinLTOResolveWeak(Data: &ThinLTOData, Module: &Module) -> bool;
LLVMRustPrepareThinLTOInternalize(Data: &ThinLTOData, Module: &Module) -> bool2403     pub fn LLVMRustPrepareThinLTOInternalize(Data: &ThinLTOData, Module: &Module) -> bool;
LLVMRustPrepareThinLTOImport( Data: &ThinLTOData, Module: &Module, Target: &TargetMachine, ) -> bool2404     pub fn LLVMRustPrepareThinLTOImport(
2405         Data: &ThinLTOData,
2406         Module: &Module,
2407         Target: &TargetMachine,
2408     ) -> bool;
LLVMRustGetThinLTOModuleImports( Data: *const ThinLTOData, ModuleNameCallback: ThinLTOModuleNameCallback, CallbackPayload: *mut c_void, )2409     pub fn LLVMRustGetThinLTOModuleImports(
2410         Data: *const ThinLTOData,
2411         ModuleNameCallback: ThinLTOModuleNameCallback,
2412         CallbackPayload: *mut c_void,
2413     );
LLVMRustFreeThinLTOData(Data: &'static mut ThinLTOData)2414     pub fn LLVMRustFreeThinLTOData(Data: &'static mut ThinLTOData);
LLVMRustParseBitcodeForLTO( Context: &Context, Data: *const u8, len: usize, Identifier: *const c_char, ) -> Option<&Module>2415     pub fn LLVMRustParseBitcodeForLTO(
2416         Context: &Context,
2417         Data: *const u8,
2418         len: usize,
2419         Identifier: *const c_char,
2420     ) -> Option<&Module>;
LLVMRustGetBitcodeSliceFromObjectData( Data: *const u8, len: usize, out_len: &mut usize, ) -> *const u82421     pub fn LLVMRustGetBitcodeSliceFromObjectData(
2422         Data: *const u8,
2423         len: usize,
2424         out_len: &mut usize,
2425     ) -> *const u8;
LLVMRustLTOGetDICompileUnit(M: &Module, CU1: &mut *mut c_void, CU2: &mut *mut c_void)2426     pub fn LLVMRustLTOGetDICompileUnit(M: &Module, CU1: &mut *mut c_void, CU2: &mut *mut c_void);
LLVMRustLTOPatchDICompileUnit(M: &Module, CU: *mut c_void)2427     pub fn LLVMRustLTOPatchDICompileUnit(M: &Module, CU: *mut c_void);
2428 
LLVMRustLinkerNew(M: &'a Module) -> &'a mut Linker<'a>2429     pub fn LLVMRustLinkerNew(M: &'a Module) -> &'a mut Linker<'a>;
LLVMRustLinkerAdd( linker: &Linker<'_>, bytecode: *const c_char, bytecode_len: usize, ) -> bool2430     pub fn LLVMRustLinkerAdd(
2431         linker: &Linker<'_>,
2432         bytecode: *const c_char,
2433         bytecode_len: usize,
2434     ) -> bool;
LLVMRustLinkerFree(linker: &'a mut Linker<'a>)2435     pub fn LLVMRustLinkerFree(linker: &'a mut Linker<'a>);
2436     #[allow(improper_ctypes)]
LLVMRustComputeLTOCacheKey( key_out: &RustString, mod_id: *const c_char, data: &ThinLTOData, )2437     pub fn LLVMRustComputeLTOCacheKey(
2438         key_out: &RustString,
2439         mod_id: *const c_char,
2440         data: &ThinLTOData,
2441     );
2442 }
2443