1 #![allow(non_camel_case_types)] 2 #![allow(non_upper_case_globals)] 3 4 use crate::coverageinfo::map_data 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 /// LLVM's Module::ModFlagBehavior, defined in llvm/include/llvm/IR/Module.h. 65 /// 66 /// When merging modules (e.g. during LTO), their metadata flags are combined. Conflicts are 67 /// resolved according to the merge behaviors specified here. Flags differing only in merge 68 /// behavior are still considered to be in conflict. 69 /// 70 /// In order for Rust-C LTO to work, we must specify behaviors compatible with Clang. Notably, 71 /// 'Error' and 'Warning' cannot be mixed for a given flag. 72 #[derive(Copy, Clone, PartialEq)] 73 #[repr(C)] 74 pub enum LLVMModFlagBehavior { 75 Error = 1, 76 Warning = 2, 77 Require = 3, 78 Override = 4, 79 Append = 5, 80 AppendUnique = 6, 81 Max = 7, 82 Min = 8, 83 } 84 85 // Consts for the LLVM CallConv type, pre-cast to usize. 86 87 /// LLVM CallingConv::ID. Should we wrap this? 88 #[derive(Copy, Clone, PartialEq, Debug)] 89 #[repr(C)] 90 pub enum CallConv { 91 CCallConv = 0, 92 FastCallConv = 8, 93 ColdCallConv = 9, 94 X86StdcallCallConv = 64, 95 X86FastcallCallConv = 65, 96 ArmAapcsCallConv = 67, 97 Msp430Intr = 69, 98 X86_ThisCall = 70, 99 PtxKernel = 71, 100 X86_64_SysV = 78, 101 X86_64_Win64 = 79, 102 X86_VectorCall = 80, 103 X86_Intr = 83, 104 AvrNonBlockingInterrupt = 84, 105 AvrInterrupt = 85, 106 AmdGpuKernel = 91, 107 } 108 109 /// LLVMRustLinkage 110 #[derive(Copy, Clone, PartialEq)] 111 #[repr(C)] 112 pub enum Linkage { 113 ExternalLinkage = 0, 114 AvailableExternallyLinkage = 1, 115 LinkOnceAnyLinkage = 2, 116 LinkOnceODRLinkage = 3, 117 WeakAnyLinkage = 4, 118 WeakODRLinkage = 5, 119 AppendingLinkage = 6, 120 InternalLinkage = 7, 121 PrivateLinkage = 8, 122 ExternalWeakLinkage = 9, 123 CommonLinkage = 10, 124 } 125 126 // LLVMRustVisibility 127 #[repr(C)] 128 #[derive(Copy, Clone, PartialEq)] 129 pub enum Visibility { 130 Default = 0, 131 Hidden = 1, 132 Protected = 2, 133 } 134 135 /// LLVMUnnamedAddr 136 #[repr(C)] 137 pub enum UnnamedAddr { 138 No, 139 Local, 140 Global, 141 } 142 143 /// LLVMDLLStorageClass 144 #[derive(Copy, Clone)] 145 #[repr(C)] 146 pub enum DLLStorageClass { 147 #[allow(dead_code)] 148 Default = 0, 149 DllImport = 1, // Function to be imported from DLL. 150 #[allow(dead_code)] 151 DllExport = 2, // Function to be accessible from DLL. 152 } 153 154 /// Matches LLVMRustAttribute in LLVMWrapper.h 155 /// Semantically a subset of the C++ enum llvm::Attribute::AttrKind, 156 /// though it is not ABI compatible (since it's a C++ enum) 157 #[repr(C)] 158 #[derive(Copy, Clone, Debug)] 159 pub enum AttributeKind { 160 AlwaysInline = 0, 161 ByVal = 1, 162 Cold = 2, 163 InlineHint = 3, 164 MinSize = 4, 165 Naked = 5, 166 NoAlias = 6, 167 NoCapture = 7, 168 NoInline = 8, 169 NonNull = 9, 170 NoRedZone = 10, 171 NoReturn = 11, 172 NoUnwind = 12, 173 OptimizeForSize = 13, 174 ReadOnly = 14, 175 SExt = 15, 176 StructRet = 16, 177 UWTable = 17, 178 ZExt = 18, 179 InReg = 19, 180 SanitizeThread = 20, 181 SanitizeAddress = 21, 182 SanitizeMemory = 22, 183 NonLazyBind = 23, 184 OptimizeNone = 24, 185 ReturnsTwice = 25, 186 ReadNone = 26, 187 SanitizeHWAddress = 28, 188 WillReturn = 29, 189 StackProtectReq = 30, 190 StackProtectStrong = 31, 191 StackProtect = 32, 192 NoUndef = 33, 193 SanitizeMemTag = 34, 194 NoCfCheck = 35, 195 ShadowCallStack = 36, 196 AllocSize = 37, 197 AllocatedPointer = 38, 198 AllocAlign = 39, 199 SanitizeSafeStack = 40, 200 } 201 202 /// LLVMIntPredicate 203 #[derive(Copy, Clone)] 204 #[repr(C)] 205 pub enum IntPredicate { 206 IntEQ = 32, 207 IntNE = 33, 208 IntUGT = 34, 209 IntUGE = 35, 210 IntULT = 36, 211 IntULE = 37, 212 IntSGT = 38, 213 IntSGE = 39, 214 IntSLT = 40, 215 IntSLE = 41, 216 } 217 218 impl IntPredicate { from_generic(intpre: rustc_codegen_ssa::common::IntPredicate) -> Self219 pub fn from_generic(intpre: rustc_codegen_ssa::common::IntPredicate) -> Self { 220 match intpre { 221 rustc_codegen_ssa::common::IntPredicate::IntEQ => IntPredicate::IntEQ, 222 rustc_codegen_ssa::common::IntPredicate::IntNE => IntPredicate::IntNE, 223 rustc_codegen_ssa::common::IntPredicate::IntUGT => IntPredicate::IntUGT, 224 rustc_codegen_ssa::common::IntPredicate::IntUGE => IntPredicate::IntUGE, 225 rustc_codegen_ssa::common::IntPredicate::IntULT => IntPredicate::IntULT, 226 rustc_codegen_ssa::common::IntPredicate::IntULE => IntPredicate::IntULE, 227 rustc_codegen_ssa::common::IntPredicate::IntSGT => IntPredicate::IntSGT, 228 rustc_codegen_ssa::common::IntPredicate::IntSGE => IntPredicate::IntSGE, 229 rustc_codegen_ssa::common::IntPredicate::IntSLT => IntPredicate::IntSLT, 230 rustc_codegen_ssa::common::IntPredicate::IntSLE => IntPredicate::IntSLE, 231 } 232 } 233 } 234 235 /// LLVMRealPredicate 236 #[derive(Copy, Clone)] 237 #[repr(C)] 238 pub enum RealPredicate { 239 RealPredicateFalse = 0, 240 RealOEQ = 1, 241 RealOGT = 2, 242 RealOGE = 3, 243 RealOLT = 4, 244 RealOLE = 5, 245 RealONE = 6, 246 RealORD = 7, 247 RealUNO = 8, 248 RealUEQ = 9, 249 RealUGT = 10, 250 RealUGE = 11, 251 RealULT = 12, 252 RealULE = 13, 253 RealUNE = 14, 254 RealPredicateTrue = 15, 255 } 256 257 impl RealPredicate { from_generic(realp: rustc_codegen_ssa::common::RealPredicate) -> Self258 pub fn from_generic(realp: rustc_codegen_ssa::common::RealPredicate) -> Self { 259 match realp { 260 rustc_codegen_ssa::common::RealPredicate::RealPredicateFalse => { 261 RealPredicate::RealPredicateFalse 262 } 263 rustc_codegen_ssa::common::RealPredicate::RealOEQ => RealPredicate::RealOEQ, 264 rustc_codegen_ssa::common::RealPredicate::RealOGT => RealPredicate::RealOGT, 265 rustc_codegen_ssa::common::RealPredicate::RealOGE => RealPredicate::RealOGE, 266 rustc_codegen_ssa::common::RealPredicate::RealOLT => RealPredicate::RealOLT, 267 rustc_codegen_ssa::common::RealPredicate::RealOLE => RealPredicate::RealOLE, 268 rustc_codegen_ssa::common::RealPredicate::RealONE => RealPredicate::RealONE, 269 rustc_codegen_ssa::common::RealPredicate::RealORD => RealPredicate::RealORD, 270 rustc_codegen_ssa::common::RealPredicate::RealUNO => RealPredicate::RealUNO, 271 rustc_codegen_ssa::common::RealPredicate::RealUEQ => RealPredicate::RealUEQ, 272 rustc_codegen_ssa::common::RealPredicate::RealUGT => RealPredicate::RealUGT, 273 rustc_codegen_ssa::common::RealPredicate::RealUGE => RealPredicate::RealUGE, 274 rustc_codegen_ssa::common::RealPredicate::RealULT => RealPredicate::RealULT, 275 rustc_codegen_ssa::common::RealPredicate::RealULE => RealPredicate::RealULE, 276 rustc_codegen_ssa::common::RealPredicate::RealUNE => RealPredicate::RealUNE, 277 rustc_codegen_ssa::common::RealPredicate::RealPredicateTrue => { 278 RealPredicate::RealPredicateTrue 279 } 280 } 281 } 282 } 283 284 /// LLVMTypeKind 285 #[derive(Copy, Clone, PartialEq, Debug)] 286 #[repr(C)] 287 pub enum TypeKind { 288 Void = 0, 289 Half = 1, 290 Float = 2, 291 Double = 3, 292 X86_FP80 = 4, 293 FP128 = 5, 294 PPC_FP128 = 6, 295 Label = 7, 296 Integer = 8, 297 Function = 9, 298 Struct = 10, 299 Array = 11, 300 Pointer = 12, 301 Vector = 13, 302 Metadata = 14, 303 X86_MMX = 15, 304 Token = 16, 305 ScalableVector = 17, 306 BFloat = 18, 307 X86_AMX = 19, 308 } 309 310 impl TypeKind { to_generic(self) -> rustc_codegen_ssa::common::TypeKind311 pub fn to_generic(self) -> rustc_codegen_ssa::common::TypeKind { 312 match self { 313 TypeKind::Void => rustc_codegen_ssa::common::TypeKind::Void, 314 TypeKind::Half => rustc_codegen_ssa::common::TypeKind::Half, 315 TypeKind::Float => rustc_codegen_ssa::common::TypeKind::Float, 316 TypeKind::Double => rustc_codegen_ssa::common::TypeKind::Double, 317 TypeKind::X86_FP80 => rustc_codegen_ssa::common::TypeKind::X86_FP80, 318 TypeKind::FP128 => rustc_codegen_ssa::common::TypeKind::FP128, 319 TypeKind::PPC_FP128 => rustc_codegen_ssa::common::TypeKind::PPC_FP128, 320 TypeKind::Label => rustc_codegen_ssa::common::TypeKind::Label, 321 TypeKind::Integer => rustc_codegen_ssa::common::TypeKind::Integer, 322 TypeKind::Function => rustc_codegen_ssa::common::TypeKind::Function, 323 TypeKind::Struct => rustc_codegen_ssa::common::TypeKind::Struct, 324 TypeKind::Array => rustc_codegen_ssa::common::TypeKind::Array, 325 TypeKind::Pointer => rustc_codegen_ssa::common::TypeKind::Pointer, 326 TypeKind::Vector => rustc_codegen_ssa::common::TypeKind::Vector, 327 TypeKind::Metadata => rustc_codegen_ssa::common::TypeKind::Metadata, 328 TypeKind::X86_MMX => rustc_codegen_ssa::common::TypeKind::X86_MMX, 329 TypeKind::Token => rustc_codegen_ssa::common::TypeKind::Token, 330 TypeKind::ScalableVector => rustc_codegen_ssa::common::TypeKind::ScalableVector, 331 TypeKind::BFloat => rustc_codegen_ssa::common::TypeKind::BFloat, 332 TypeKind::X86_AMX => rustc_codegen_ssa::common::TypeKind::X86_AMX, 333 } 334 } 335 } 336 337 /// LLVMAtomicRmwBinOp 338 #[derive(Copy, Clone)] 339 #[repr(C)] 340 pub enum AtomicRmwBinOp { 341 AtomicXchg = 0, 342 AtomicAdd = 1, 343 AtomicSub = 2, 344 AtomicAnd = 3, 345 AtomicNand = 4, 346 AtomicOr = 5, 347 AtomicXor = 6, 348 AtomicMax = 7, 349 AtomicMin = 8, 350 AtomicUMax = 9, 351 AtomicUMin = 10, 352 } 353 354 impl AtomicRmwBinOp { from_generic(op: rustc_codegen_ssa::common::AtomicRmwBinOp) -> Self355 pub fn from_generic(op: rustc_codegen_ssa::common::AtomicRmwBinOp) -> Self { 356 match op { 357 rustc_codegen_ssa::common::AtomicRmwBinOp::AtomicXchg => AtomicRmwBinOp::AtomicXchg, 358 rustc_codegen_ssa::common::AtomicRmwBinOp::AtomicAdd => AtomicRmwBinOp::AtomicAdd, 359 rustc_codegen_ssa::common::AtomicRmwBinOp::AtomicSub => AtomicRmwBinOp::AtomicSub, 360 rustc_codegen_ssa::common::AtomicRmwBinOp::AtomicAnd => AtomicRmwBinOp::AtomicAnd, 361 rustc_codegen_ssa::common::AtomicRmwBinOp::AtomicNand => AtomicRmwBinOp::AtomicNand, 362 rustc_codegen_ssa::common::AtomicRmwBinOp::AtomicOr => AtomicRmwBinOp::AtomicOr, 363 rustc_codegen_ssa::common::AtomicRmwBinOp::AtomicXor => AtomicRmwBinOp::AtomicXor, 364 rustc_codegen_ssa::common::AtomicRmwBinOp::AtomicMax => AtomicRmwBinOp::AtomicMax, 365 rustc_codegen_ssa::common::AtomicRmwBinOp::AtomicMin => AtomicRmwBinOp::AtomicMin, 366 rustc_codegen_ssa::common::AtomicRmwBinOp::AtomicUMax => AtomicRmwBinOp::AtomicUMax, 367 rustc_codegen_ssa::common::AtomicRmwBinOp::AtomicUMin => AtomicRmwBinOp::AtomicUMin, 368 } 369 } 370 } 371 372 /// LLVMAtomicOrdering 373 #[derive(Copy, Clone)] 374 #[repr(C)] 375 pub enum AtomicOrdering { 376 #[allow(dead_code)] 377 NotAtomic = 0, 378 Unordered = 1, 379 Monotonic = 2, 380 // Consume = 3, // Not specified yet. 381 Acquire = 4, 382 Release = 5, 383 AcquireRelease = 6, 384 SequentiallyConsistent = 7, 385 } 386 387 impl AtomicOrdering { from_generic(ao: rustc_codegen_ssa::common::AtomicOrdering) -> Self388 pub fn from_generic(ao: rustc_codegen_ssa::common::AtomicOrdering) -> Self { 389 match ao { 390 rustc_codegen_ssa::common::AtomicOrdering::Unordered => AtomicOrdering::Unordered, 391 rustc_codegen_ssa::common::AtomicOrdering::Relaxed => AtomicOrdering::Monotonic, 392 rustc_codegen_ssa::common::AtomicOrdering::Acquire => AtomicOrdering::Acquire, 393 rustc_codegen_ssa::common::AtomicOrdering::Release => AtomicOrdering::Release, 394 rustc_codegen_ssa::common::AtomicOrdering::AcquireRelease => { 395 AtomicOrdering::AcquireRelease 396 } 397 rustc_codegen_ssa::common::AtomicOrdering::SequentiallyConsistent => { 398 AtomicOrdering::SequentiallyConsistent 399 } 400 } 401 } 402 } 403 404 /// LLVMRustFileType 405 #[derive(Copy, Clone)] 406 #[repr(C)] 407 pub enum FileType { 408 AssemblyFile, 409 ObjectFile, 410 } 411 412 /// LLVMMetadataType 413 #[derive(Copy, Clone)] 414 #[repr(C)] 415 pub enum MetadataType { 416 MD_dbg = 0, 417 MD_tbaa = 1, 418 MD_prof = 2, 419 MD_fpmath = 3, 420 MD_range = 4, 421 MD_tbaa_struct = 5, 422 MD_invariant_load = 6, 423 MD_alias_scope = 7, 424 MD_noalias = 8, 425 MD_nontemporal = 9, 426 MD_mem_parallel_loop_access = 10, 427 MD_nonnull = 11, 428 MD_align = 17, 429 MD_type = 19, 430 MD_vcall_visibility = 28, 431 MD_noundef = 29, 432 MD_kcfi_type = 36, 433 } 434 435 /// LLVMRustAsmDialect 436 #[derive(Copy, Clone, PartialEq)] 437 #[repr(C)] 438 pub enum AsmDialect { 439 Att, 440 Intel, 441 } 442 443 /// LLVMRustCodeGenOptLevel 444 #[derive(Copy, Clone, PartialEq)] 445 #[repr(C)] 446 pub enum CodeGenOptLevel { 447 None, 448 Less, 449 Default, 450 Aggressive, 451 } 452 453 /// LLVMRustPassBuilderOptLevel 454 #[repr(C)] 455 pub enum PassBuilderOptLevel { 456 O0, 457 O1, 458 O2, 459 O3, 460 Os, 461 Oz, 462 } 463 464 /// LLVMRustOptStage 465 #[derive(PartialEq)] 466 #[repr(C)] 467 pub enum OptStage { 468 PreLinkNoLTO, 469 PreLinkThinLTO, 470 PreLinkFatLTO, 471 ThinLTO, 472 FatLTO, 473 } 474 475 /// LLVMRustSanitizerOptions 476 #[repr(C)] 477 pub struct SanitizerOptions { 478 pub sanitize_address: bool, 479 pub sanitize_address_recover: bool, 480 pub sanitize_memory: bool, 481 pub sanitize_memory_recover: bool, 482 pub sanitize_memory_track_origins: c_int, 483 pub sanitize_thread: bool, 484 pub sanitize_hwaddress: bool, 485 pub sanitize_hwaddress_recover: bool, 486 pub sanitize_kernel_address: bool, 487 pub sanitize_kernel_address_recover: bool, 488 } 489 490 /// LLVMRelocMode 491 #[derive(Copy, Clone, PartialEq)] 492 #[repr(C)] 493 pub enum RelocModel { 494 Static, 495 PIC, 496 DynamicNoPic, 497 ROPI, 498 RWPI, 499 ROPI_RWPI, 500 } 501 502 /// LLVMRustCodeModel 503 #[derive(Copy, Clone)] 504 #[repr(C)] 505 pub enum CodeModel { 506 Tiny, 507 Small, 508 Kernel, 509 Medium, 510 Large, 511 None, 512 } 513 514 /// LLVMRustDiagnosticKind 515 #[derive(Copy, Clone)] 516 #[repr(C)] 517 #[allow(dead_code)] // Variants constructed by C++. 518 pub enum DiagnosticKind { 519 Other, 520 InlineAsm, 521 StackSize, 522 DebugMetadataVersion, 523 SampleProfile, 524 OptimizationRemark, 525 OptimizationRemarkMissed, 526 OptimizationRemarkAnalysis, 527 OptimizationRemarkAnalysisFPCommute, 528 OptimizationRemarkAnalysisAliasing, 529 OptimizationRemarkOther, 530 OptimizationFailure, 531 PGOProfile, 532 Linker, 533 Unsupported, 534 SrcMgr, 535 } 536 537 /// LLVMRustDiagnosticLevel 538 #[derive(Copy, Clone)] 539 #[repr(C)] 540 #[allow(dead_code)] // Variants constructed by C++. 541 pub enum DiagnosticLevel { 542 Error, 543 Warning, 544 Note, 545 Remark, 546 } 547 548 /// LLVMRustArchiveKind 549 #[derive(Copy, Clone)] 550 #[repr(C)] 551 pub enum ArchiveKind { 552 K_GNU, 553 K_BSD, 554 K_DARWIN, 555 K_COFF, 556 K_AIXBIG, 557 } 558 559 // LLVMRustThinLTOData 560 extern "C" { 561 pub type ThinLTOData; 562 } 563 564 // LLVMRustThinLTOBuffer 565 extern "C" { 566 pub type ThinLTOBuffer; 567 } 568 569 /// LLVMRustThinLTOModule 570 #[repr(C)] 571 pub struct ThinLTOModule { 572 pub identifier: *const c_char, 573 pub data: *const u8, 574 pub len: usize, 575 } 576 577 /// LLVMThreadLocalMode 578 #[derive(Copy, Clone)] 579 #[repr(C)] 580 pub enum ThreadLocalMode { 581 NotThreadLocal, 582 GeneralDynamic, 583 LocalDynamic, 584 InitialExec, 585 LocalExec, 586 } 587 588 /// LLVMRustTailCallKind 589 #[derive(Copy, Clone)] 590 #[repr(C)] 591 pub enum TailCallKind { 592 None, 593 Tail, 594 MustTail, 595 NoTail, 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 /// LLVMRustMemoryEffects 609 #[derive(Copy, Clone)] 610 #[repr(C)] 611 pub enum MemoryEffects { 612 None, 613 ReadOnly, 614 InaccessibleMemOnly, 615 } 616 617 extern "C" { 618 type Opaque; 619 } 620 #[repr(C)] 621 struct InvariantOpaque<'a> { 622 _marker: PhantomData<&'a mut &'a ()>, 623 _opaque: Opaque, 624 } 625 626 // Opaque pointer types 627 extern "C" { 628 pub type Module; 629 } 630 extern "C" { 631 pub type Context; 632 } 633 extern "C" { 634 pub type Type; 635 } 636 extern "C" { 637 pub type Value; 638 } 639 extern "C" { 640 pub type ConstantInt; 641 } 642 extern "C" { 643 pub type Attribute; 644 } 645 extern "C" { 646 pub type Metadata; 647 } 648 extern "C" { 649 pub type BasicBlock; 650 } 651 #[repr(C)] 652 pub struct Builder<'a>(InvariantOpaque<'a>); 653 #[repr(C)] 654 pub struct PassManager<'a>(InvariantOpaque<'a>); 655 extern "C" { 656 pub type Pass; 657 } 658 extern "C" { 659 pub type TargetMachine; 660 } 661 extern "C" { 662 pub type Archive; 663 } 664 #[repr(C)] 665 pub struct ArchiveIterator<'a>(InvariantOpaque<'a>); 666 #[repr(C)] 667 pub struct ArchiveChild<'a>(InvariantOpaque<'a>); 668 extern "C" { 669 pub type Twine; 670 } 671 extern "C" { 672 pub type DiagnosticInfo; 673 } 674 extern "C" { 675 pub type SMDiagnostic; 676 } 677 #[repr(C)] 678 pub struct RustArchiveMember<'a>(InvariantOpaque<'a>); 679 #[repr(C)] 680 pub struct OperandBundleDef<'a>(InvariantOpaque<'a>); 681 #[repr(C)] 682 pub struct Linker<'a>(InvariantOpaque<'a>); 683 684 extern "C" { 685 pub type DiagnosticHandler; 686 } 687 688 pub type DiagnosticHandlerTy = unsafe extern "C" fn(&DiagnosticInfo, *mut c_void); 689 pub type InlineAsmDiagHandlerTy = unsafe extern "C" fn(&SMDiagnostic, *const c_void, c_uint); 690 691 pub mod coverageinfo { 692 use super::coverage_map; 693 694 /// Corresponds to enum `llvm::coverage::CounterMappingRegion::RegionKind`. 695 /// 696 /// Must match the layout of `LLVMRustCounterMappingRegionKind`. 697 #[derive(Copy, Clone, Debug)] 698 #[repr(C)] 699 pub enum RegionKind { 700 /// A CodeRegion associates some code with a counter 701 CodeRegion = 0, 702 703 /// An ExpansionRegion represents a file expansion region that associates 704 /// a source range with the expansion of a virtual source file, such as 705 /// for a macro instantiation or #include file. 706 ExpansionRegion = 1, 707 708 /// A SkippedRegion represents a source range with code that was skipped 709 /// by a preprocessor or similar means. 710 SkippedRegion = 2, 711 712 /// A GapRegion is like a CodeRegion, but its count is only set as the 713 /// line execution count when its the only region in the line. 714 GapRegion = 3, 715 716 /// A BranchRegion represents leaf-level boolean expressions and is 717 /// associated with two counters, each representing the number of times the 718 /// expression evaluates to true or false. 719 BranchRegion = 4, 720 } 721 722 /// This struct provides LLVM's representation of a "CoverageMappingRegion", encoded into the 723 /// coverage map, in accordance with the 724 /// [LLVM Code Coverage Mapping Format](https://github.com/rust-lang/llvm-project/blob/rustc/13.0-2021-09-30/llvm/docs/CoverageMappingFormat.rst#llvm-code-coverage-mapping-format). 725 /// The struct composes fields representing the `Counter` type and value(s) (injected counter 726 /// ID, or expression type and operands), the source file (an indirect index into a "filenames 727 /// array", encoded separately), and source location (start and end positions of the represented 728 /// code region). 729 /// 730 /// Corresponds to struct `llvm::coverage::CounterMappingRegion`. 731 /// 732 /// Must match the layout of `LLVMRustCounterMappingRegion`. 733 #[derive(Copy, Clone, Debug)] 734 #[repr(C)] 735 pub struct CounterMappingRegion { 736 /// The counter type and type-dependent counter data, if any. 737 counter: coverage_map::Counter, 738 739 /// If the `RegionKind` is a `BranchRegion`, this represents the counter 740 /// for the false branch of the region. 741 false_counter: coverage_map::Counter, 742 743 /// An indirect reference to the source filename. In the LLVM Coverage Mapping Format, the 744 /// file_id is an index into a function-specific `virtual_file_mapping` array of indexes 745 /// that, in turn, are used to look up the filename for this region. 746 file_id: u32, 747 748 /// If the `RegionKind` is an `ExpansionRegion`, the `expanded_file_id` can be used to find 749 /// the mapping regions created as a result of macro expansion, by checking if their file id 750 /// matches the expanded file id. 751 expanded_file_id: u32, 752 753 /// 1-based starting line of the mapping region. 754 start_line: u32, 755 756 /// 1-based starting column of the mapping region. 757 start_col: u32, 758 759 /// 1-based ending line of the mapping region. 760 end_line: u32, 761 762 /// 1-based ending column of the mapping region. If the high bit is set, the current 763 /// mapping region is a gap area. 764 end_col: u32, 765 766 kind: RegionKind, 767 } 768 769 impl CounterMappingRegion { code_region( counter: coverage_map::Counter, file_id: u32, start_line: u32, start_col: u32, end_line: u32, end_col: u32, ) -> Self770 pub(crate) fn code_region( 771 counter: coverage_map::Counter, 772 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, 780 false_counter: coverage_map::Counter::zero(), 781 file_id, 782 expanded_file_id: 0, 783 start_line, 784 start_col, 785 end_line, 786 end_col, 787 kind: RegionKind::CodeRegion, 788 } 789 } 790 791 // This function might be used in the future; the LLVM API is still evolving, as is coverage 792 // support. 793 #[allow(dead_code)] branch_region( counter: coverage_map::Counter, false_counter: coverage_map::Counter, file_id: u32, start_line: u32, start_col: u32, end_line: u32, end_col: u32, ) -> Self794 pub(crate) fn branch_region( 795 counter: coverage_map::Counter, 796 false_counter: coverage_map::Counter, 797 file_id: u32, 798 start_line: u32, 799 start_col: u32, 800 end_line: u32, 801 end_col: u32, 802 ) -> Self { 803 Self { 804 counter, 805 false_counter, 806 file_id, 807 expanded_file_id: 0, 808 start_line, 809 start_col, 810 end_line, 811 end_col, 812 kind: RegionKind::BranchRegion, 813 } 814 } 815 816 // This function might be used in the future; the LLVM API is still evolving, as is coverage 817 // support. 818 #[allow(dead_code)] expansion_region( file_id: u32, expanded_file_id: u32, start_line: u32, start_col: u32, end_line: u32, end_col: u32, ) -> Self819 pub(crate) fn expansion_region( 820 file_id: u32, 821 expanded_file_id: u32, 822 start_line: u32, 823 start_col: u32, 824 end_line: u32, 825 end_col: u32, 826 ) -> Self { 827 Self { 828 counter: coverage_map::Counter::zero(), 829 false_counter: coverage_map::Counter::zero(), 830 file_id, 831 expanded_file_id, 832 start_line, 833 start_col, 834 end_line, 835 end_col, 836 kind: RegionKind::ExpansionRegion, 837 } 838 } 839 840 // This function might be used in the future; the LLVM API is still evolving, as is coverage 841 // support. 842 #[allow(dead_code)] skipped_region( file_id: u32, start_line: u32, start_col: u32, end_line: u32, end_col: u32, ) -> Self843 pub(crate) fn skipped_region( 844 file_id: u32, 845 start_line: u32, 846 start_col: u32, 847 end_line: u32, 848 end_col: u32, 849 ) -> Self { 850 Self { 851 counter: coverage_map::Counter::zero(), 852 false_counter: coverage_map::Counter::zero(), 853 file_id, 854 expanded_file_id: 0, 855 start_line, 856 start_col, 857 end_line, 858 end_col, 859 kind: RegionKind::SkippedRegion, 860 } 861 } 862 863 // This function might be used in the future; the LLVM API is still evolving, as is coverage 864 // support. 865 #[allow(dead_code)] gap_region( counter: coverage_map::Counter, file_id: u32, start_line: u32, start_col: u32, end_line: u32, end_col: u32, ) -> Self866 pub(crate) fn gap_region( 867 counter: coverage_map::Counter, 868 file_id: u32, 869 start_line: u32, 870 start_col: u32, 871 end_line: u32, 872 end_col: u32, 873 ) -> Self { 874 Self { 875 counter, 876 false_counter: coverage_map::Counter::zero(), 877 file_id, 878 expanded_file_id: 0, 879 start_line, 880 start_col, 881 end_line, 882 end_col: (1_u32 << 31) | end_col, 883 kind: RegionKind::GapRegion, 884 } 885 } 886 } 887 } 888 889 pub mod debuginfo { 890 use super::{InvariantOpaque, Metadata}; 891 use bitflags::bitflags; 892 893 #[repr(C)] 894 pub struct DIBuilder<'a>(InvariantOpaque<'a>); 895 896 pub type DIDescriptor = Metadata; 897 pub type DILocation = Metadata; 898 pub type DIScope = DIDescriptor; 899 pub type DIFile = DIScope; 900 pub type DILexicalBlock = DIScope; 901 pub type DISubprogram = DIScope; 902 pub type DINameSpace = DIScope; 903 pub type DIType = DIDescriptor; 904 pub type DIBasicType = DIType; 905 pub type DIDerivedType = DIType; 906 pub type DICompositeType = DIDerivedType; 907 pub type DIVariable = DIDescriptor; 908 pub type DIGlobalVariableExpression = DIDescriptor; 909 pub type DIArray = DIDescriptor; 910 pub type DISubrange = DIDescriptor; 911 pub type DIEnumerator = DIDescriptor; 912 pub type DITemplateTypeParameter = DIDescriptor; 913 914 // These values **must** match with LLVMRustDIFlags!! 915 bitflags! { 916 #[repr(transparent)] 917 #[derive(Default)] 918 pub struct DIFlags: u32 { 919 const FlagZero = 0; 920 const FlagPrivate = 1; 921 const FlagProtected = 2; 922 const FlagPublic = 3; 923 const FlagFwdDecl = (1 << 2); 924 const FlagAppleBlock = (1 << 3); 925 const FlagBlockByrefStruct = (1 << 4); 926 const FlagVirtual = (1 << 5); 927 const FlagArtificial = (1 << 6); 928 const FlagExplicit = (1 << 7); 929 const FlagPrototyped = (1 << 8); 930 const FlagObjcClassComplete = (1 << 9); 931 const FlagObjectPointer = (1 << 10); 932 const FlagVector = (1 << 11); 933 const FlagStaticMember = (1 << 12); 934 const FlagLValueReference = (1 << 13); 935 const FlagRValueReference = (1 << 14); 936 const FlagExternalTypeRef = (1 << 15); 937 const FlagIntroducedVirtual = (1 << 18); 938 const FlagBitField = (1 << 19); 939 const FlagNoReturn = (1 << 20); 940 } 941 } 942 943 // These values **must** match with LLVMRustDISPFlags!! 944 bitflags! { 945 #[repr(transparent)] 946 #[derive(Default)] 947 pub struct DISPFlags: u32 { 948 const SPFlagZero = 0; 949 const SPFlagVirtual = 1; 950 const SPFlagPureVirtual = 2; 951 const SPFlagLocalToUnit = (1 << 2); 952 const SPFlagDefinition = (1 << 3); 953 const SPFlagOptimized = (1 << 4); 954 const SPFlagMainSubprogram = (1 << 5); 955 } 956 } 957 958 /// LLVMRustDebugEmissionKind 959 #[derive(Copy, Clone)] 960 #[repr(C)] 961 pub enum DebugEmissionKind { 962 NoDebug, 963 FullDebug, 964 LineTablesOnly, 965 DebugDirectivesOnly, 966 } 967 968 impl DebugEmissionKind { from_generic(kind: rustc_session::config::DebugInfo) -> Self969 pub fn from_generic(kind: rustc_session::config::DebugInfo) -> Self { 970 // We should be setting LLVM's emission kind to `LineTablesOnly` if 971 // we are compiling with "limited" debuginfo. However, some of the 972 // existing tools relied on slightly more debuginfo being generated than 973 // would be the case with `LineTablesOnly`, and we did not want to break 974 // these tools in a "drive-by fix", without a good idea or plan about 975 // what limited debuginfo should exactly look like. So for now we are 976 // instead adding a new debuginfo option "line-tables-only" so as to 977 // not break anything and to allow users to have 'limited' debug info. 978 // 979 // See https://github.com/rust-lang/rust/issues/60020 for details. 980 use rustc_session::config::DebugInfo; 981 match kind { 982 DebugInfo::None => DebugEmissionKind::NoDebug, 983 DebugInfo::LineDirectivesOnly => DebugEmissionKind::DebugDirectivesOnly, 984 DebugInfo::LineTablesOnly => DebugEmissionKind::LineTablesOnly, 985 DebugInfo::Limited | DebugInfo::Full => DebugEmissionKind::FullDebug, 986 } 987 } 988 } 989 } 990 991 use bitflags::bitflags; 992 // These values **must** match with LLVMRustAllocKindFlags 993 bitflags! { 994 #[repr(transparent)] 995 #[derive(Default)] 996 pub struct AllocKindFlags : u64 { 997 const Unknown = 0; 998 const Alloc = 1; 999 const Realloc = 1 << 1; 1000 const Free = 1 << 2; 1001 const Uninitialized = 1 << 3; 1002 const Zeroed = 1 << 4; 1003 const Aligned = 1 << 5; 1004 } 1005 } 1006 1007 extern "C" { 1008 pub type ModuleBuffer; 1009 } 1010 1011 pub type SelfProfileBeforePassCallback = 1012 unsafe extern "C" fn(*mut c_void, *const c_char, *const c_char); 1013 pub type SelfProfileAfterPassCallback = unsafe extern "C" fn(*mut c_void); 1014 1015 pub type GetSymbolsCallback = unsafe extern "C" fn(*mut c_void, *const c_char) -> *mut c_void; 1016 pub type GetSymbolsErrorCallback = unsafe extern "C" fn(*const c_char) -> *mut c_void; 1017 1018 extern "C" { LLVMRustInstallFatalErrorHandler()1019 pub fn LLVMRustInstallFatalErrorHandler(); LLVMRustDisableSystemDialogsOnCrash()1020 pub fn LLVMRustDisableSystemDialogsOnCrash(); 1021 1022 // Create and destroy contexts. LLVMRustContextCreate(shouldDiscardNames: bool) -> &'static mut Context1023 pub fn LLVMRustContextCreate(shouldDiscardNames: bool) -> &'static mut Context; LLVMContextDispose(C: &'static mut Context)1024 pub fn LLVMContextDispose(C: &'static mut Context); LLVMGetMDKindIDInContext(C: &Context, Name: *const c_char, SLen: c_uint) -> c_uint1025 pub fn LLVMGetMDKindIDInContext(C: &Context, Name: *const c_char, SLen: c_uint) -> c_uint; 1026 1027 // Create modules. LLVMModuleCreateWithNameInContext(ModuleID: *const c_char, C: &Context) -> &Module1028 pub fn LLVMModuleCreateWithNameInContext(ModuleID: *const c_char, C: &Context) -> &Module; LLVMGetModuleContext(M: &Module) -> &Context1029 pub fn LLVMGetModuleContext(M: &Module) -> &Context; LLVMCloneModule(M: &Module) -> &Module1030 pub fn LLVMCloneModule(M: &Module) -> &Module; 1031 1032 /// Data layout. See Module::getDataLayout. LLVMGetDataLayoutStr(M: &Module) -> *const c_char1033 pub fn LLVMGetDataLayoutStr(M: &Module) -> *const c_char; LLVMSetDataLayout(M: &Module, Triple: *const c_char)1034 pub fn LLVMSetDataLayout(M: &Module, Triple: *const c_char); 1035 1036 /// See Module::setModuleInlineAsm. LLVMAppendModuleInlineAsm(M: &Module, Asm: *const c_char, Len: size_t)1037 pub fn LLVMAppendModuleInlineAsm(M: &Module, Asm: *const c_char, Len: size_t); 1038 1039 /// See llvm::LLVMTypeKind::getTypeID. LLVMRustGetTypeKind(Ty: &Type) -> TypeKind1040 pub fn LLVMRustGetTypeKind(Ty: &Type) -> TypeKind; 1041 1042 // Operations on integer types LLVMInt1TypeInContext(C: &Context) -> &Type1043 pub fn LLVMInt1TypeInContext(C: &Context) -> &Type; LLVMInt8TypeInContext(C: &Context) -> &Type1044 pub fn LLVMInt8TypeInContext(C: &Context) -> &Type; LLVMInt16TypeInContext(C: &Context) -> &Type1045 pub fn LLVMInt16TypeInContext(C: &Context) -> &Type; LLVMInt32TypeInContext(C: &Context) -> &Type1046 pub fn LLVMInt32TypeInContext(C: &Context) -> &Type; LLVMInt64TypeInContext(C: &Context) -> &Type1047 pub fn LLVMInt64TypeInContext(C: &Context) -> &Type; LLVMIntTypeInContext(C: &Context, NumBits: c_uint) -> &Type1048 pub fn LLVMIntTypeInContext(C: &Context, NumBits: c_uint) -> &Type; 1049 LLVMGetIntTypeWidth(IntegerTy: &Type) -> c_uint1050 pub fn LLVMGetIntTypeWidth(IntegerTy: &Type) -> c_uint; 1051 1052 // Operations on real types LLVMFloatTypeInContext(C: &Context) -> &Type1053 pub fn LLVMFloatTypeInContext(C: &Context) -> &Type; LLVMDoubleTypeInContext(C: &Context) -> &Type1054 pub fn LLVMDoubleTypeInContext(C: &Context) -> &Type; 1055 1056 // Operations on function types LLVMFunctionType<'a>( ReturnType: &'a Type, ParamTypes: *const &'a Type, ParamCount: c_uint, IsVarArg: Bool, ) -> &'a Type1057 pub fn LLVMFunctionType<'a>( 1058 ReturnType: &'a Type, 1059 ParamTypes: *const &'a Type, 1060 ParamCount: c_uint, 1061 IsVarArg: Bool, 1062 ) -> &'a Type; LLVMCountParamTypes(FunctionTy: &Type) -> c_uint1063 pub fn LLVMCountParamTypes(FunctionTy: &Type) -> c_uint; LLVMGetParamTypes<'a>(FunctionTy: &'a Type, Dest: *mut &'a Type)1064 pub fn LLVMGetParamTypes<'a>(FunctionTy: &'a Type, Dest: *mut &'a Type); 1065 1066 // Operations on struct types LLVMStructTypeInContext<'a>( C: &'a Context, ElementTypes: *const &'a Type, ElementCount: c_uint, Packed: Bool, ) -> &'a Type1067 pub fn LLVMStructTypeInContext<'a>( 1068 C: &'a Context, 1069 ElementTypes: *const &'a Type, 1070 ElementCount: c_uint, 1071 Packed: Bool, 1072 ) -> &'a Type; 1073 1074 // Operations on array, pointer, and vector types (sequence types) LLVMRustArrayType(ElementType: &Type, ElementCount: u64) -> &Type1075 pub fn LLVMRustArrayType(ElementType: &Type, ElementCount: u64) -> &Type; LLVMPointerType(ElementType: &Type, AddressSpace: c_uint) -> &Type1076 pub fn LLVMPointerType(ElementType: &Type, AddressSpace: c_uint) -> &Type; LLVMVectorType(ElementType: &Type, ElementCount: c_uint) -> &Type1077 pub fn LLVMVectorType(ElementType: &Type, ElementCount: c_uint) -> &Type; 1078 LLVMGetElementType(Ty: &Type) -> &Type1079 pub fn LLVMGetElementType(Ty: &Type) -> &Type; LLVMGetVectorSize(VectorTy: &Type) -> c_uint1080 pub fn LLVMGetVectorSize(VectorTy: &Type) -> c_uint; 1081 1082 // Operations on other types LLVMVoidTypeInContext(C: &Context) -> &Type1083 pub fn LLVMVoidTypeInContext(C: &Context) -> &Type; LLVMTokenTypeInContext(C: &Context) -> &Type1084 pub fn LLVMTokenTypeInContext(C: &Context) -> &Type; LLVMMetadataTypeInContext(C: &Context) -> &Type1085 pub fn LLVMMetadataTypeInContext(C: &Context) -> &Type; 1086 1087 // Operations on all values LLVMTypeOf(Val: &Value) -> &Type1088 pub fn LLVMTypeOf(Val: &Value) -> &Type; LLVMGetValueName2(Val: &Value, Length: *mut size_t) -> *const c_char1089 pub fn LLVMGetValueName2(Val: &Value, Length: *mut size_t) -> *const c_char; LLVMSetValueName2(Val: &Value, Name: *const c_char, NameLen: size_t)1090 pub fn LLVMSetValueName2(Val: &Value, Name: *const c_char, NameLen: size_t); LLVMReplaceAllUsesWith<'a>(OldVal: &'a Value, NewVal: &'a Value)1091 pub fn LLVMReplaceAllUsesWith<'a>(OldVal: &'a Value, NewVal: &'a Value); LLVMSetMetadata<'a>(Val: &'a Value, KindID: c_uint, Node: &'a Value)1092 pub fn LLVMSetMetadata<'a>(Val: &'a Value, KindID: c_uint, Node: &'a Value); LLVMGlobalSetMetadata<'a>(Val: &'a Value, KindID: c_uint, Metadata: &'a Metadata)1093 pub fn LLVMGlobalSetMetadata<'a>(Val: &'a Value, KindID: c_uint, Metadata: &'a Metadata); LLVMRustGlobalAddMetadata<'a>(Val: &'a Value, KindID: c_uint, Metadata: &'a Metadata)1094 pub fn LLVMRustGlobalAddMetadata<'a>(Val: &'a Value, KindID: c_uint, Metadata: &'a Metadata); LLVMValueAsMetadata(Node: &Value) -> &Metadata1095 pub fn LLVMValueAsMetadata(Node: &Value) -> &Metadata; LLVMIsAFunction(Val: &Value) -> Option<&Value>1096 pub fn LLVMIsAFunction(Val: &Value) -> Option<&Value>; 1097 1098 // Operations on constants of any type LLVMConstNull(Ty: &Type) -> &Value1099 pub fn LLVMConstNull(Ty: &Type) -> &Value; LLVMGetUndef(Ty: &Type) -> &Value1100 pub fn LLVMGetUndef(Ty: &Type) -> &Value; LLVMGetPoison(Ty: &Type) -> &Value1101 pub fn LLVMGetPoison(Ty: &Type) -> &Value; 1102 1103 // Operations on metadata 1104 // FIXME: deprecated, replace with LLVMMDStringInContext2 LLVMMDStringInContext(C: &Context, Str: *const c_char, SLen: c_uint) -> &Value1105 pub fn LLVMMDStringInContext(C: &Context, Str: *const c_char, SLen: c_uint) -> &Value; 1106 LLVMMDStringInContext2(C: &Context, Str: *const c_char, SLen: size_t) -> &Metadata1107 pub fn LLVMMDStringInContext2(C: &Context, Str: *const c_char, SLen: size_t) -> &Metadata; 1108 1109 // FIXME: deprecated, replace with LLVMMDNodeInContext2 LLVMMDNodeInContext<'a>( C: &'a Context, Vals: *const &'a Value, Count: c_uint, ) -> &'a Value1110 pub fn LLVMMDNodeInContext<'a>( 1111 C: &'a Context, 1112 Vals: *const &'a Value, 1113 Count: c_uint, 1114 ) -> &'a Value; LLVMMDNodeInContext2<'a>( C: &'a Context, Vals: *const &'a Metadata, Count: size_t, ) -> &'a Metadata1115 pub fn LLVMMDNodeInContext2<'a>( 1116 C: &'a Context, 1117 Vals: *const &'a Metadata, 1118 Count: size_t, 1119 ) -> &'a Metadata; LLVMAddNamedMetadataOperand<'a>(M: &'a Module, Name: *const c_char, Val: &'a Value)1120 pub fn LLVMAddNamedMetadataOperand<'a>(M: &'a Module, Name: *const c_char, Val: &'a Value); 1121 1122 // Operations on scalar constants LLVMConstInt(IntTy: &Type, N: c_ulonglong, SignExtend: Bool) -> &Value1123 pub fn LLVMConstInt(IntTy: &Type, N: c_ulonglong, SignExtend: Bool) -> &Value; LLVMConstIntOfArbitraryPrecision(IntTy: &Type, Wn: c_uint, Ws: *const u64) -> &Value1124 pub fn LLVMConstIntOfArbitraryPrecision(IntTy: &Type, Wn: c_uint, Ws: *const u64) -> &Value; LLVMConstReal(RealTy: &Type, N: f64) -> &Value1125 pub fn LLVMConstReal(RealTy: &Type, N: f64) -> &Value; LLVMRustConstIntGetZExtValue(ConstantVal: &ConstantInt, Value: &mut u64) -> bool1126 pub fn LLVMRustConstIntGetZExtValue(ConstantVal: &ConstantInt, Value: &mut u64) -> bool; LLVMRustConstInt128Get( ConstantVal: &ConstantInt, SExt: bool, high: &mut u64, low: &mut u64, ) -> bool1127 pub fn LLVMRustConstInt128Get( 1128 ConstantVal: &ConstantInt, 1129 SExt: bool, 1130 high: &mut u64, 1131 low: &mut u64, 1132 ) -> bool; 1133 1134 // Operations on composite constants LLVMConstStringInContext( C: &Context, Str: *const c_char, Length: c_uint, DontNullTerminate: Bool, ) -> &Value1135 pub fn LLVMConstStringInContext( 1136 C: &Context, 1137 Str: *const c_char, 1138 Length: c_uint, 1139 DontNullTerminate: Bool, 1140 ) -> &Value; LLVMConstStructInContext<'a>( C: &'a Context, ConstantVals: *const &'a Value, Count: c_uint, Packed: Bool, ) -> &'a Value1141 pub fn LLVMConstStructInContext<'a>( 1142 C: &'a Context, 1143 ConstantVals: *const &'a Value, 1144 Count: c_uint, 1145 Packed: Bool, 1146 ) -> &'a Value; 1147 1148 // FIXME: replace with LLVMConstArray2 when bumped minimal version to llvm-17 1149 // https://github.com/llvm/llvm-project/commit/35276f16e5a2cae0dfb49c0fbf874d4d2f177acc LLVMConstArray<'a>( ElementTy: &'a Type, ConstantVals: *const &'a Value, Length: c_uint, ) -> &'a Value1150 pub fn LLVMConstArray<'a>( 1151 ElementTy: &'a Type, 1152 ConstantVals: *const &'a Value, 1153 Length: c_uint, 1154 ) -> &'a Value; LLVMConstVector(ScalarConstantVals: *const &Value, Size: c_uint) -> &Value1155 pub fn LLVMConstVector(ScalarConstantVals: *const &Value, Size: c_uint) -> &Value; 1156 1157 // Constant expressions LLVMRustConstInBoundsGEP2<'a>( ty: &'a Type, ConstantVal: &'a Value, ConstantIndices: *const &'a Value, NumIndices: c_uint, ) -> &'a Value1158 pub fn LLVMRustConstInBoundsGEP2<'a>( 1159 ty: &'a Type, 1160 ConstantVal: &'a Value, 1161 ConstantIndices: *const &'a Value, 1162 NumIndices: c_uint, 1163 ) -> &'a Value; LLVMConstZExt<'a>(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value1164 pub fn LLVMConstZExt<'a>(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value; LLVMConstPtrToInt<'a>(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value1165 pub fn LLVMConstPtrToInt<'a>(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value; LLVMConstIntToPtr<'a>(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value1166 pub fn LLVMConstIntToPtr<'a>(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value; LLVMConstBitCast<'a>(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value1167 pub fn LLVMConstBitCast<'a>(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value; LLVMConstPointerCast<'a>(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value1168 pub fn LLVMConstPointerCast<'a>(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value; LLVMGetAggregateElement(ConstantVal: &Value, Idx: c_uint) -> Option<&Value>1169 pub fn LLVMGetAggregateElement(ConstantVal: &Value, Idx: c_uint) -> Option<&Value>; 1170 1171 // Operations on global variables, functions, and aliases (globals) LLVMIsDeclaration(Global: &Value) -> Bool1172 pub fn LLVMIsDeclaration(Global: &Value) -> Bool; LLVMRustGetLinkage(Global: &Value) -> Linkage1173 pub fn LLVMRustGetLinkage(Global: &Value) -> Linkage; LLVMRustSetLinkage(Global: &Value, RustLinkage: Linkage)1174 pub fn LLVMRustSetLinkage(Global: &Value, RustLinkage: Linkage); LLVMSetSection(Global: &Value, Section: *const c_char)1175 pub fn LLVMSetSection(Global: &Value, Section: *const c_char); LLVMRustGetVisibility(Global: &Value) -> Visibility1176 pub fn LLVMRustGetVisibility(Global: &Value) -> Visibility; LLVMRustSetVisibility(Global: &Value, Viz: Visibility)1177 pub fn LLVMRustSetVisibility(Global: &Value, Viz: Visibility); LLVMRustSetDSOLocal(Global: &Value, is_dso_local: bool)1178 pub fn LLVMRustSetDSOLocal(Global: &Value, is_dso_local: bool); LLVMGetAlignment(Global: &Value) -> c_uint1179 pub fn LLVMGetAlignment(Global: &Value) -> c_uint; LLVMSetAlignment(Global: &Value, Bytes: c_uint)1180 pub fn LLVMSetAlignment(Global: &Value, Bytes: c_uint); LLVMSetDLLStorageClass(V: &Value, C: DLLStorageClass)1181 pub fn LLVMSetDLLStorageClass(V: &Value, C: DLLStorageClass); 1182 1183 // Operations on global variables LLVMIsAGlobalVariable(GlobalVar: &Value) -> Option<&Value>1184 pub fn LLVMIsAGlobalVariable(GlobalVar: &Value) -> Option<&Value>; LLVMAddGlobal<'a>(M: &'a Module, Ty: &'a Type, Name: *const c_char) -> &'a Value1185 pub fn LLVMAddGlobal<'a>(M: &'a Module, Ty: &'a Type, Name: *const c_char) -> &'a Value; LLVMGetNamedGlobal(M: &Module, Name: *const c_char) -> Option<&Value>1186 pub fn LLVMGetNamedGlobal(M: &Module, Name: *const c_char) -> Option<&Value>; LLVMRustGetOrInsertGlobal<'a>( M: &'a Module, Name: *const c_char, NameLen: size_t, T: &'a Type, ) -> &'a Value1187 pub fn LLVMRustGetOrInsertGlobal<'a>( 1188 M: &'a Module, 1189 Name: *const c_char, 1190 NameLen: size_t, 1191 T: &'a Type, 1192 ) -> &'a Value; LLVMRustInsertPrivateGlobal<'a>(M: &'a Module, T: &'a Type) -> &'a Value1193 pub fn LLVMRustInsertPrivateGlobal<'a>(M: &'a Module, T: &'a Type) -> &'a Value; LLVMGetFirstGlobal(M: &Module) -> Option<&Value>1194 pub fn LLVMGetFirstGlobal(M: &Module) -> Option<&Value>; LLVMGetNextGlobal(GlobalVar: &Value) -> Option<&Value>1195 pub fn LLVMGetNextGlobal(GlobalVar: &Value) -> Option<&Value>; LLVMDeleteGlobal(GlobalVar: &Value)1196 pub fn LLVMDeleteGlobal(GlobalVar: &Value); LLVMGetInitializer(GlobalVar: &Value) -> Option<&Value>1197 pub fn LLVMGetInitializer(GlobalVar: &Value) -> Option<&Value>; LLVMSetInitializer<'a>(GlobalVar: &'a Value, ConstantVal: &'a Value)1198 pub fn LLVMSetInitializer<'a>(GlobalVar: &'a Value, ConstantVal: &'a Value); LLVMIsThreadLocal(GlobalVar: &Value) -> Bool1199 pub fn LLVMIsThreadLocal(GlobalVar: &Value) -> Bool; LLVMSetThreadLocalMode(GlobalVar: &Value, Mode: ThreadLocalMode)1200 pub fn LLVMSetThreadLocalMode(GlobalVar: &Value, Mode: ThreadLocalMode); LLVMIsGlobalConstant(GlobalVar: &Value) -> Bool1201 pub fn LLVMIsGlobalConstant(GlobalVar: &Value) -> Bool; LLVMSetGlobalConstant(GlobalVar: &Value, IsConstant: Bool)1202 pub fn LLVMSetGlobalConstant(GlobalVar: &Value, IsConstant: Bool); LLVMRustGetNamedValue( M: &Module, Name: *const c_char, NameLen: size_t, ) -> Option<&Value>1203 pub fn LLVMRustGetNamedValue( 1204 M: &Module, 1205 Name: *const c_char, 1206 NameLen: size_t, 1207 ) -> Option<&Value>; LLVMSetTailCall(CallInst: &Value, IsTailCall: Bool)1208 pub fn LLVMSetTailCall(CallInst: &Value, IsTailCall: Bool); LLVMRustSetTailCallKind(CallInst: &Value, TKC: TailCallKind)1209 pub fn LLVMRustSetTailCallKind(CallInst: &Value, TKC: TailCallKind); 1210 1211 // Operations on attributes LLVMRustCreateAttrNoValue(C: &Context, attr: AttributeKind) -> &Attribute1212 pub fn LLVMRustCreateAttrNoValue(C: &Context, attr: AttributeKind) -> &Attribute; LLVMCreateStringAttribute( C: &Context, Name: *const c_char, NameLen: c_uint, Value: *const c_char, ValueLen: c_uint, ) -> &Attribute1213 pub fn LLVMCreateStringAttribute( 1214 C: &Context, 1215 Name: *const c_char, 1216 NameLen: c_uint, 1217 Value: *const c_char, 1218 ValueLen: c_uint, 1219 ) -> &Attribute; LLVMRustCreateAlignmentAttr(C: &Context, bytes: u64) -> &Attribute1220 pub fn LLVMRustCreateAlignmentAttr(C: &Context, bytes: u64) -> &Attribute; LLVMRustCreateDereferenceableAttr(C: &Context, bytes: u64) -> &Attribute1221 pub fn LLVMRustCreateDereferenceableAttr(C: &Context, bytes: u64) -> &Attribute; LLVMRustCreateDereferenceableOrNullAttr(C: &Context, bytes: u64) -> &Attribute1222 pub fn LLVMRustCreateDereferenceableOrNullAttr(C: &Context, bytes: u64) -> &Attribute; LLVMRustCreateByValAttr<'a>(C: &'a Context, ty: &'a Type) -> &'a Attribute1223 pub fn LLVMRustCreateByValAttr<'a>(C: &'a Context, ty: &'a Type) -> &'a Attribute; LLVMRustCreateStructRetAttr<'a>(C: &'a Context, ty: &'a Type) -> &'a Attribute1224 pub fn LLVMRustCreateStructRetAttr<'a>(C: &'a Context, ty: &'a Type) -> &'a Attribute; LLVMRustCreateElementTypeAttr<'a>(C: &'a Context, ty: &'a Type) -> &'a Attribute1225 pub fn LLVMRustCreateElementTypeAttr<'a>(C: &'a Context, ty: &'a Type) -> &'a Attribute; LLVMRustCreateUWTableAttr(C: &Context, async_: bool) -> &Attribute1226 pub fn LLVMRustCreateUWTableAttr(C: &Context, async_: bool) -> &Attribute; LLVMRustCreateAllocSizeAttr(C: &Context, size_arg: u32) -> &Attribute1227 pub fn LLVMRustCreateAllocSizeAttr(C: &Context, size_arg: u32) -> &Attribute; LLVMRustCreateAllocKindAttr(C: &Context, size_arg: u64) -> &Attribute1228 pub fn LLVMRustCreateAllocKindAttr(C: &Context, size_arg: u64) -> &Attribute; LLVMRustCreateMemoryEffectsAttr(C: &Context, effects: MemoryEffects) -> &Attribute1229 pub fn LLVMRustCreateMemoryEffectsAttr(C: &Context, effects: MemoryEffects) -> &Attribute; 1230 1231 // Operations on functions LLVMRustGetOrInsertFunction<'a>( M: &'a Module, Name: *const c_char, NameLen: size_t, FunctionTy: &'a Type, ) -> &'a Value1232 pub fn LLVMRustGetOrInsertFunction<'a>( 1233 M: &'a Module, 1234 Name: *const c_char, 1235 NameLen: size_t, 1236 FunctionTy: &'a Type, 1237 ) -> &'a Value; LLVMSetFunctionCallConv(Fn: &Value, CC: c_uint)1238 pub fn LLVMSetFunctionCallConv(Fn: &Value, CC: c_uint); LLVMRustAddFunctionAttributes<'a>( Fn: &'a Value, index: c_uint, Attrs: *const &'a Attribute, AttrsLen: size_t, )1239 pub fn LLVMRustAddFunctionAttributes<'a>( 1240 Fn: &'a Value, 1241 index: c_uint, 1242 Attrs: *const &'a Attribute, 1243 AttrsLen: size_t, 1244 ); 1245 1246 // Operations on parameters LLVMIsAArgument(Val: &Value) -> Option<&Value>1247 pub fn LLVMIsAArgument(Val: &Value) -> Option<&Value>; LLVMCountParams(Fn: &Value) -> c_uint1248 pub fn LLVMCountParams(Fn: &Value) -> c_uint; LLVMGetParam(Fn: &Value, Index: c_uint) -> &Value1249 pub fn LLVMGetParam(Fn: &Value, Index: c_uint) -> &Value; 1250 1251 // Operations on basic blocks LLVMGetBasicBlockParent(BB: &BasicBlock) -> &Value1252 pub fn LLVMGetBasicBlockParent(BB: &BasicBlock) -> &Value; LLVMAppendBasicBlockInContext<'a>( C: &'a Context, Fn: &'a Value, Name: *const c_char, ) -> &'a BasicBlock1253 pub fn LLVMAppendBasicBlockInContext<'a>( 1254 C: &'a Context, 1255 Fn: &'a Value, 1256 Name: *const c_char, 1257 ) -> &'a BasicBlock; 1258 1259 // Operations on instructions LLVMIsAInstruction(Val: &Value) -> Option<&Value>1260 pub fn LLVMIsAInstruction(Val: &Value) -> Option<&Value>; LLVMGetFirstBasicBlock(Fn: &Value) -> &BasicBlock1261 pub fn LLVMGetFirstBasicBlock(Fn: &Value) -> &BasicBlock; 1262 1263 // Operations on call sites LLVMSetInstructionCallConv(Instr: &Value, CC: c_uint)1264 pub fn LLVMSetInstructionCallConv(Instr: &Value, CC: c_uint); LLVMRustAddCallSiteAttributes<'a>( Instr: &'a Value, index: c_uint, Attrs: *const &'a Attribute, AttrsLen: size_t, )1265 pub fn LLVMRustAddCallSiteAttributes<'a>( 1266 Instr: &'a Value, 1267 index: c_uint, 1268 Attrs: *const &'a Attribute, 1269 AttrsLen: size_t, 1270 ); 1271 1272 // Operations on load/store instructions (only) LLVMSetVolatile(MemoryAccessInst: &Value, volatile: Bool)1273 pub fn LLVMSetVolatile(MemoryAccessInst: &Value, volatile: Bool); 1274 1275 // Operations on phi nodes LLVMAddIncoming<'a>( PhiNode: &'a Value, IncomingValues: *const &'a Value, IncomingBlocks: *const &'a BasicBlock, Count: c_uint, )1276 pub fn LLVMAddIncoming<'a>( 1277 PhiNode: &'a Value, 1278 IncomingValues: *const &'a Value, 1279 IncomingBlocks: *const &'a BasicBlock, 1280 Count: c_uint, 1281 ); 1282 1283 // Instruction builders LLVMCreateBuilderInContext(C: &Context) -> &mut Builder<'_>1284 pub fn LLVMCreateBuilderInContext(C: &Context) -> &mut Builder<'_>; LLVMPositionBuilderAtEnd<'a>(Builder: &Builder<'a>, Block: &'a BasicBlock)1285 pub fn LLVMPositionBuilderAtEnd<'a>(Builder: &Builder<'a>, Block: &'a BasicBlock); LLVMGetInsertBlock<'a>(Builder: &Builder<'a>) -> &'a BasicBlock1286 pub fn LLVMGetInsertBlock<'a>(Builder: &Builder<'a>) -> &'a BasicBlock; LLVMDisposeBuilder<'a>(Builder: &'a mut Builder<'a>)1287 pub fn LLVMDisposeBuilder<'a>(Builder: &'a mut Builder<'a>); 1288 1289 // Metadata LLVMSetCurrentDebugLocation2<'a>(Builder: &Builder<'a>, Loc: &'a Metadata)1290 pub fn LLVMSetCurrentDebugLocation2<'a>(Builder: &Builder<'a>, Loc: &'a Metadata); 1291 1292 // Terminators LLVMBuildRetVoid<'a>(B: &Builder<'a>) -> &'a Value1293 pub fn LLVMBuildRetVoid<'a>(B: &Builder<'a>) -> &'a Value; LLVMBuildRet<'a>(B: &Builder<'a>, V: &'a Value) -> &'a Value1294 pub fn LLVMBuildRet<'a>(B: &Builder<'a>, V: &'a Value) -> &'a Value; LLVMBuildBr<'a>(B: &Builder<'a>, Dest: &'a BasicBlock) -> &'a Value1295 pub fn LLVMBuildBr<'a>(B: &Builder<'a>, Dest: &'a BasicBlock) -> &'a Value; LLVMBuildCondBr<'a>( B: &Builder<'a>, If: &'a Value, Then: &'a BasicBlock, Else: &'a BasicBlock, ) -> &'a Value1296 pub fn LLVMBuildCondBr<'a>( 1297 B: &Builder<'a>, 1298 If: &'a Value, 1299 Then: &'a BasicBlock, 1300 Else: &'a BasicBlock, 1301 ) -> &'a Value; LLVMBuildSwitch<'a>( B: &Builder<'a>, V: &'a Value, Else: &'a BasicBlock, NumCases: c_uint, ) -> &'a Value1302 pub fn LLVMBuildSwitch<'a>( 1303 B: &Builder<'a>, 1304 V: &'a Value, 1305 Else: &'a BasicBlock, 1306 NumCases: c_uint, 1307 ) -> &'a Value; LLVMRustBuildInvoke<'a>( B: &Builder<'a>, Ty: &'a Type, Fn: &'a Value, Args: *const &'a Value, NumArgs: c_uint, Then: &'a BasicBlock, Catch: &'a BasicBlock, OpBundles: *const &OperandBundleDef<'a>, NumOpBundles: c_uint, Name: *const c_char, ) -> &'a Value1308 pub fn LLVMRustBuildInvoke<'a>( 1309 B: &Builder<'a>, 1310 Ty: &'a Type, 1311 Fn: &'a Value, 1312 Args: *const &'a Value, 1313 NumArgs: c_uint, 1314 Then: &'a BasicBlock, 1315 Catch: &'a BasicBlock, 1316 OpBundles: *const &OperandBundleDef<'a>, 1317 NumOpBundles: c_uint, 1318 Name: *const c_char, 1319 ) -> &'a Value; LLVMBuildLandingPad<'a>( B: &Builder<'a>, Ty: &'a Type, PersFn: Option<&'a Value>, NumClauses: c_uint, Name: *const c_char, ) -> &'a Value1320 pub fn LLVMBuildLandingPad<'a>( 1321 B: &Builder<'a>, 1322 Ty: &'a Type, 1323 PersFn: Option<&'a Value>, 1324 NumClauses: c_uint, 1325 Name: *const c_char, 1326 ) -> &'a Value; LLVMBuildResume<'a>(B: &Builder<'a>, Exn: &'a Value) -> &'a Value1327 pub fn LLVMBuildResume<'a>(B: &Builder<'a>, Exn: &'a Value) -> &'a Value; LLVMBuildUnreachable<'a>(B: &Builder<'a>) -> &'a Value1328 pub fn LLVMBuildUnreachable<'a>(B: &Builder<'a>) -> &'a Value; 1329 LLVMBuildCleanupPad<'a>( B: &Builder<'a>, ParentPad: Option<&'a Value>, Args: *const &'a Value, NumArgs: c_uint, Name: *const c_char, ) -> Option<&'a Value>1330 pub fn LLVMBuildCleanupPad<'a>( 1331 B: &Builder<'a>, 1332 ParentPad: Option<&'a Value>, 1333 Args: *const &'a Value, 1334 NumArgs: c_uint, 1335 Name: *const c_char, 1336 ) -> Option<&'a Value>; LLVMBuildCleanupRet<'a>( B: &Builder<'a>, CleanupPad: &'a Value, BB: Option<&'a BasicBlock>, ) -> Option<&'a Value>1337 pub fn LLVMBuildCleanupRet<'a>( 1338 B: &Builder<'a>, 1339 CleanupPad: &'a Value, 1340 BB: Option<&'a BasicBlock>, 1341 ) -> Option<&'a Value>; LLVMBuildCatchPad<'a>( B: &Builder<'a>, ParentPad: &'a Value, Args: *const &'a Value, NumArgs: c_uint, Name: *const c_char, ) -> Option<&'a Value>1342 pub fn LLVMBuildCatchPad<'a>( 1343 B: &Builder<'a>, 1344 ParentPad: &'a Value, 1345 Args: *const &'a Value, 1346 NumArgs: c_uint, 1347 Name: *const c_char, 1348 ) -> Option<&'a Value>; LLVMBuildCatchRet<'a>( B: &Builder<'a>, CatchPad: &'a Value, BB: &'a BasicBlock, ) -> Option<&'a Value>1349 pub fn LLVMBuildCatchRet<'a>( 1350 B: &Builder<'a>, 1351 CatchPad: &'a Value, 1352 BB: &'a BasicBlock, 1353 ) -> Option<&'a Value>; LLVMBuildCatchSwitch<'a>( Builder: &Builder<'a>, ParentPad: Option<&'a Value>, UnwindBB: Option<&'a BasicBlock>, NumHandlers: c_uint, Name: *const c_char, ) -> Option<&'a Value>1354 pub fn LLVMBuildCatchSwitch<'a>( 1355 Builder: &Builder<'a>, 1356 ParentPad: Option<&'a Value>, 1357 UnwindBB: Option<&'a BasicBlock>, 1358 NumHandlers: c_uint, 1359 Name: *const c_char, 1360 ) -> Option<&'a Value>; LLVMAddHandler<'a>(CatchSwitch: &'a Value, Dest: &'a BasicBlock)1361 pub fn LLVMAddHandler<'a>(CatchSwitch: &'a Value, Dest: &'a BasicBlock); LLVMSetPersonalityFn<'a>(Func: &'a Value, Pers: &'a Value)1362 pub fn LLVMSetPersonalityFn<'a>(Func: &'a Value, Pers: &'a Value); 1363 1364 // Add a case to the switch instruction LLVMAddCase<'a>(Switch: &'a Value, OnVal: &'a Value, Dest: &'a BasicBlock)1365 pub fn LLVMAddCase<'a>(Switch: &'a Value, OnVal: &'a Value, Dest: &'a BasicBlock); 1366 1367 // Add a clause to the landing pad instruction LLVMAddClause<'a>(LandingPad: &'a Value, ClauseVal: &'a Value)1368 pub fn LLVMAddClause<'a>(LandingPad: &'a Value, ClauseVal: &'a Value); 1369 1370 // Set the cleanup on a landing pad instruction LLVMSetCleanup(LandingPad: &Value, Val: Bool)1371 pub fn LLVMSetCleanup(LandingPad: &Value, Val: Bool); 1372 1373 // Arithmetic LLVMBuildAdd<'a>( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1374 pub fn LLVMBuildAdd<'a>( 1375 B: &Builder<'a>, 1376 LHS: &'a Value, 1377 RHS: &'a Value, 1378 Name: *const c_char, 1379 ) -> &'a Value; LLVMBuildFAdd<'a>( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1380 pub fn LLVMBuildFAdd<'a>( 1381 B: &Builder<'a>, 1382 LHS: &'a Value, 1383 RHS: &'a Value, 1384 Name: *const c_char, 1385 ) -> &'a Value; LLVMBuildSub<'a>( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1386 pub fn LLVMBuildSub<'a>( 1387 B: &Builder<'a>, 1388 LHS: &'a Value, 1389 RHS: &'a Value, 1390 Name: *const c_char, 1391 ) -> &'a Value; LLVMBuildFSub<'a>( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1392 pub fn LLVMBuildFSub<'a>( 1393 B: &Builder<'a>, 1394 LHS: &'a Value, 1395 RHS: &'a Value, 1396 Name: *const c_char, 1397 ) -> &'a Value; LLVMBuildMul<'a>( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1398 pub fn LLVMBuildMul<'a>( 1399 B: &Builder<'a>, 1400 LHS: &'a Value, 1401 RHS: &'a Value, 1402 Name: *const c_char, 1403 ) -> &'a Value; LLVMBuildFMul<'a>( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1404 pub fn LLVMBuildFMul<'a>( 1405 B: &Builder<'a>, 1406 LHS: &'a Value, 1407 RHS: &'a Value, 1408 Name: *const c_char, 1409 ) -> &'a Value; LLVMBuildUDiv<'a>( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1410 pub fn LLVMBuildUDiv<'a>( 1411 B: &Builder<'a>, 1412 LHS: &'a Value, 1413 RHS: &'a Value, 1414 Name: *const c_char, 1415 ) -> &'a Value; LLVMBuildExactUDiv<'a>( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1416 pub fn LLVMBuildExactUDiv<'a>( 1417 B: &Builder<'a>, 1418 LHS: &'a Value, 1419 RHS: &'a Value, 1420 Name: *const c_char, 1421 ) -> &'a Value; LLVMBuildSDiv<'a>( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1422 pub fn LLVMBuildSDiv<'a>( 1423 B: &Builder<'a>, 1424 LHS: &'a Value, 1425 RHS: &'a Value, 1426 Name: *const c_char, 1427 ) -> &'a Value; LLVMBuildExactSDiv<'a>( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1428 pub fn LLVMBuildExactSDiv<'a>( 1429 B: &Builder<'a>, 1430 LHS: &'a Value, 1431 RHS: &'a Value, 1432 Name: *const c_char, 1433 ) -> &'a Value; LLVMBuildFDiv<'a>( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1434 pub fn LLVMBuildFDiv<'a>( 1435 B: &Builder<'a>, 1436 LHS: &'a Value, 1437 RHS: &'a Value, 1438 Name: *const c_char, 1439 ) -> &'a Value; LLVMBuildURem<'a>( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1440 pub fn LLVMBuildURem<'a>( 1441 B: &Builder<'a>, 1442 LHS: &'a Value, 1443 RHS: &'a Value, 1444 Name: *const c_char, 1445 ) -> &'a Value; LLVMBuildSRem<'a>( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1446 pub fn LLVMBuildSRem<'a>( 1447 B: &Builder<'a>, 1448 LHS: &'a Value, 1449 RHS: &'a Value, 1450 Name: *const c_char, 1451 ) -> &'a Value; LLVMBuildFRem<'a>( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1452 pub fn LLVMBuildFRem<'a>( 1453 B: &Builder<'a>, 1454 LHS: &'a Value, 1455 RHS: &'a Value, 1456 Name: *const c_char, 1457 ) -> &'a Value; LLVMBuildShl<'a>( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1458 pub fn LLVMBuildShl<'a>( 1459 B: &Builder<'a>, 1460 LHS: &'a Value, 1461 RHS: &'a Value, 1462 Name: *const c_char, 1463 ) -> &'a Value; LLVMBuildLShr<'a>( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1464 pub fn LLVMBuildLShr<'a>( 1465 B: &Builder<'a>, 1466 LHS: &'a Value, 1467 RHS: &'a Value, 1468 Name: *const c_char, 1469 ) -> &'a Value; LLVMBuildAShr<'a>( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1470 pub fn LLVMBuildAShr<'a>( 1471 B: &Builder<'a>, 1472 LHS: &'a Value, 1473 RHS: &'a Value, 1474 Name: *const c_char, 1475 ) -> &'a Value; LLVMBuildNSWAdd<'a>( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1476 pub fn LLVMBuildNSWAdd<'a>( 1477 B: &Builder<'a>, 1478 LHS: &'a Value, 1479 RHS: &'a Value, 1480 Name: *const c_char, 1481 ) -> &'a Value; LLVMBuildNUWAdd<'a>( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1482 pub fn LLVMBuildNUWAdd<'a>( 1483 B: &Builder<'a>, 1484 LHS: &'a Value, 1485 RHS: &'a Value, 1486 Name: *const c_char, 1487 ) -> &'a Value; LLVMBuildNSWSub<'a>( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1488 pub fn LLVMBuildNSWSub<'a>( 1489 B: &Builder<'a>, 1490 LHS: &'a Value, 1491 RHS: &'a Value, 1492 Name: *const c_char, 1493 ) -> &'a Value; LLVMBuildNUWSub<'a>( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1494 pub fn LLVMBuildNUWSub<'a>( 1495 B: &Builder<'a>, 1496 LHS: &'a Value, 1497 RHS: &'a Value, 1498 Name: *const c_char, 1499 ) -> &'a Value; LLVMBuildNSWMul<'a>( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1500 pub fn LLVMBuildNSWMul<'a>( 1501 B: &Builder<'a>, 1502 LHS: &'a Value, 1503 RHS: &'a Value, 1504 Name: *const c_char, 1505 ) -> &'a Value; LLVMBuildNUWMul<'a>( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1506 pub fn LLVMBuildNUWMul<'a>( 1507 B: &Builder<'a>, 1508 LHS: &'a Value, 1509 RHS: &'a Value, 1510 Name: *const c_char, 1511 ) -> &'a Value; LLVMBuildAnd<'a>( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1512 pub fn LLVMBuildAnd<'a>( 1513 B: &Builder<'a>, 1514 LHS: &'a Value, 1515 RHS: &'a Value, 1516 Name: *const c_char, 1517 ) -> &'a Value; LLVMBuildOr<'a>( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1518 pub fn LLVMBuildOr<'a>( 1519 B: &Builder<'a>, 1520 LHS: &'a Value, 1521 RHS: &'a Value, 1522 Name: *const c_char, 1523 ) -> &'a Value; LLVMBuildXor<'a>( B: &Builder<'a>, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1524 pub fn LLVMBuildXor<'a>( 1525 B: &Builder<'a>, 1526 LHS: &'a Value, 1527 RHS: &'a Value, 1528 Name: *const c_char, 1529 ) -> &'a Value; LLVMBuildNeg<'a>(B: &Builder<'a>, V: &'a Value, Name: *const c_char) -> &'a Value1530 pub fn LLVMBuildNeg<'a>(B: &Builder<'a>, V: &'a Value, Name: *const c_char) -> &'a Value; LLVMBuildFNeg<'a>(B: &Builder<'a>, V: &'a Value, Name: *const c_char) -> &'a Value1531 pub fn LLVMBuildFNeg<'a>(B: &Builder<'a>, V: &'a Value, Name: *const c_char) -> &'a Value; LLVMBuildNot<'a>(B: &Builder<'a>, V: &'a Value, Name: *const c_char) -> &'a Value1532 pub fn LLVMBuildNot<'a>(B: &Builder<'a>, V: &'a Value, Name: *const c_char) -> &'a Value; LLVMRustSetFastMath(Instr: &Value)1533 pub fn LLVMRustSetFastMath(Instr: &Value); 1534 1535 // Memory LLVMBuildAlloca<'a>(B: &Builder<'a>, Ty: &'a Type, Name: *const c_char) -> &'a Value1536 pub fn LLVMBuildAlloca<'a>(B: &Builder<'a>, Ty: &'a Type, Name: *const c_char) -> &'a Value; LLVMBuildArrayAlloca<'a>( B: &Builder<'a>, Ty: &'a Type, Val: &'a Value, Name: *const c_char, ) -> &'a Value1537 pub fn LLVMBuildArrayAlloca<'a>( 1538 B: &Builder<'a>, 1539 Ty: &'a Type, 1540 Val: &'a Value, 1541 Name: *const c_char, 1542 ) -> &'a Value; LLVMBuildLoad2<'a>( B: &Builder<'a>, Ty: &'a Type, PointerVal: &'a Value, Name: *const c_char, ) -> &'a Value1543 pub fn LLVMBuildLoad2<'a>( 1544 B: &Builder<'a>, 1545 Ty: &'a Type, 1546 PointerVal: &'a Value, 1547 Name: *const c_char, 1548 ) -> &'a Value; 1549 LLVMBuildStore<'a>(B: &Builder<'a>, Val: &'a Value, Ptr: &'a Value) -> &'a Value1550 pub fn LLVMBuildStore<'a>(B: &Builder<'a>, Val: &'a Value, Ptr: &'a Value) -> &'a Value; 1551 LLVMBuildGEP2<'a>( B: &Builder<'a>, Ty: &'a Type, Pointer: &'a Value, Indices: *const &'a Value, NumIndices: c_uint, Name: *const c_char, ) -> &'a Value1552 pub fn LLVMBuildGEP2<'a>( 1553 B: &Builder<'a>, 1554 Ty: &'a Type, 1555 Pointer: &'a Value, 1556 Indices: *const &'a Value, 1557 NumIndices: c_uint, 1558 Name: *const c_char, 1559 ) -> &'a Value; LLVMBuildInBoundsGEP2<'a>( B: &Builder<'a>, Ty: &'a Type, Pointer: &'a Value, Indices: *const &'a Value, NumIndices: c_uint, Name: *const c_char, ) -> &'a Value1560 pub fn LLVMBuildInBoundsGEP2<'a>( 1561 B: &Builder<'a>, 1562 Ty: &'a Type, 1563 Pointer: &'a Value, 1564 Indices: *const &'a Value, 1565 NumIndices: c_uint, 1566 Name: *const c_char, 1567 ) -> &'a Value; LLVMBuildStructGEP2<'a>( B: &Builder<'a>, Ty: &'a Type, Pointer: &'a Value, Idx: c_uint, Name: *const c_char, ) -> &'a Value1568 pub fn LLVMBuildStructGEP2<'a>( 1569 B: &Builder<'a>, 1570 Ty: &'a Type, 1571 Pointer: &'a Value, 1572 Idx: c_uint, 1573 Name: *const c_char, 1574 ) -> &'a Value; 1575 1576 // Casts LLVMBuildTrunc<'a>( B: &Builder<'a>, Val: &'a Value, DestTy: &'a Type, Name: *const c_char, ) -> &'a Value1577 pub fn LLVMBuildTrunc<'a>( 1578 B: &Builder<'a>, 1579 Val: &'a Value, 1580 DestTy: &'a Type, 1581 Name: *const c_char, 1582 ) -> &'a Value; LLVMBuildZExt<'a>( B: &Builder<'a>, Val: &'a Value, DestTy: &'a Type, Name: *const c_char, ) -> &'a Value1583 pub fn LLVMBuildZExt<'a>( 1584 B: &Builder<'a>, 1585 Val: &'a Value, 1586 DestTy: &'a Type, 1587 Name: *const c_char, 1588 ) -> &'a Value; LLVMBuildSExt<'a>( B: &Builder<'a>, Val: &'a Value, DestTy: &'a Type, Name: *const c_char, ) -> &'a Value1589 pub fn LLVMBuildSExt<'a>( 1590 B: &Builder<'a>, 1591 Val: &'a Value, 1592 DestTy: &'a Type, 1593 Name: *const c_char, 1594 ) -> &'a Value; LLVMBuildFPToUI<'a>( B: &Builder<'a>, Val: &'a Value, DestTy: &'a Type, Name: *const c_char, ) -> &'a Value1595 pub fn LLVMBuildFPToUI<'a>( 1596 B: &Builder<'a>, 1597 Val: &'a Value, 1598 DestTy: &'a Type, 1599 Name: *const c_char, 1600 ) -> &'a Value; LLVMBuildFPToSI<'a>( B: &Builder<'a>, Val: &'a Value, DestTy: &'a Type, Name: *const c_char, ) -> &'a Value1601 pub fn LLVMBuildFPToSI<'a>( 1602 B: &Builder<'a>, 1603 Val: &'a Value, 1604 DestTy: &'a Type, 1605 Name: *const c_char, 1606 ) -> &'a Value; LLVMBuildUIToFP<'a>( B: &Builder<'a>, Val: &'a Value, DestTy: &'a Type, Name: *const c_char, ) -> &'a Value1607 pub fn LLVMBuildUIToFP<'a>( 1608 B: &Builder<'a>, 1609 Val: &'a Value, 1610 DestTy: &'a Type, 1611 Name: *const c_char, 1612 ) -> &'a Value; LLVMBuildSIToFP<'a>( B: &Builder<'a>, Val: &'a Value, DestTy: &'a Type, Name: *const c_char, ) -> &'a Value1613 pub fn LLVMBuildSIToFP<'a>( 1614 B: &Builder<'a>, 1615 Val: &'a Value, 1616 DestTy: &'a Type, 1617 Name: *const c_char, 1618 ) -> &'a Value; LLVMBuildFPTrunc<'a>( B: &Builder<'a>, Val: &'a Value, DestTy: &'a Type, Name: *const c_char, ) -> &'a Value1619 pub fn LLVMBuildFPTrunc<'a>( 1620 B: &Builder<'a>, 1621 Val: &'a Value, 1622 DestTy: &'a Type, 1623 Name: *const c_char, 1624 ) -> &'a Value; LLVMBuildFPExt<'a>( B: &Builder<'a>, Val: &'a Value, DestTy: &'a Type, Name: *const c_char, ) -> &'a Value1625 pub fn LLVMBuildFPExt<'a>( 1626 B: &Builder<'a>, 1627 Val: &'a Value, 1628 DestTy: &'a Type, 1629 Name: *const c_char, 1630 ) -> &'a Value; LLVMBuildPtrToInt<'a>( B: &Builder<'a>, Val: &'a Value, DestTy: &'a Type, Name: *const c_char, ) -> &'a Value1631 pub fn LLVMBuildPtrToInt<'a>( 1632 B: &Builder<'a>, 1633 Val: &'a Value, 1634 DestTy: &'a Type, 1635 Name: *const c_char, 1636 ) -> &'a Value; LLVMBuildIntToPtr<'a>( B: &Builder<'a>, Val: &'a Value, DestTy: &'a Type, Name: *const c_char, ) -> &'a Value1637 pub fn LLVMBuildIntToPtr<'a>( 1638 B: &Builder<'a>, 1639 Val: &'a Value, 1640 DestTy: &'a Type, 1641 Name: *const c_char, 1642 ) -> &'a Value; LLVMBuildBitCast<'a>( B: &Builder<'a>, Val: &'a Value, DestTy: &'a Type, Name: *const c_char, ) -> &'a Value1643 pub fn LLVMBuildBitCast<'a>( 1644 B: &Builder<'a>, 1645 Val: &'a Value, 1646 DestTy: &'a Type, 1647 Name: *const c_char, 1648 ) -> &'a Value; LLVMBuildPointerCast<'a>( B: &Builder<'a>, Val: &'a Value, DestTy: &'a Type, Name: *const c_char, ) -> &'a Value1649 pub fn LLVMBuildPointerCast<'a>( 1650 B: &Builder<'a>, 1651 Val: &'a Value, 1652 DestTy: &'a Type, 1653 Name: *const c_char, 1654 ) -> &'a Value; LLVMBuildIntCast2<'a>( B: &Builder<'a>, Val: &'a Value, DestTy: &'a Type, IsSigned: Bool, Name: *const c_char, ) -> &'a Value1655 pub fn LLVMBuildIntCast2<'a>( 1656 B: &Builder<'a>, 1657 Val: &'a Value, 1658 DestTy: &'a Type, 1659 IsSigned: Bool, 1660 Name: *const c_char, 1661 ) -> &'a Value; 1662 1663 // Comparisons LLVMBuildICmp<'a>( B: &Builder<'a>, Op: c_uint, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1664 pub fn LLVMBuildICmp<'a>( 1665 B: &Builder<'a>, 1666 Op: c_uint, 1667 LHS: &'a Value, 1668 RHS: &'a Value, 1669 Name: *const c_char, 1670 ) -> &'a Value; LLVMBuildFCmp<'a>( B: &Builder<'a>, Op: c_uint, LHS: &'a Value, RHS: &'a Value, Name: *const c_char, ) -> &'a Value1671 pub fn LLVMBuildFCmp<'a>( 1672 B: &Builder<'a>, 1673 Op: c_uint, 1674 LHS: &'a Value, 1675 RHS: &'a Value, 1676 Name: *const c_char, 1677 ) -> &'a Value; 1678 1679 // Miscellaneous instructions LLVMBuildPhi<'a>(B: &Builder<'a>, Ty: &'a Type, Name: *const c_char) -> &'a Value1680 pub fn LLVMBuildPhi<'a>(B: &Builder<'a>, Ty: &'a Type, Name: *const c_char) -> &'a Value; LLVMRustGetInstrProfIncrementIntrinsic(M: &Module) -> &Value1681 pub fn LLVMRustGetInstrProfIncrementIntrinsic(M: &Module) -> &Value; LLVMRustBuildCall<'a>( B: &Builder<'a>, Ty: &'a Type, Fn: &'a Value, Args: *const &'a Value, NumArgs: c_uint, OpBundles: *const &OperandBundleDef<'a>, NumOpBundles: c_uint, ) -> &'a Value1682 pub fn LLVMRustBuildCall<'a>( 1683 B: &Builder<'a>, 1684 Ty: &'a Type, 1685 Fn: &'a Value, 1686 Args: *const &'a Value, 1687 NumArgs: c_uint, 1688 OpBundles: *const &OperandBundleDef<'a>, 1689 NumOpBundles: c_uint, 1690 ) -> &'a Value; LLVMRustBuildMemCpy<'a>( B: &Builder<'a>, Dst: &'a Value, DstAlign: c_uint, Src: &'a Value, SrcAlign: c_uint, Size: &'a Value, IsVolatile: bool, ) -> &'a Value1691 pub fn LLVMRustBuildMemCpy<'a>( 1692 B: &Builder<'a>, 1693 Dst: &'a Value, 1694 DstAlign: c_uint, 1695 Src: &'a Value, 1696 SrcAlign: c_uint, 1697 Size: &'a Value, 1698 IsVolatile: bool, 1699 ) -> &'a Value; LLVMRustBuildMemMove<'a>( B: &Builder<'a>, Dst: &'a Value, DstAlign: c_uint, Src: &'a Value, SrcAlign: c_uint, Size: &'a Value, IsVolatile: bool, ) -> &'a Value1700 pub fn LLVMRustBuildMemMove<'a>( 1701 B: &Builder<'a>, 1702 Dst: &'a Value, 1703 DstAlign: c_uint, 1704 Src: &'a Value, 1705 SrcAlign: c_uint, 1706 Size: &'a Value, 1707 IsVolatile: bool, 1708 ) -> &'a Value; LLVMRustBuildMemSet<'a>( B: &Builder<'a>, Dst: &'a Value, DstAlign: c_uint, Val: &'a Value, Size: &'a Value, IsVolatile: bool, ) -> &'a Value1709 pub fn LLVMRustBuildMemSet<'a>( 1710 B: &Builder<'a>, 1711 Dst: &'a Value, 1712 DstAlign: c_uint, 1713 Val: &'a Value, 1714 Size: &'a Value, 1715 IsVolatile: bool, 1716 ) -> &'a Value; LLVMBuildSelect<'a>( B: &Builder<'a>, If: &'a Value, Then: &'a Value, Else: &'a Value, Name: *const c_char, ) -> &'a Value1717 pub fn LLVMBuildSelect<'a>( 1718 B: &Builder<'a>, 1719 If: &'a Value, 1720 Then: &'a Value, 1721 Else: &'a Value, 1722 Name: *const c_char, 1723 ) -> &'a Value; LLVMBuildVAArg<'a>( B: &Builder<'a>, list: &'a Value, Ty: &'a Type, Name: *const c_char, ) -> &'a Value1724 pub fn LLVMBuildVAArg<'a>( 1725 B: &Builder<'a>, 1726 list: &'a Value, 1727 Ty: &'a Type, 1728 Name: *const c_char, 1729 ) -> &'a Value; LLVMBuildExtractElement<'a>( B: &Builder<'a>, VecVal: &'a Value, Index: &'a Value, Name: *const c_char, ) -> &'a Value1730 pub fn LLVMBuildExtractElement<'a>( 1731 B: &Builder<'a>, 1732 VecVal: &'a Value, 1733 Index: &'a Value, 1734 Name: *const c_char, 1735 ) -> &'a Value; LLVMBuildInsertElement<'a>( B: &Builder<'a>, VecVal: &'a Value, EltVal: &'a Value, Index: &'a Value, Name: *const c_char, ) -> &'a Value1736 pub fn LLVMBuildInsertElement<'a>( 1737 B: &Builder<'a>, 1738 VecVal: &'a Value, 1739 EltVal: &'a Value, 1740 Index: &'a Value, 1741 Name: *const c_char, 1742 ) -> &'a Value; LLVMBuildShuffleVector<'a>( B: &Builder<'a>, V1: &'a Value, V2: &'a Value, Mask: &'a Value, Name: *const c_char, ) -> &'a Value1743 pub fn LLVMBuildShuffleVector<'a>( 1744 B: &Builder<'a>, 1745 V1: &'a Value, 1746 V2: &'a Value, 1747 Mask: &'a Value, 1748 Name: *const c_char, 1749 ) -> &'a Value; LLVMBuildExtractValue<'a>( B: &Builder<'a>, AggVal: &'a Value, Index: c_uint, Name: *const c_char, ) -> &'a Value1750 pub fn LLVMBuildExtractValue<'a>( 1751 B: &Builder<'a>, 1752 AggVal: &'a Value, 1753 Index: c_uint, 1754 Name: *const c_char, 1755 ) -> &'a Value; LLVMBuildInsertValue<'a>( B: &Builder<'a>, AggVal: &'a Value, EltVal: &'a Value, Index: c_uint, Name: *const c_char, ) -> &'a Value1756 pub fn LLVMBuildInsertValue<'a>( 1757 B: &Builder<'a>, 1758 AggVal: &'a Value, 1759 EltVal: &'a Value, 1760 Index: c_uint, 1761 Name: *const c_char, 1762 ) -> &'a Value; 1763 LLVMRustBuildVectorReduceFAdd<'a>( B: &Builder<'a>, Acc: &'a Value, Src: &'a Value, ) -> &'a Value1764 pub fn LLVMRustBuildVectorReduceFAdd<'a>( 1765 B: &Builder<'a>, 1766 Acc: &'a Value, 1767 Src: &'a Value, 1768 ) -> &'a Value; LLVMRustBuildVectorReduceFMul<'a>( B: &Builder<'a>, Acc: &'a Value, Src: &'a Value, ) -> &'a Value1769 pub fn LLVMRustBuildVectorReduceFMul<'a>( 1770 B: &Builder<'a>, 1771 Acc: &'a Value, 1772 Src: &'a Value, 1773 ) -> &'a Value; LLVMRustBuildVectorReduceAdd<'a>(B: &Builder<'a>, Src: &'a Value) -> &'a Value1774 pub fn LLVMRustBuildVectorReduceAdd<'a>(B: &Builder<'a>, Src: &'a Value) -> &'a Value; LLVMRustBuildVectorReduceMul<'a>(B: &Builder<'a>, Src: &'a Value) -> &'a Value1775 pub fn LLVMRustBuildVectorReduceMul<'a>(B: &Builder<'a>, Src: &'a Value) -> &'a Value; LLVMRustBuildVectorReduceAnd<'a>(B: &Builder<'a>, Src: &'a Value) -> &'a Value1776 pub fn LLVMRustBuildVectorReduceAnd<'a>(B: &Builder<'a>, Src: &'a Value) -> &'a Value; LLVMRustBuildVectorReduceOr<'a>(B: &Builder<'a>, Src: &'a Value) -> &'a Value1777 pub fn LLVMRustBuildVectorReduceOr<'a>(B: &Builder<'a>, Src: &'a Value) -> &'a Value; LLVMRustBuildVectorReduceXor<'a>(B: &Builder<'a>, Src: &'a Value) -> &'a Value1778 pub fn LLVMRustBuildVectorReduceXor<'a>(B: &Builder<'a>, Src: &'a Value) -> &'a Value; LLVMRustBuildVectorReduceMin<'a>( B: &Builder<'a>, Src: &'a Value, IsSigned: bool, ) -> &'a Value1779 pub fn LLVMRustBuildVectorReduceMin<'a>( 1780 B: &Builder<'a>, 1781 Src: &'a Value, 1782 IsSigned: bool, 1783 ) -> &'a Value; LLVMRustBuildVectorReduceMax<'a>( B: &Builder<'a>, Src: &'a Value, IsSigned: bool, ) -> &'a Value1784 pub fn LLVMRustBuildVectorReduceMax<'a>( 1785 B: &Builder<'a>, 1786 Src: &'a Value, 1787 IsSigned: bool, 1788 ) -> &'a Value; LLVMRustBuildVectorReduceFMin<'a>( B: &Builder<'a>, Src: &'a Value, IsNaN: bool, ) -> &'a Value1789 pub fn LLVMRustBuildVectorReduceFMin<'a>( 1790 B: &Builder<'a>, 1791 Src: &'a Value, 1792 IsNaN: bool, 1793 ) -> &'a Value; LLVMRustBuildVectorReduceFMax<'a>( B: &Builder<'a>, Src: &'a Value, IsNaN: bool, ) -> &'a Value1794 pub fn LLVMRustBuildVectorReduceFMax<'a>( 1795 B: &Builder<'a>, 1796 Src: &'a Value, 1797 IsNaN: bool, 1798 ) -> &'a Value; 1799 LLVMRustBuildMinNum<'a>(B: &Builder<'a>, LHS: &'a Value, LHS: &'a Value) -> &'a Value1800 pub fn LLVMRustBuildMinNum<'a>(B: &Builder<'a>, LHS: &'a Value, LHS: &'a Value) -> &'a Value; LLVMRustBuildMaxNum<'a>(B: &Builder<'a>, LHS: &'a Value, LHS: &'a Value) -> &'a Value1801 pub fn LLVMRustBuildMaxNum<'a>(B: &Builder<'a>, LHS: &'a Value, LHS: &'a Value) -> &'a Value; 1802 1803 // Atomic Operations LLVMRustBuildAtomicLoad<'a>( B: &Builder<'a>, ElementType: &'a Type, PointerVal: &'a Value, Name: *const c_char, Order: AtomicOrdering, ) -> &'a Value1804 pub fn LLVMRustBuildAtomicLoad<'a>( 1805 B: &Builder<'a>, 1806 ElementType: &'a Type, 1807 PointerVal: &'a Value, 1808 Name: *const c_char, 1809 Order: AtomicOrdering, 1810 ) -> &'a Value; 1811 LLVMRustBuildAtomicStore<'a>( B: &Builder<'a>, Val: &'a Value, Ptr: &'a Value, Order: AtomicOrdering, ) -> &'a Value1812 pub fn LLVMRustBuildAtomicStore<'a>( 1813 B: &Builder<'a>, 1814 Val: &'a Value, 1815 Ptr: &'a Value, 1816 Order: AtomicOrdering, 1817 ) -> &'a Value; 1818 LLVMBuildAtomicCmpXchg<'a>( B: &Builder<'a>, LHS: &'a Value, CMP: &'a Value, RHS: &'a Value, Order: AtomicOrdering, FailureOrder: AtomicOrdering, SingleThreaded: Bool, ) -> &'a Value1819 pub fn LLVMBuildAtomicCmpXchg<'a>( 1820 B: &Builder<'a>, 1821 LHS: &'a Value, 1822 CMP: &'a Value, 1823 RHS: &'a Value, 1824 Order: AtomicOrdering, 1825 FailureOrder: AtomicOrdering, 1826 SingleThreaded: Bool, 1827 ) -> &'a Value; 1828 LLVMSetWeak(CmpXchgInst: &Value, IsWeak: Bool)1829 pub fn LLVMSetWeak(CmpXchgInst: &Value, IsWeak: Bool); 1830 LLVMBuildAtomicRMW<'a>( B: &Builder<'a>, Op: AtomicRmwBinOp, LHS: &'a Value, RHS: &'a Value, Order: AtomicOrdering, SingleThreaded: Bool, ) -> &'a Value1831 pub fn LLVMBuildAtomicRMW<'a>( 1832 B: &Builder<'a>, 1833 Op: AtomicRmwBinOp, 1834 LHS: &'a Value, 1835 RHS: &'a Value, 1836 Order: AtomicOrdering, 1837 SingleThreaded: Bool, 1838 ) -> &'a Value; 1839 LLVMBuildFence<'a>( B: &Builder<'a>, Order: AtomicOrdering, SingleThreaded: Bool, Name: *const c_char, ) -> &'a Value1840 pub fn LLVMBuildFence<'a>( 1841 B: &Builder<'a>, 1842 Order: AtomicOrdering, 1843 SingleThreaded: Bool, 1844 Name: *const c_char, 1845 ) -> &'a Value; 1846 1847 /// Writes a module to the specified path. Returns 0 on success. LLVMWriteBitcodeToFile(M: &Module, Path: *const c_char) -> c_int1848 pub fn LLVMWriteBitcodeToFile(M: &Module, Path: *const c_char) -> c_int; 1849 1850 /// Creates a legacy pass manager -- only used for final codegen. LLVMCreatePassManager<'a>() -> &'a mut PassManager<'a>1851 pub fn LLVMCreatePassManager<'a>() -> &'a mut PassManager<'a>; 1852 LLVMTimeTraceProfilerInitialize()1853 pub fn LLVMTimeTraceProfilerInitialize(); 1854 LLVMTimeTraceProfilerFinishThread()1855 pub fn LLVMTimeTraceProfilerFinishThread(); 1856 LLVMTimeTraceProfilerFinish(FileName: *const c_char)1857 pub fn LLVMTimeTraceProfilerFinish(FileName: *const c_char); 1858 LLVMAddAnalysisPasses<'a>(T: &'a TargetMachine, PM: &PassManager<'a>)1859 pub fn LLVMAddAnalysisPasses<'a>(T: &'a TargetMachine, PM: &PassManager<'a>); 1860 LLVMGetHostCPUFeatures() -> *mut c_char1861 pub fn LLVMGetHostCPUFeatures() -> *mut c_char; 1862 LLVMDisposeMessage(message: *mut c_char)1863 pub fn LLVMDisposeMessage(message: *mut c_char); 1864 LLVMIsMultithreaded() -> Bool1865 pub fn LLVMIsMultithreaded() -> Bool; 1866 1867 /// Returns a string describing the last error caused by an LLVMRust* call. LLVMRustGetLastError() -> *const c_char1868 pub fn LLVMRustGetLastError() -> *const c_char; 1869 1870 /// Print the pass timings since static dtors aren't picking them up. LLVMRustPrintPassTimings()1871 pub fn LLVMRustPrintPassTimings(); 1872 LLVMStructCreateNamed(C: &Context, Name: *const c_char) -> &Type1873 pub fn LLVMStructCreateNamed(C: &Context, Name: *const c_char) -> &Type; 1874 LLVMStructSetBody<'a>( StructTy: &'a Type, ElementTypes: *const &'a Type, ElementCount: c_uint, Packed: Bool, )1875 pub fn LLVMStructSetBody<'a>( 1876 StructTy: &'a Type, 1877 ElementTypes: *const &'a Type, 1878 ElementCount: c_uint, 1879 Packed: Bool, 1880 ); 1881 1882 /// 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, CanThrow: Bool, ) -> &Value1883 pub fn LLVMRustInlineAsm( 1884 Ty: &Type, 1885 AsmString: *const c_char, 1886 AsmStringLen: size_t, 1887 Constraints: *const c_char, 1888 ConstraintsLen: size_t, 1889 SideEffects: Bool, 1890 AlignStack: Bool, 1891 Dialect: AsmDialect, 1892 CanThrow: Bool, 1893 ) -> &Value; LLVMRustInlineAsmVerify( Ty: &Type, Constraints: *const c_char, ConstraintsLen: size_t, ) -> bool1894 pub fn LLVMRustInlineAsmVerify( 1895 Ty: &Type, 1896 Constraints: *const c_char, 1897 ConstraintsLen: size_t, 1898 ) -> bool; 1899 1900 #[allow(improper_ctypes)] LLVMRustCoverageWriteFilenamesSectionToBuffer( Filenames: *const *const c_char, FilenamesLen: size_t, BufferOut: &RustString, )1901 pub fn LLVMRustCoverageWriteFilenamesSectionToBuffer( 1902 Filenames: *const *const c_char, 1903 FilenamesLen: size_t, 1904 BufferOut: &RustString, 1905 ); 1906 1907 #[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, )1908 pub fn LLVMRustCoverageWriteMappingToBuffer( 1909 VirtualFileMappingIDs: *const c_uint, 1910 NumVirtualFileMappingIDs: c_uint, 1911 Expressions: *const coverage_map::CounterExpression, 1912 NumExpressions: c_uint, 1913 MappingRegions: *const coverageinfo::CounterMappingRegion, 1914 NumMappingRegions: c_uint, 1915 BufferOut: &RustString, 1916 ); 1917 LLVMRustCoverageCreatePGOFuncNameVar(F: &Value, FuncName: *const c_char) -> &Value1918 pub fn LLVMRustCoverageCreatePGOFuncNameVar(F: &Value, FuncName: *const c_char) -> &Value; LLVMRustCoverageHashCString(StrVal: *const c_char) -> u641919 pub fn LLVMRustCoverageHashCString(StrVal: *const c_char) -> u64; LLVMRustCoverageHashByteArray(Bytes: *const c_char, NumBytes: size_t) -> u641920 pub fn LLVMRustCoverageHashByteArray(Bytes: *const c_char, NumBytes: size_t) -> u64; 1921 1922 #[allow(improper_ctypes)] LLVMRustCoverageWriteMapSectionNameToString(M: &Module, Str: &RustString)1923 pub fn LLVMRustCoverageWriteMapSectionNameToString(M: &Module, Str: &RustString); 1924 1925 #[allow(improper_ctypes)] LLVMRustCoverageWriteFuncSectionNameToString(M: &Module, Str: &RustString)1926 pub fn LLVMRustCoverageWriteFuncSectionNameToString(M: &Module, Str: &RustString); 1927 1928 #[allow(improper_ctypes)] LLVMRustCoverageWriteMappingVarNameToString(Str: &RustString)1929 pub fn LLVMRustCoverageWriteMappingVarNameToString(Str: &RustString); 1930 LLVMRustCoverageMappingVersion() -> u321931 pub fn LLVMRustCoverageMappingVersion() -> u32; LLVMRustDebugMetadataVersion() -> u321932 pub fn LLVMRustDebugMetadataVersion() -> u32; LLVMRustVersionMajor() -> u321933 pub fn LLVMRustVersionMajor() -> u32; LLVMRustVersionMinor() -> u321934 pub fn LLVMRustVersionMinor() -> u32; LLVMRustVersionPatch() -> u321935 pub fn LLVMRustVersionPatch() -> u32; 1936 1937 /// Add LLVM module flags. 1938 /// 1939 /// In order for Rust-C LTO to work, module flags must be compatible with Clang. What 1940 /// "compatible" means depends on the merge behaviors involved. LLVMRustAddModuleFlag( M: &Module, merge_behavior: LLVMModFlagBehavior, name: *const c_char, value: u32, )1941 pub fn LLVMRustAddModuleFlag( 1942 M: &Module, 1943 merge_behavior: LLVMModFlagBehavior, 1944 name: *const c_char, 1945 value: u32, 1946 ); LLVMRustHasModuleFlag(M: &Module, name: *const c_char, len: size_t) -> bool1947 pub fn LLVMRustHasModuleFlag(M: &Module, name: *const c_char, len: size_t) -> bool; 1948 LLVMMetadataAsValue<'a>(C: &'a Context, MD: &'a Metadata) -> &'a Value1949 pub fn LLVMMetadataAsValue<'a>(C: &'a Context, MD: &'a Metadata) -> &'a Value; 1950 LLVMRustDIBuilderCreate(M: &Module) -> &mut DIBuilder<'_>1951 pub fn LLVMRustDIBuilderCreate(M: &Module) -> &mut DIBuilder<'_>; 1952 LLVMRustDIBuilderDispose<'a>(Builder: &'a mut DIBuilder<'a>)1953 pub fn LLVMRustDIBuilderDispose<'a>(Builder: &'a mut DIBuilder<'a>); 1954 LLVMRustDIBuilderFinalize(Builder: &DIBuilder<'_>)1955 pub fn LLVMRustDIBuilderFinalize(Builder: &DIBuilder<'_>); 1956 LLVMRustDIBuilderCreateCompileUnit<'a>( 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 DIDescriptor1957 pub fn LLVMRustDIBuilderCreateCompileUnit<'a>( 1958 Builder: &DIBuilder<'a>, 1959 Lang: c_uint, 1960 File: &'a DIFile, 1961 Producer: *const c_char, 1962 ProducerLen: size_t, 1963 isOptimized: bool, 1964 Flags: *const c_char, 1965 RuntimeVer: c_uint, 1966 SplitName: *const c_char, 1967 SplitNameLen: size_t, 1968 kind: DebugEmissionKind, 1969 DWOId: u64, 1970 SplitDebugInlining: bool, 1971 ) -> &'a DIDescriptor; 1972 LLVMRustDIBuilderCreateFile<'a>( 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 DIFile1973 pub fn LLVMRustDIBuilderCreateFile<'a>( 1974 Builder: &DIBuilder<'a>, 1975 Filename: *const c_char, 1976 FilenameLen: size_t, 1977 Directory: *const c_char, 1978 DirectoryLen: size_t, 1979 CSKind: ChecksumKind, 1980 Checksum: *const c_char, 1981 ChecksumLen: size_t, 1982 ) -> &'a DIFile; 1983 LLVMRustDIBuilderCreateSubroutineType<'a>( Builder: &DIBuilder<'a>, ParameterTypes: &'a DIArray, ) -> &'a DICompositeType1984 pub fn LLVMRustDIBuilderCreateSubroutineType<'a>( 1985 Builder: &DIBuilder<'a>, 1986 ParameterTypes: &'a DIArray, 1987 ) -> &'a DICompositeType; 1988 LLVMRustDIBuilderCreateFunction<'a>( 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 DISubprogram1989 pub fn LLVMRustDIBuilderCreateFunction<'a>( 1990 Builder: &DIBuilder<'a>, 1991 Scope: &'a DIDescriptor, 1992 Name: *const c_char, 1993 NameLen: size_t, 1994 LinkageName: *const c_char, 1995 LinkageNameLen: size_t, 1996 File: &'a DIFile, 1997 LineNo: c_uint, 1998 Ty: &'a DIType, 1999 ScopeLine: c_uint, 2000 Flags: DIFlags, 2001 SPFlags: DISPFlags, 2002 MaybeFn: Option<&'a Value>, 2003 TParam: &'a DIArray, 2004 Decl: Option<&'a DIDescriptor>, 2005 ) -> &'a DISubprogram; 2006 LLVMRustDIBuilderCreateMethod<'a>( 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, Flags: DIFlags, SPFlags: DISPFlags, TParam: &'a DIArray, ) -> &'a DISubprogram2007 pub fn LLVMRustDIBuilderCreateMethod<'a>( 2008 Builder: &DIBuilder<'a>, 2009 Scope: &'a DIDescriptor, 2010 Name: *const c_char, 2011 NameLen: size_t, 2012 LinkageName: *const c_char, 2013 LinkageNameLen: size_t, 2014 File: &'a DIFile, 2015 LineNo: c_uint, 2016 Ty: &'a DIType, 2017 Flags: DIFlags, 2018 SPFlags: DISPFlags, 2019 TParam: &'a DIArray, 2020 ) -> &'a DISubprogram; 2021 LLVMRustDIBuilderCreateBasicType<'a>( Builder: &DIBuilder<'a>, Name: *const c_char, NameLen: size_t, SizeInBits: u64, Encoding: c_uint, ) -> &'a DIBasicType2022 pub fn LLVMRustDIBuilderCreateBasicType<'a>( 2023 Builder: &DIBuilder<'a>, 2024 Name: *const c_char, 2025 NameLen: size_t, 2026 SizeInBits: u64, 2027 Encoding: c_uint, 2028 ) -> &'a DIBasicType; 2029 LLVMRustDIBuilderCreateTypedef<'a>( Builder: &DIBuilder<'a>, Type: &'a DIBasicType, Name: *const c_char, NameLen: size_t, File: &'a DIFile, LineNo: c_uint, Scope: Option<&'a DIScope>, ) -> &'a DIDerivedType2030 pub fn LLVMRustDIBuilderCreateTypedef<'a>( 2031 Builder: &DIBuilder<'a>, 2032 Type: &'a DIBasicType, 2033 Name: *const c_char, 2034 NameLen: size_t, 2035 File: &'a DIFile, 2036 LineNo: c_uint, 2037 Scope: Option<&'a DIScope>, 2038 ) -> &'a DIDerivedType; 2039 LLVMRustDIBuilderCreatePointerType<'a>( Builder: &DIBuilder<'a>, PointeeTy: &'a DIType, SizeInBits: u64, AlignInBits: u32, AddressSpace: c_uint, Name: *const c_char, NameLen: size_t, ) -> &'a DIDerivedType2040 pub fn LLVMRustDIBuilderCreatePointerType<'a>( 2041 Builder: &DIBuilder<'a>, 2042 PointeeTy: &'a DIType, 2043 SizeInBits: u64, 2044 AlignInBits: u32, 2045 AddressSpace: c_uint, 2046 Name: *const c_char, 2047 NameLen: size_t, 2048 ) -> &'a DIDerivedType; 2049 LLVMRustDIBuilderCreateStructType<'a>( 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 DICompositeType2050 pub fn LLVMRustDIBuilderCreateStructType<'a>( 2051 Builder: &DIBuilder<'a>, 2052 Scope: Option<&'a DIDescriptor>, 2053 Name: *const c_char, 2054 NameLen: size_t, 2055 File: &'a DIFile, 2056 LineNumber: c_uint, 2057 SizeInBits: u64, 2058 AlignInBits: u32, 2059 Flags: DIFlags, 2060 DerivedFrom: Option<&'a DIType>, 2061 Elements: &'a DIArray, 2062 RunTimeLang: c_uint, 2063 VTableHolder: Option<&'a DIType>, 2064 UniqueId: *const c_char, 2065 UniqueIdLen: size_t, 2066 ) -> &'a DICompositeType; 2067 LLVMRustDIBuilderCreateMemberType<'a>( 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 DIDerivedType2068 pub fn LLVMRustDIBuilderCreateMemberType<'a>( 2069 Builder: &DIBuilder<'a>, 2070 Scope: &'a DIDescriptor, 2071 Name: *const c_char, 2072 NameLen: size_t, 2073 File: &'a DIFile, 2074 LineNo: c_uint, 2075 SizeInBits: u64, 2076 AlignInBits: u32, 2077 OffsetInBits: u64, 2078 Flags: DIFlags, 2079 Ty: &'a DIType, 2080 ) -> &'a DIDerivedType; 2081 LLVMRustDIBuilderCreateVariantMemberType<'a>( 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 DIType2082 pub fn LLVMRustDIBuilderCreateVariantMemberType<'a>( 2083 Builder: &DIBuilder<'a>, 2084 Scope: &'a DIScope, 2085 Name: *const c_char, 2086 NameLen: size_t, 2087 File: &'a DIFile, 2088 LineNumber: c_uint, 2089 SizeInBits: u64, 2090 AlignInBits: u32, 2091 OffsetInBits: u64, 2092 Discriminant: Option<&'a Value>, 2093 Flags: DIFlags, 2094 Ty: &'a DIType, 2095 ) -> &'a DIType; 2096 LLVMRustDIBuilderCreateStaticMemberType<'a>( Builder: &DIBuilder<'a>, Scope: &'a DIDescriptor, Name: *const c_char, NameLen: size_t, File: &'a DIFile, LineNo: c_uint, Ty: &'a DIType, Flags: DIFlags, val: Option<&'a Value>, AlignInBits: u32, ) -> &'a DIDerivedType2097 pub fn LLVMRustDIBuilderCreateStaticMemberType<'a>( 2098 Builder: &DIBuilder<'a>, 2099 Scope: &'a DIDescriptor, 2100 Name: *const c_char, 2101 NameLen: size_t, 2102 File: &'a DIFile, 2103 LineNo: c_uint, 2104 Ty: &'a DIType, 2105 Flags: DIFlags, 2106 val: Option<&'a Value>, 2107 AlignInBits: u32, 2108 ) -> &'a DIDerivedType; 2109 LLVMRustDIBuilderCreateLexicalBlock<'a>( Builder: &DIBuilder<'a>, Scope: &'a DIScope, File: &'a DIFile, Line: c_uint, Col: c_uint, ) -> &'a DILexicalBlock2110 pub fn LLVMRustDIBuilderCreateLexicalBlock<'a>( 2111 Builder: &DIBuilder<'a>, 2112 Scope: &'a DIScope, 2113 File: &'a DIFile, 2114 Line: c_uint, 2115 Col: c_uint, 2116 ) -> &'a DILexicalBlock; 2117 LLVMRustDIBuilderCreateLexicalBlockFile<'a>( Builder: &DIBuilder<'a>, Scope: &'a DIScope, File: &'a DIFile, ) -> &'a DILexicalBlock2118 pub fn LLVMRustDIBuilderCreateLexicalBlockFile<'a>( 2119 Builder: &DIBuilder<'a>, 2120 Scope: &'a DIScope, 2121 File: &'a DIFile, 2122 ) -> &'a DILexicalBlock; 2123 LLVMRustDIBuilderCreateStaticVariable<'a>( 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 DIGlobalVariableExpression2124 pub fn LLVMRustDIBuilderCreateStaticVariable<'a>( 2125 Builder: &DIBuilder<'a>, 2126 Context: Option<&'a DIScope>, 2127 Name: *const c_char, 2128 NameLen: size_t, 2129 LinkageName: *const c_char, 2130 LinkageNameLen: size_t, 2131 File: &'a DIFile, 2132 LineNo: c_uint, 2133 Ty: &'a DIType, 2134 isLocalToUnit: bool, 2135 Val: &'a Value, 2136 Decl: Option<&'a DIDescriptor>, 2137 AlignInBits: u32, 2138 ) -> &'a DIGlobalVariableExpression; 2139 LLVMRustDIBuilderCreateVariable<'a>( 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 DIVariable2140 pub fn LLVMRustDIBuilderCreateVariable<'a>( 2141 Builder: &DIBuilder<'a>, 2142 Tag: c_uint, 2143 Scope: &'a DIDescriptor, 2144 Name: *const c_char, 2145 NameLen: size_t, 2146 File: &'a DIFile, 2147 LineNo: c_uint, 2148 Ty: &'a DIType, 2149 AlwaysPreserve: bool, 2150 Flags: DIFlags, 2151 ArgNo: c_uint, 2152 AlignInBits: u32, 2153 ) -> &'a DIVariable; 2154 LLVMRustDIBuilderCreateArrayType<'a>( Builder: &DIBuilder<'a>, Size: u64, AlignInBits: u32, Ty: &'a DIType, Subscripts: &'a DIArray, ) -> &'a DIType2155 pub fn LLVMRustDIBuilderCreateArrayType<'a>( 2156 Builder: &DIBuilder<'a>, 2157 Size: u64, 2158 AlignInBits: u32, 2159 Ty: &'a DIType, 2160 Subscripts: &'a DIArray, 2161 ) -> &'a DIType; 2162 LLVMRustDIBuilderGetOrCreateSubrange<'a>( Builder: &DIBuilder<'a>, Lo: i64, Count: i64, ) -> &'a DISubrange2163 pub fn LLVMRustDIBuilderGetOrCreateSubrange<'a>( 2164 Builder: &DIBuilder<'a>, 2165 Lo: i64, 2166 Count: i64, 2167 ) -> &'a DISubrange; 2168 LLVMRustDIBuilderGetOrCreateArray<'a>( Builder: &DIBuilder<'a>, Ptr: *const Option<&'a DIDescriptor>, Count: c_uint, ) -> &'a DIArray2169 pub fn LLVMRustDIBuilderGetOrCreateArray<'a>( 2170 Builder: &DIBuilder<'a>, 2171 Ptr: *const Option<&'a DIDescriptor>, 2172 Count: c_uint, 2173 ) -> &'a DIArray; 2174 LLVMRustDIBuilderInsertDeclareAtEnd<'a>( Builder: &DIBuilder<'a>, Val: &'a Value, VarInfo: &'a DIVariable, AddrOps: *const u64, AddrOpsCount: c_uint, DL: &'a DILocation, InsertAtEnd: &'a BasicBlock, ) -> &'a Value2175 pub fn LLVMRustDIBuilderInsertDeclareAtEnd<'a>( 2176 Builder: &DIBuilder<'a>, 2177 Val: &'a Value, 2178 VarInfo: &'a DIVariable, 2179 AddrOps: *const u64, 2180 AddrOpsCount: c_uint, 2181 DL: &'a DILocation, 2182 InsertAtEnd: &'a BasicBlock, 2183 ) -> &'a Value; 2184 LLVMRustDIBuilderCreateEnumerator<'a>( Builder: &DIBuilder<'a>, Name: *const c_char, NameLen: size_t, Value: *const u64, SizeInBits: c_uint, IsUnsigned: bool, ) -> &'a DIEnumerator2185 pub fn LLVMRustDIBuilderCreateEnumerator<'a>( 2186 Builder: &DIBuilder<'a>, 2187 Name: *const c_char, 2188 NameLen: size_t, 2189 Value: *const u64, 2190 SizeInBits: c_uint, 2191 IsUnsigned: bool, 2192 ) -> &'a DIEnumerator; 2193 LLVMRustDIBuilderCreateEnumerationType<'a>( 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 DIType2194 pub fn LLVMRustDIBuilderCreateEnumerationType<'a>( 2195 Builder: &DIBuilder<'a>, 2196 Scope: &'a DIScope, 2197 Name: *const c_char, 2198 NameLen: size_t, 2199 File: &'a DIFile, 2200 LineNumber: c_uint, 2201 SizeInBits: u64, 2202 AlignInBits: u32, 2203 Elements: &'a DIArray, 2204 ClassType: &'a DIType, 2205 IsScoped: bool, 2206 ) -> &'a DIType; 2207 LLVMRustDIBuilderCreateUnionType<'a>( 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 DIType2208 pub fn LLVMRustDIBuilderCreateUnionType<'a>( 2209 Builder: &DIBuilder<'a>, 2210 Scope: Option<&'a DIScope>, 2211 Name: *const c_char, 2212 NameLen: size_t, 2213 File: &'a DIFile, 2214 LineNumber: c_uint, 2215 SizeInBits: u64, 2216 AlignInBits: u32, 2217 Flags: DIFlags, 2218 Elements: Option<&'a DIArray>, 2219 RunTimeLang: c_uint, 2220 UniqueId: *const c_char, 2221 UniqueIdLen: size_t, 2222 ) -> &'a DIType; 2223 LLVMRustDIBuilderCreateVariantPart<'a>( 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 DIDerivedType2224 pub fn LLVMRustDIBuilderCreateVariantPart<'a>( 2225 Builder: &DIBuilder<'a>, 2226 Scope: &'a DIScope, 2227 Name: *const c_char, 2228 NameLen: size_t, 2229 File: &'a DIFile, 2230 LineNo: c_uint, 2231 SizeInBits: u64, 2232 AlignInBits: u32, 2233 Flags: DIFlags, 2234 Discriminator: Option<&'a DIDerivedType>, 2235 Elements: &'a DIArray, 2236 UniqueId: *const c_char, 2237 UniqueIdLen: size_t, 2238 ) -> &'a DIDerivedType; 2239 LLVMSetUnnamedAddress(Global: &Value, UnnamedAddr: UnnamedAddr)2240 pub fn LLVMSetUnnamedAddress(Global: &Value, UnnamedAddr: UnnamedAddr); 2241 LLVMRustDIBuilderCreateTemplateTypeParameter<'a>( Builder: &DIBuilder<'a>, Scope: Option<&'a DIScope>, Name: *const c_char, NameLen: size_t, Ty: &'a DIType, ) -> &'a DITemplateTypeParameter2242 pub fn LLVMRustDIBuilderCreateTemplateTypeParameter<'a>( 2243 Builder: &DIBuilder<'a>, 2244 Scope: Option<&'a DIScope>, 2245 Name: *const c_char, 2246 NameLen: size_t, 2247 Ty: &'a DIType, 2248 ) -> &'a DITemplateTypeParameter; 2249 LLVMRustDIBuilderCreateNameSpace<'a>( Builder: &DIBuilder<'a>, Scope: Option<&'a DIScope>, Name: *const c_char, NameLen: size_t, ExportSymbols: bool, ) -> &'a DINameSpace2250 pub fn LLVMRustDIBuilderCreateNameSpace<'a>( 2251 Builder: &DIBuilder<'a>, 2252 Scope: Option<&'a DIScope>, 2253 Name: *const c_char, 2254 NameLen: size_t, 2255 ExportSymbols: bool, 2256 ) -> &'a DINameSpace; 2257 LLVMRustDICompositeTypeReplaceArrays<'a>( Builder: &DIBuilder<'a>, CompositeType: &'a DIType, Elements: Option<&'a DIArray>, Params: Option<&'a DIArray>, )2258 pub fn LLVMRustDICompositeTypeReplaceArrays<'a>( 2259 Builder: &DIBuilder<'a>, 2260 CompositeType: &'a DIType, 2261 Elements: Option<&'a DIArray>, 2262 Params: Option<&'a DIArray>, 2263 ); 2264 LLVMRustDIBuilderCreateDebugLocation<'a>( Line: c_uint, Column: c_uint, Scope: &'a DIScope, InlinedAt: Option<&'a DILocation>, ) -> &'a DILocation2265 pub fn LLVMRustDIBuilderCreateDebugLocation<'a>( 2266 Line: c_uint, 2267 Column: c_uint, 2268 Scope: &'a DIScope, 2269 InlinedAt: Option<&'a DILocation>, 2270 ) -> &'a DILocation; LLVMRustDIBuilderCreateOpDeref() -> u642271 pub fn LLVMRustDIBuilderCreateOpDeref() -> u64; LLVMRustDIBuilderCreateOpPlusUconst() -> u642272 pub fn LLVMRustDIBuilderCreateOpPlusUconst() -> u64; LLVMRustDIBuilderCreateOpLLVMFragment() -> u642273 pub fn LLVMRustDIBuilderCreateOpLLVMFragment() -> u64; 2274 2275 #[allow(improper_ctypes)] LLVMRustWriteTypeToString(Type: &Type, s: &RustString)2276 pub fn LLVMRustWriteTypeToString(Type: &Type, s: &RustString); 2277 #[allow(improper_ctypes)] LLVMRustWriteValueToString(value_ref: &Value, s: &RustString)2278 pub fn LLVMRustWriteValueToString(value_ref: &Value, s: &RustString); 2279 LLVMIsAConstantInt(value_ref: &Value) -> Option<&ConstantInt>2280 pub fn LLVMIsAConstantInt(value_ref: &Value) -> Option<&ConstantInt>; 2281 LLVMRustHasFeature(T: &TargetMachine, s: *const c_char) -> bool2282 pub fn LLVMRustHasFeature(T: &TargetMachine, s: *const c_char) -> bool; 2283 LLVMRustPrintTargetCPUs(T: &TargetMachine, cpu: *const c_char)2284 pub fn LLVMRustPrintTargetCPUs(T: &TargetMachine, cpu: *const c_char); LLVMRustGetTargetFeaturesCount(T: &TargetMachine) -> size_t2285 pub fn LLVMRustGetTargetFeaturesCount(T: &TargetMachine) -> size_t; LLVMRustGetTargetFeature( T: &TargetMachine, Index: size_t, Feature: &mut *const c_char, Desc: &mut *const c_char, )2286 pub fn LLVMRustGetTargetFeature( 2287 T: &TargetMachine, 2288 Index: size_t, 2289 Feature: &mut *const c_char, 2290 Desc: &mut *const c_char, 2291 ); 2292 LLVMRustGetHostCPUName(len: *mut usize) -> *const c_char2293 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, ForceEmulatedTls: bool, ) -> Option<&'static mut TargetMachine>2294 pub fn LLVMRustCreateTargetMachine( 2295 Triple: *const c_char, 2296 CPU: *const c_char, 2297 Features: *const c_char, 2298 Abi: *const c_char, 2299 Model: CodeModel, 2300 Reloc: RelocModel, 2301 Level: CodeGenOptLevel, 2302 UseSoftFP: bool, 2303 FunctionSections: bool, 2304 DataSections: bool, 2305 UniqueSectionNames: bool, 2306 TrapUnreachable: bool, 2307 Singlethread: bool, 2308 AsmComments: bool, 2309 EmitStackSizeSection: bool, 2310 RelaxELFRelocations: bool, 2311 UseInitArray: bool, 2312 SplitDwarfFile: *const c_char, 2313 ForceEmulatedTls: bool, 2314 ) -> Option<&'static mut TargetMachine>; LLVMRustDisposeTargetMachine(T: &'static mut TargetMachine)2315 pub fn LLVMRustDisposeTargetMachine(T: &'static mut TargetMachine); LLVMRustAddLibraryInfo<'a>( PM: &PassManager<'a>, M: &'a Module, DisableSimplifyLibCalls: bool, )2316 pub fn LLVMRustAddLibraryInfo<'a>( 2317 PM: &PassManager<'a>, 2318 M: &'a Module, 2319 DisableSimplifyLibCalls: bool, 2320 ); LLVMRustWriteOutputFile<'a>( T: &'a TargetMachine, PM: &PassManager<'a>, M: &'a Module, Output: *const c_char, DwoOutput: *const c_char, FileType: FileType, ) -> LLVMRustResult2321 pub fn LLVMRustWriteOutputFile<'a>( 2322 T: &'a TargetMachine, 2323 PM: &PassManager<'a>, 2324 M: &'a Module, 2325 Output: *const c_char, 2326 DwoOutput: *const c_char, 2327 FileType: FileType, 2328 ) -> LLVMRustResult; LLVMRustOptimize<'a>( 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, InstrProfileOutput: *const c_char, 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, LLVMPlugins: *const c_char, LLVMPluginsLen: size_t, ) -> LLVMRustResult2329 pub fn LLVMRustOptimize<'a>( 2330 M: &'a Module, 2331 TM: &'a TargetMachine, 2332 OptLevel: PassBuilderOptLevel, 2333 OptStage: OptStage, 2334 NoPrepopulatePasses: bool, 2335 VerifyIR: bool, 2336 UseThinLTOBuffers: bool, 2337 MergeFunctions: bool, 2338 UnrollLoops: bool, 2339 SLPVectorize: bool, 2340 LoopVectorize: bool, 2341 DisableSimplifyLibCalls: bool, 2342 EmitLifetimeMarkers: bool, 2343 SanitizerOptions: Option<&SanitizerOptions>, 2344 PGOGenPath: *const c_char, 2345 PGOUsePath: *const c_char, 2346 InstrumentCoverage: bool, 2347 InstrProfileOutput: *const c_char, 2348 InstrumentGCOV: bool, 2349 PGOSampleUsePath: *const c_char, 2350 DebugInfoForProfiling: bool, 2351 llvm_selfprofiler: *mut c_void, 2352 begin_callback: SelfProfileBeforePassCallback, 2353 end_callback: SelfProfileAfterPassCallback, 2354 ExtraPasses: *const c_char, 2355 ExtraPassesLen: size_t, 2356 LLVMPlugins: *const c_char, 2357 LLVMPluginsLen: size_t, 2358 ) -> LLVMRustResult; LLVMRustPrintModule( M: &Module, Output: *const c_char, Demangle: extern "C" fn(*const c_char, size_t, *mut c_char, size_t) -> size_t, ) -> LLVMRustResult2359 pub fn LLVMRustPrintModule( 2360 M: &Module, 2361 Output: *const c_char, 2362 Demangle: extern "C" fn(*const c_char, size_t, *mut c_char, size_t) -> size_t, 2363 ) -> LLVMRustResult; LLVMRustSetLLVMOptions(Argc: c_int, Argv: *const *const c_char)2364 pub fn LLVMRustSetLLVMOptions(Argc: c_int, Argv: *const *const c_char); LLVMRustPrintPasses()2365 pub fn LLVMRustPrintPasses(); LLVMRustSetNormalizedTarget(M: &Module, triple: *const c_char)2366 pub fn LLVMRustSetNormalizedTarget(M: &Module, triple: *const c_char); LLVMRustRunRestrictionPass(M: &Module, syms: *const *const c_char, len: size_t)2367 pub fn LLVMRustRunRestrictionPass(M: &Module, syms: *const *const c_char, len: size_t); 2368 LLVMRustOpenArchive(path: *const c_char) -> Option<&'static mut Archive>2369 pub fn LLVMRustOpenArchive(path: *const c_char) -> Option<&'static mut Archive>; LLVMRustArchiveIteratorNew(AR: &Archive) -> &mut ArchiveIterator<'_>2370 pub fn LLVMRustArchiveIteratorNew(AR: &Archive) -> &mut ArchiveIterator<'_>; LLVMRustArchiveIteratorNext<'a>( AIR: &ArchiveIterator<'a>, ) -> Option<&'a mut ArchiveChild<'a>>2371 pub fn LLVMRustArchiveIteratorNext<'a>( 2372 AIR: &ArchiveIterator<'a>, 2373 ) -> Option<&'a mut ArchiveChild<'a>>; LLVMRustArchiveChildName(ACR: &ArchiveChild<'_>, size: &mut size_t) -> *const c_char2374 pub fn LLVMRustArchiveChildName(ACR: &ArchiveChild<'_>, size: &mut size_t) -> *const c_char; LLVMRustArchiveChildFree<'a>(ACR: &'a mut ArchiveChild<'a>)2375 pub fn LLVMRustArchiveChildFree<'a>(ACR: &'a mut ArchiveChild<'a>); LLVMRustArchiveIteratorFree<'a>(AIR: &'a mut ArchiveIterator<'a>)2376 pub fn LLVMRustArchiveIteratorFree<'a>(AIR: &'a mut ArchiveIterator<'a>); LLVMRustDestroyArchive(AR: &'static mut Archive)2377 pub fn LLVMRustDestroyArchive(AR: &'static mut Archive); 2378 2379 #[allow(improper_ctypes)] LLVMRustWriteTwineToString(T: &Twine, s: &RustString)2380 pub fn LLVMRustWriteTwineToString(T: &Twine, s: &RustString); 2381 2382 #[allow(improper_ctypes)] LLVMRustUnpackOptimizationDiagnostic<'a>( 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, )2383 pub fn LLVMRustUnpackOptimizationDiagnostic<'a>( 2384 DI: &'a DiagnosticInfo, 2385 pass_name_out: &RustString, 2386 function_out: &mut Option<&'a Value>, 2387 loc_line_out: &mut c_uint, 2388 loc_column_out: &mut c_uint, 2389 loc_filename_out: &RustString, 2390 message_out: &RustString, 2391 ); 2392 LLVMRustUnpackInlineAsmDiagnostic<'a>( DI: &'a DiagnosticInfo, level_out: &mut DiagnosticLevel, cookie_out: &mut c_uint, message_out: &mut Option<&'a Twine>, )2393 pub fn LLVMRustUnpackInlineAsmDiagnostic<'a>( 2394 DI: &'a DiagnosticInfo, 2395 level_out: &mut DiagnosticLevel, 2396 cookie_out: &mut c_uint, 2397 message_out: &mut Option<&'a Twine>, 2398 ); 2399 2400 #[allow(improper_ctypes)] LLVMRustWriteDiagnosticInfoToString(DI: &DiagnosticInfo, s: &RustString)2401 pub fn LLVMRustWriteDiagnosticInfoToString(DI: &DiagnosticInfo, s: &RustString); LLVMRustGetDiagInfoKind(DI: &DiagnosticInfo) -> DiagnosticKind2402 pub fn LLVMRustGetDiagInfoKind(DI: &DiagnosticInfo) -> DiagnosticKind; 2403 LLVMRustGetSMDiagnostic<'a>( DI: &'a DiagnosticInfo, cookie_out: &mut c_uint, ) -> &'a SMDiagnostic2404 pub fn LLVMRustGetSMDiagnostic<'a>( 2405 DI: &'a DiagnosticInfo, 2406 cookie_out: &mut c_uint, 2407 ) -> &'a SMDiagnostic; 2408 2409 #[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, ) -> bool2410 pub fn LLVMRustUnpackSMDiagnostic( 2411 d: &SMDiagnostic, 2412 message_out: &RustString, 2413 buffer_out: &RustString, 2414 level_out: &mut DiagnosticLevel, 2415 loc_out: &mut c_uint, 2416 ranges_out: *mut c_uint, 2417 num_ranges: &mut usize, 2418 ) -> bool; 2419 LLVMRustWriteArchive( Dst: *const c_char, NumMembers: size_t, Members: *const &RustArchiveMember<'_>, WriteSymbtab: bool, Kind: ArchiveKind, ) -> LLVMRustResult2420 pub fn LLVMRustWriteArchive( 2421 Dst: *const c_char, 2422 NumMembers: size_t, 2423 Members: *const &RustArchiveMember<'_>, 2424 WriteSymbtab: bool, 2425 Kind: ArchiveKind, 2426 ) -> LLVMRustResult; LLVMRustArchiveMemberNew<'a>( Filename: *const c_char, Name: *const c_char, Child: Option<&ArchiveChild<'a>>, ) -> &'a mut RustArchiveMember<'a>2427 pub fn LLVMRustArchiveMemberNew<'a>( 2428 Filename: *const c_char, 2429 Name: *const c_char, 2430 Child: Option<&ArchiveChild<'a>>, 2431 ) -> &'a mut RustArchiveMember<'a>; LLVMRustArchiveMemberFree<'a>(Member: &'a mut RustArchiveMember<'a>)2432 pub fn LLVMRustArchiveMemberFree<'a>(Member: &'a mut RustArchiveMember<'a>); 2433 LLVMRustWriteImportLibrary( ImportName: *const c_char, Path: *const c_char, Exports: *const LLVMRustCOFFShortExport, NumExports: usize, Machine: u16, MinGW: bool, ) -> LLVMRustResult2434 pub fn LLVMRustWriteImportLibrary( 2435 ImportName: *const c_char, 2436 Path: *const c_char, 2437 Exports: *const LLVMRustCOFFShortExport, 2438 NumExports: usize, 2439 Machine: u16, 2440 MinGW: bool, 2441 ) -> LLVMRustResult; 2442 LLVMRustSetDataLayoutFromTargetMachine<'a>(M: &'a Module, TM: &'a TargetMachine)2443 pub fn LLVMRustSetDataLayoutFromTargetMachine<'a>(M: &'a Module, TM: &'a TargetMachine); 2444 LLVMRustBuildOperandBundleDef( Name: *const c_char, Inputs: *const &'_ Value, NumInputs: c_uint, ) -> &mut OperandBundleDef<'_>2445 pub fn LLVMRustBuildOperandBundleDef( 2446 Name: *const c_char, 2447 Inputs: *const &'_ Value, 2448 NumInputs: c_uint, 2449 ) -> &mut OperandBundleDef<'_>; LLVMRustFreeOperandBundleDef<'a>(Bundle: &'a mut OperandBundleDef<'a>)2450 pub fn LLVMRustFreeOperandBundleDef<'a>(Bundle: &'a mut OperandBundleDef<'a>); 2451 LLVMRustPositionBuilderAtStart<'a>(B: &Builder<'a>, BB: &'a BasicBlock)2452 pub fn LLVMRustPositionBuilderAtStart<'a>(B: &Builder<'a>, BB: &'a BasicBlock); 2453 LLVMRustSetComdat<'a>(M: &'a Module, V: &'a Value, Name: *const c_char, NameLen: size_t)2454 pub fn LLVMRustSetComdat<'a>(M: &'a Module, V: &'a Value, Name: *const c_char, NameLen: size_t); LLVMRustSetModulePICLevel(M: &Module)2455 pub fn LLVMRustSetModulePICLevel(M: &Module); LLVMRustSetModulePIELevel(M: &Module)2456 pub fn LLVMRustSetModulePIELevel(M: &Module); LLVMRustSetModuleCodeModel(M: &Module, Model: CodeModel)2457 pub fn LLVMRustSetModuleCodeModel(M: &Module, Model: CodeModel); LLVMRustModuleBufferCreate(M: &Module) -> &'static mut ModuleBuffer2458 pub fn LLVMRustModuleBufferCreate(M: &Module) -> &'static mut ModuleBuffer; LLVMRustModuleBufferPtr(p: &ModuleBuffer) -> *const u82459 pub fn LLVMRustModuleBufferPtr(p: &ModuleBuffer) -> *const u8; LLVMRustModuleBufferLen(p: &ModuleBuffer) -> usize2460 pub fn LLVMRustModuleBufferLen(p: &ModuleBuffer) -> usize; LLVMRustModuleBufferFree(p: &'static mut ModuleBuffer)2461 pub fn LLVMRustModuleBufferFree(p: &'static mut ModuleBuffer); LLVMRustModuleCost(M: &Module) -> u642462 pub fn LLVMRustModuleCost(M: &Module) -> u64; 2463 #[allow(improper_ctypes)] LLVMRustModuleInstructionStats(M: &Module, Str: &RustString)2464 pub fn LLVMRustModuleInstructionStats(M: &Module, Str: &RustString); 2465 LLVMRustThinLTOBufferCreate(M: &Module, is_thin: bool) -> &'static mut ThinLTOBuffer2466 pub fn LLVMRustThinLTOBufferCreate(M: &Module, is_thin: bool) -> &'static mut ThinLTOBuffer; LLVMRustThinLTOBufferFree(M: &'static mut ThinLTOBuffer)2467 pub fn LLVMRustThinLTOBufferFree(M: &'static mut ThinLTOBuffer); LLVMRustThinLTOBufferPtr(M: &ThinLTOBuffer) -> *const c_char2468 pub fn LLVMRustThinLTOBufferPtr(M: &ThinLTOBuffer) -> *const c_char; LLVMRustThinLTOBufferLen(M: &ThinLTOBuffer) -> size_t2469 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>2470 pub fn LLVMRustCreateThinLTOData( 2471 Modules: *const ThinLTOModule, 2472 NumModules: c_uint, 2473 PreservedSymbols: *const *const c_char, 2474 PreservedSymbolsLen: c_uint, 2475 ) -> Option<&'static mut ThinLTOData>; LLVMRustPrepareThinLTORename( Data: &ThinLTOData, Module: &Module, Target: &TargetMachine, ) -> bool2476 pub fn LLVMRustPrepareThinLTORename( 2477 Data: &ThinLTOData, 2478 Module: &Module, 2479 Target: &TargetMachine, 2480 ) -> bool; LLVMRustPrepareThinLTOResolveWeak(Data: &ThinLTOData, Module: &Module) -> bool2481 pub fn LLVMRustPrepareThinLTOResolveWeak(Data: &ThinLTOData, Module: &Module) -> bool; LLVMRustPrepareThinLTOInternalize(Data: &ThinLTOData, Module: &Module) -> bool2482 pub fn LLVMRustPrepareThinLTOInternalize(Data: &ThinLTOData, Module: &Module) -> bool; LLVMRustPrepareThinLTOImport( Data: &ThinLTOData, Module: &Module, Target: &TargetMachine, ) -> bool2483 pub fn LLVMRustPrepareThinLTOImport( 2484 Data: &ThinLTOData, 2485 Module: &Module, 2486 Target: &TargetMachine, 2487 ) -> bool; LLVMRustFreeThinLTOData(Data: &'static mut ThinLTOData)2488 pub fn LLVMRustFreeThinLTOData(Data: &'static mut ThinLTOData); LLVMRustParseBitcodeForLTO( Context: &Context, Data: *const u8, len: usize, Identifier: *const c_char, ) -> Option<&Module>2489 pub fn LLVMRustParseBitcodeForLTO( 2490 Context: &Context, 2491 Data: *const u8, 2492 len: usize, 2493 Identifier: *const c_char, 2494 ) -> Option<&Module>; LLVMRustGetBitcodeSliceFromObjectData( Data: *const u8, len: usize, out_len: &mut usize, ) -> *const u82495 pub fn LLVMRustGetBitcodeSliceFromObjectData( 2496 Data: *const u8, 2497 len: usize, 2498 out_len: &mut usize, 2499 ) -> *const u8; 2500 LLVMRustLinkerNew(M: &Module) -> &mut Linker<'_>2501 pub fn LLVMRustLinkerNew(M: &Module) -> &mut Linker<'_>; LLVMRustLinkerAdd( linker: &Linker<'_>, bytecode: *const c_char, bytecode_len: usize, ) -> bool2502 pub fn LLVMRustLinkerAdd( 2503 linker: &Linker<'_>, 2504 bytecode: *const c_char, 2505 bytecode_len: usize, 2506 ) -> bool; LLVMRustLinkerFree<'a>(linker: &'a mut Linker<'a>)2507 pub fn LLVMRustLinkerFree<'a>(linker: &'a mut Linker<'a>); 2508 #[allow(improper_ctypes)] LLVMRustComputeLTOCacheKey( key_out: &RustString, mod_id: *const c_char, data: &ThinLTOData, )2509 pub fn LLVMRustComputeLTOCacheKey( 2510 key_out: &RustString, 2511 mod_id: *const c_char, 2512 data: &ThinLTOData, 2513 ); 2514 LLVMRustContextGetDiagnosticHandler(Context: &Context) -> Option<&DiagnosticHandler>2515 pub fn LLVMRustContextGetDiagnosticHandler(Context: &Context) -> Option<&DiagnosticHandler>; LLVMRustContextSetDiagnosticHandler( context: &Context, diagnostic_handler: Option<&DiagnosticHandler>, )2516 pub fn LLVMRustContextSetDiagnosticHandler( 2517 context: &Context, 2518 diagnostic_handler: Option<&DiagnosticHandler>, 2519 ); LLVMRustContextConfigureDiagnosticHandler( context: &Context, diagnostic_handler_callback: DiagnosticHandlerTy, diagnostic_handler_context: *mut c_void, remark_all_passes: bool, remark_passes: *const *const c_char, remark_passes_len: usize, remark_file: *const c_char, )2520 pub fn LLVMRustContextConfigureDiagnosticHandler( 2521 context: &Context, 2522 diagnostic_handler_callback: DiagnosticHandlerTy, 2523 diagnostic_handler_context: *mut c_void, 2524 remark_all_passes: bool, 2525 remark_passes: *const *const c_char, 2526 remark_passes_len: usize, 2527 remark_file: *const c_char, 2528 ); 2529 2530 #[allow(improper_ctypes)] LLVMRustGetMangledName(V: &Value, out: &RustString)2531 pub fn LLVMRustGetMangledName(V: &Value, out: &RustString); 2532 LLVMRustGetElementTypeArgIndex(CallSite: &Value) -> i322533 pub fn LLVMRustGetElementTypeArgIndex(CallSite: &Value) -> i32; 2534 LLVMRustIsBitcode(ptr: *const u8, len: usize) -> bool2535 pub fn LLVMRustIsBitcode(ptr: *const u8, len: usize) -> bool; 2536 LLVMRustGetSymbols( buf_ptr: *const u8, buf_len: usize, state: *mut c_void, callback: GetSymbolsCallback, error_callback: GetSymbolsErrorCallback, ) -> *mut c_void2537 pub fn LLVMRustGetSymbols( 2538 buf_ptr: *const u8, 2539 buf_len: usize, 2540 state: *mut c_void, 2541 callback: GetSymbolsCallback, 2542 error_callback: GetSymbolsErrorCallback, 2543 ) -> *mut c_void; 2544 } 2545