Skip to main content

rustc_codegen_llvm/llvm/
ffi.rs

1//! Bindings to the LLVM-C API (`LLVM*`), and to our own `extern "C"` wrapper
2//! functions around the unstable LLVM C++ API (`LLVMRust*`).
3//!
4//! ## Passing pointer/length strings as `*const c_uchar` (PTR_LEN_STR)
5//!
6//! Normally it's a good idea for Rust-side bindings to match the corresponding
7//! C-side function declarations as closely as possible. But when passing `&str`
8//! or `&[u8]` data as a pointer/length pair, it's more convenient to declare
9//! the Rust-side pointer as `*const c_uchar` instead of `*const c_char`.
10//! Both pointer types have the same ABI, and using `*const c_uchar` avoids
11//! the need for an extra cast from `*const u8` on the Rust side.
12
13#![allow(non_camel_case_types)]
14
15use std::fmt::{self, Debug};
16use std::marker::PhantomData;
17use std::num::NonZero;
18use std::ptr;
19
20use bitflags::bitflags;
21use libc::{c_char, c_int, c_uchar, c_uint, c_ulonglong, c_void, size_t};
22
23pub(crate) use self::branded::{
24    Attribute, Context, ContextRaw, Module, ModuleRaw, Type, Value, wrap_llcx, wrap_llmod,
25};
26use super::RustString;
27use super::debuginfo::{
28    DIArray, DIBuilder, DIDerivedType, DIDescriptor, DIFile, DIFlags, DILocation, DISPFlags,
29    DIScope, DISubprogram, DITemplateTypeParameter, DIType, DebugEmissionKind, DebugNameTableKind,
30};
31use crate::llvm::{self, LLVMRustTpdeOptions, MetadataKindId};
32use crate::macros::TryFromU32;
33
34mod branded;
35
36/// In the LLVM-C API, boolean values are passed as `typedef int LLVMBool`,
37/// which has a different ABI from Rust or C++ `bool`.
38///
39/// This wrapper does not implement `PartialEq`.
40/// To test the underlying boolean value, use [`Self::is_true`].
41#[derive(#[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for Bool {
}
#[automatically_derived]impl ::core::clone::Clone for Bool {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<c_int>;
        *self
    }
}Clone, #[automatically_derived]impl ::core::marker::Copy for Bool { }Copy)]
42#[repr(transparent)]
43pub(crate) struct Bool {
44    value: c_int,
45}
46
47pub(crate) const TRUE: Bool = Bool::TRUE;
48pub(crate) const FALSE: Bool = Bool::FALSE;
49
50impl Bool {
51    pub(crate) const TRUE: Self = Self { value: 1 };
52    pub(crate) const FALSE: Self = Self { value: 0 };
53
54    pub(crate) const fn from_bool(rust_bool: bool) -> Self {
55        if rust_bool { Self::TRUE } else { Self::FALSE }
56    }
57
58    /// Converts this LLVM-C boolean to a Rust `bool`
59    pub(crate) fn is_true(self) -> bool {
60        // Since we're interacting with a C API, follow the C convention of
61        // treating any nonzero value as true.
62        self.value != Self::FALSE.value
63    }
64}
65
66impl Debug for Bool {
67    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
68        match self.value {
69            0 => f.write_str("FALSE"),
70            1 => f.write_str("TRUE"),
71            // As with `Self::is_true`, treat any nonzero value as true.
72            v => f.write_fmt(format_args!("TRUE ({0})", v))write!(f, "TRUE ({v})"),
73        }
74    }
75}
76
77/// Convenience trait to convert `bool` to `llvm::Bool` with an explicit method call.
78///
79/// Being able to write `b.to_llvm_bool()` is less noisy than `llvm::Bool::from(b)`,
80/// while being more explicit and less mistake-prone than something like `b.into()`.
81pub(crate) trait ToLlvmBool: Copy {
82    fn to_llvm_bool(self) -> llvm::Bool;
83}
84
85impl ToLlvmBool for bool {
86    #[inline(always)]
87    fn to_llvm_bool(self) -> llvm::Bool {
88        llvm::Bool::from_bool(self)
89    }
90}
91
92/// Wrapper for a raw enum value returned from LLVM's C APIs.
93///
94/// For C enums returned by LLVM, it's risky to use a Rust enum as the return
95/// type, because it would be UB if a later version of LLVM adds a new enum
96/// value and returns it. Instead, return this raw wrapper, then convert to the
97/// Rust-side enum explicitly.
98#[repr(transparent)]
99pub(crate) struct RawEnum<T> {
100    value: u32,
101    /// We don't own or consume a `T`, but we can produce one.
102    _rust_side_type: PhantomData<fn() -> T>,
103}
104
105impl<T: TryFrom<u32>> RawEnum<T> {
106    #[track_caller]
107    pub(crate) fn to_rust(self) -> T
108    where
109        T::Error: Debug,
110    {
111        // If this fails, the Rust-side enum is out of sync with LLVM's enum.
112        T::try_from(self.value).expect("enum value returned by LLVM should be known")
113    }
114}
115
116#[derive(#[automatically_derived]#[allow(dead_code)]
impl ::core::marker::Copy for LLVMRustResult { }Copy, #[automatically_derived]#[doc(hidden)]#[allow(dead_code)]
unsafe impl ::core::clone::TrivialClone for LLVMRustResult { }
#[automatically_derived]#[allow(dead_code)]
impl ::core::clone::Clone for LLVMRustResult {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self { *self }
}Clone, #[automatically_derived]#[allow(dead_code)]
impl ::core::marker::StructuralPartialEq for LLVMRustResult { }
#[automatically_derived]#[allow(dead_code)]
impl ::core::cmp::PartialEq for LLVMRustResult {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
            ::core::intrinsics::discriminant_value(other)
    }
}PartialEq)]
117#[repr(C)]
118#[allow(dead_code)] // Variants constructed by C++.
119pub(crate) enum LLVMRustResult {
120    Success,
121    Failure,
122}
123
124/// Must match the layout of `LLVMRustModuleFlagMergeBehavior`.
125///
126/// When merging modules (e.g. during LTO), their metadata flags are combined. Conflicts are
127/// resolved according to the merge behaviors specified here. Flags differing only in merge
128/// behavior are still considered to be in conflict.
129///
130/// In order for Rust-C LTO to work, we must specify behaviors compatible with Clang. Notably,
131/// 'Error' and 'Warning' cannot be mixed for a given flag.
132///
133/// There is a stable LLVM-C version of this enum (`LLVMModuleFlagBehavior`),
134/// but as of LLVM 19 it does not support all of the enum values in the unstable
135/// C++ API.
136#[derive(#[automatically_derived]impl ::core::marker::Copy for ModuleFlagMergeBehavior
    {
}Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for ModuleFlagMergeBehavior {
}
#[automatically_derived]impl ::core::clone::Clone for ModuleFlagMergeBehavior
    {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self { *self }
}Clone, #[automatically_derived]impl ::core::marker::StructuralPartialEq for
    ModuleFlagMergeBehavior {
}
#[automatically_derived]impl ::core::cmp::PartialEq for
    ModuleFlagMergeBehavior {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
            ::core::intrinsics::discriminant_value(other)
    }
}PartialEq)]
137#[repr(C)]
138pub(crate) enum ModuleFlagMergeBehavior {
139    Error = 1,
140    Warning = 2,
141    Require = 3,
142    Override = 4,
143    Append = 5,
144    AppendUnique = 6,
145    Max = 7,
146    Min = 8,
147}
148
149// Consts for the LLVM CallConv type, pre-cast to usize.
150
151/// Must match the layout of `LLVMTailCallKind`.
152#[derive(#[automatically_derived]#[allow(dead_code)]
impl ::core::marker::Copy for TailCallKind { }Copy, #[automatically_derived]#[doc(hidden)]#[allow(dead_code)]
unsafe impl ::core::clone::TrivialClone for TailCallKind { }
#[automatically_derived]#[allow(dead_code)]
impl ::core::clone::Clone for TailCallKind {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self { *self }
}Clone, #[automatically_derived]#[allow(dead_code)]
impl ::core::marker::StructuralPartialEq for TailCallKind { }
#[automatically_derived]#[allow(dead_code)]
impl ::core::cmp::PartialEq for TailCallKind {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
            ::core::intrinsics::discriminant_value(other)
    }
}PartialEq, #[automatically_derived]#[allow(dead_code)]
impl ::core::fmt::Debug for TailCallKind {
    #[inline]
    #[rustc_trivial_field_reads]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                TailCallKind::None => "None",
                TailCallKind::Tail => "Tail",
                TailCallKind::MustTail => "MustTail",
                TailCallKind::NoTail => "NoTail",
            })
    }
}Debug)]
153#[repr(C)]
154#[allow(dead_code)]
155pub(crate) enum TailCallKind {
156    None = 0,
157    Tail = 1,
158    MustTail = 2,
159    NoTail = 3,
160}
161
162/// LLVM CallingConv::ID. Should we wrap this?
163///
164/// See <https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/IR/CallingConv.h>
165#[derive(#[automatically_derived]impl ::core::marker::Copy for CallConv { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for CallConv {
}
#[automatically_derived]impl ::core::clone::Clone for CallConv {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self { *self }
}Clone, #[automatically_derived]impl ::core::marker::StructuralPartialEq for CallConv
    {
}
#[automatically_derived]impl ::core::cmp::PartialEq for CallConv {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
            ::core::intrinsics::discriminant_value(other)
    }
}PartialEq, #[automatically_derived]impl ::core::fmt::Debug for CallConv {
    #[inline]
    #[rustc_trivial_field_reads]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_c_like_enum_write_str(f,
            "CCallConv FastCallConv ColdCallConv PreserveMost PreserveAll SwiftCallConv Tail PreserveNone X86StdcallCallConv X86FastcallCallConv ArmAapcsCallConv Msp430Intr X86_ThisCall PtxKernel X86_64_SysV X86_64_Win64 X86_VectorCall X86_Intr AvrNonBlockingInterrupt AvrInterrupt AmdgpuKernel",
            match self {
                CallConv::CCallConv => 0usize,
                CallConv::FastCallConv => 10usize,
                CallConv::ColdCallConv => 23usize,
                CallConv::PreserveMost => 36usize,
                CallConv::PreserveAll => 49usize,
                CallConv::SwiftCallConv => 61usize,
                CallConv::Tail => 75usize,
                CallConv::PreserveNone => 80usize,
                CallConv::X86StdcallCallConv => 93usize,
                CallConv::X86FastcallCallConv => 112usize,
                CallConv::ArmAapcsCallConv => 132usize,
                CallConv::Msp430Intr => 149usize,
                CallConv::X86_ThisCall => 160usize,
                CallConv::PtxKernel => 173usize,
                CallConv::X86_64_SysV => 183usize,
                CallConv::X86_64_Win64 => 195usize,
                CallConv::X86_VectorCall => 208usize,
                CallConv::X86_Intr => 223usize,
                CallConv::AvrNonBlockingInterrupt => 232usize,
                CallConv::AvrInterrupt => 256usize,
                CallConv::AmdgpuKernel => 269usize,
            })
    }
}Debug, impl ::core::convert::TryFrom<u32> for CallConv {
    type Error = u32;
    #[allow(deprecated)]
    fn try_from(value: u32) -> ::core::result::Result<CallConv, Self::Error> {
        if value == const { CallConv::CCallConv as u32 } {
            return Ok(CallConv::CCallConv)
        }
        if value == const { CallConv::FastCallConv as u32 } {
            return Ok(CallConv::FastCallConv)
        }
        if value == const { CallConv::ColdCallConv as u32 } {
            return Ok(CallConv::ColdCallConv)
        }
        if value == const { CallConv::PreserveMost as u32 } {
            return Ok(CallConv::PreserveMost)
        }
        if value == const { CallConv::PreserveAll as u32 } {
            return Ok(CallConv::PreserveAll)
        }
        if value == const { CallConv::SwiftCallConv as u32 } {
            return Ok(CallConv::SwiftCallConv)
        }
        if value == const { CallConv::Tail as u32 } {
            return Ok(CallConv::Tail)
        }
        if value == const { CallConv::PreserveNone as u32 } {
            return Ok(CallConv::PreserveNone)
        }
        if value == const { CallConv::X86StdcallCallConv as u32 } {
            return Ok(CallConv::X86StdcallCallConv)
        }
        if value == const { CallConv::X86FastcallCallConv as u32 } {
            return Ok(CallConv::X86FastcallCallConv)
        }
        if value == const { CallConv::ArmAapcsCallConv as u32 } {
            return Ok(CallConv::ArmAapcsCallConv)
        }
        if value == const { CallConv::Msp430Intr as u32 } {
            return Ok(CallConv::Msp430Intr)
        }
        if value == const { CallConv::X86_ThisCall as u32 } {
            return Ok(CallConv::X86_ThisCall)
        }
        if value == const { CallConv::PtxKernel as u32 } {
            return Ok(CallConv::PtxKernel)
        }
        if value == const { CallConv::X86_64_SysV as u32 } {
            return Ok(CallConv::X86_64_SysV)
        }
        if value == const { CallConv::X86_64_Win64 as u32 } {
            return Ok(CallConv::X86_64_Win64)
        }
        if value == const { CallConv::X86_VectorCall as u32 } {
            return Ok(CallConv::X86_VectorCall)
        }
        if value == const { CallConv::X86_Intr as u32 } {
            return Ok(CallConv::X86_Intr)
        }
        if value == const { CallConv::AvrNonBlockingInterrupt as u32 } {
            return Ok(CallConv::AvrNonBlockingInterrupt)
        }
        if value == const { CallConv::AvrInterrupt as u32 } {
            return Ok(CallConv::AvrInterrupt)
        }
        if value == const { CallConv::AmdgpuKernel as u32 } {
            return Ok(CallConv::AmdgpuKernel)
        }
        Err(value)
    }
}TryFromU32)]
166#[repr(C)]
167pub(crate) enum CallConv {
168    CCallConv = 0,
169    FastCallConv = 8,
170    ColdCallConv = 9,
171    PreserveMost = 14,
172    PreserveAll = 15,
173    SwiftCallConv = 16,
174    Tail = 18,
175    PreserveNone = 21,
176    X86StdcallCallConv = 64,
177    X86FastcallCallConv = 65,
178    ArmAapcsCallConv = 67,
179    Msp430Intr = 69,
180    X86_ThisCall = 70,
181    PtxKernel = 71,
182    X86_64_SysV = 78,
183    X86_64_Win64 = 79,
184    X86_VectorCall = 80,
185    X86_Intr = 83,
186    AvrNonBlockingInterrupt = 84,
187    AvrInterrupt = 85,
188    AmdgpuKernel = 91,
189}
190
191/// Must match the layout of `LLVMLinkage`.
192#[derive(#[automatically_derived]impl ::core::marker::Copy for Linkage { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for Linkage {
}
#[automatically_derived]impl ::core::clone::Clone for Linkage {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self { *self }
}Clone, #[automatically_derived]impl ::core::marker::StructuralPartialEq for Linkage {
}
#[automatically_derived]impl ::core::cmp::PartialEq for Linkage {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
            ::core::intrinsics::discriminant_value(other)
    }
}PartialEq, impl ::core::convert::TryFrom<u32> for Linkage {
    type Error = u32;
    #[allow(deprecated)]
    fn try_from(value: u32) -> ::core::result::Result<Linkage, Self::Error> {
        if value == const { Linkage::ExternalLinkage as u32 } {
            return Ok(Linkage::ExternalLinkage)
        }
        if value == const { Linkage::AvailableExternallyLinkage as u32 } {
            return Ok(Linkage::AvailableExternallyLinkage)
        }
        if value == const { Linkage::LinkOnceAnyLinkage as u32 } {
            return Ok(Linkage::LinkOnceAnyLinkage)
        }
        if value == const { Linkage::LinkOnceODRLinkage as u32 } {
            return Ok(Linkage::LinkOnceODRLinkage)
        }
        if value == const { Linkage::LinkOnceODRAutoHideLinkage as u32 } {
            return Ok(Linkage::LinkOnceODRAutoHideLinkage)
        }
        if value == const { Linkage::WeakAnyLinkage as u32 } {
            return Ok(Linkage::WeakAnyLinkage)
        }
        if value == const { Linkage::WeakODRLinkage as u32 } {
            return Ok(Linkage::WeakODRLinkage)
        }
        if value == const { Linkage::AppendingLinkage as u32 } {
            return Ok(Linkage::AppendingLinkage)
        }
        if value == const { Linkage::InternalLinkage as u32 } {
            return Ok(Linkage::InternalLinkage)
        }
        if value == const { Linkage::PrivateLinkage as u32 } {
            return Ok(Linkage::PrivateLinkage)
        }
        if value == const { Linkage::DLLImportLinkage as u32 } {
            return Ok(Linkage::DLLImportLinkage)
        }
        if value == const { Linkage::DLLExportLinkage as u32 } {
            return Ok(Linkage::DLLExportLinkage)
        }
        if value == const { Linkage::ExternalWeakLinkage as u32 } {
            return Ok(Linkage::ExternalWeakLinkage)
        }
        if value == const { Linkage::GhostLinkage as u32 } {
            return Ok(Linkage::GhostLinkage)
        }
        if value == const { Linkage::CommonLinkage as u32 } {
            return Ok(Linkage::CommonLinkage)
        }
        if value == const { Linkage::LinkerPrivateLinkage as u32 } {
            return Ok(Linkage::LinkerPrivateLinkage)
        }
        if value == const { Linkage::LinkerPrivateWeakLinkage as u32 } {
            return Ok(Linkage::LinkerPrivateWeakLinkage)
        }
        Err(value)
    }
}TryFromU32)]
193#[repr(C)]
194pub(crate) enum Linkage {
195    ExternalLinkage = 0,
196    AvailableExternallyLinkage = 1,
197    LinkOnceAnyLinkage = 2,
198    LinkOnceODRLinkage = 3,
199    #[deprecated = "marked obsolete by LLVM"]
200    LinkOnceODRAutoHideLinkage = 4,
201    WeakAnyLinkage = 5,
202    WeakODRLinkage = 6,
203    AppendingLinkage = 7,
204    InternalLinkage = 8,
205    PrivateLinkage = 9,
206    #[deprecated = "marked obsolete by LLVM"]
207    DLLImportLinkage = 10,
208    #[deprecated = "marked obsolete by LLVM"]
209    DLLExportLinkage = 11,
210    ExternalWeakLinkage = 12,
211    #[deprecated = "marked obsolete by LLVM"]
212    GhostLinkage = 13,
213    CommonLinkage = 14,
214    LinkerPrivateLinkage = 15,
215    LinkerPrivateWeakLinkage = 16,
216}
217
218/// Must match the layout of `LLVMVisibility`.
219#[repr(C)]
220#[derive(#[automatically_derived]impl ::core::marker::Copy for Visibility { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for Visibility {
}
#[automatically_derived]impl ::core::clone::Clone for Visibility {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self { *self }
}Clone, #[automatically_derived]impl ::core::marker::StructuralPartialEq for
    Visibility {
}
#[automatically_derived]impl ::core::cmp::PartialEq for Visibility {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
            ::core::intrinsics::discriminant_value(other)
    }
}PartialEq, impl ::core::convert::TryFrom<u32> for Visibility {
    type Error = u32;
    #[allow(deprecated)]
    fn try_from(value: u32)
        -> ::core::result::Result<Visibility, Self::Error> {
        if value == const { Visibility::Default as u32 } {
            return Ok(Visibility::Default)
        }
        if value == const { Visibility::Hidden as u32 } {
            return Ok(Visibility::Hidden)
        }
        if value == const { Visibility::Protected as u32 } {
            return Ok(Visibility::Protected)
        }
        Err(value)
    }
}TryFromU32)]
221pub(crate) enum Visibility {
222    Default = 0,
223    Hidden = 1,
224    Protected = 2,
225}
226
227/// LLVMUnnamedAddr
228#[repr(C)]
229pub(crate) enum UnnamedAddr {
230    No,
231    #[expect(dead_code)]
232    Local,
233    Global,
234}
235
236/// LLVMDLLStorageClass
237#[derive(#[automatically_derived]impl ::core::marker::Copy for DLLStorageClass { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for DLLStorageClass {
}
#[automatically_derived]impl ::core::clone::Clone for DLLStorageClass {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self { *self }
}Clone)]
238#[repr(C)]
239pub(crate) enum DLLStorageClass {
240    #[allow(dead_code)]
241    Default = 0,
242    DllImport = 1, // Function to be imported from DLL.
243    #[allow(dead_code)]
244    DllExport = 2, // Function to be accessible from DLL.
245}
246
247/// Must match the layout of `llvm::UWTableKind`.
248#[derive(#[automatically_derived]impl ::core::marker::Copy for UWTableKind { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for UWTableKind {
}
#[automatically_derived]impl ::core::clone::Clone for UWTableKind {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self { *self }
}Clone)]
249#[repr(C)]
250pub(crate) enum UWTableKind {
251    /// No unwind table requested
252    None = 0,
253    /// "Synchronous" unwind tables
254    Sync = 1,
255    /// "Asynchronous" unwind tables (instr precise)
256    Async = 2,
257}
258
259/// Must match the layout of `llvm::FramePointerKind`.
260#[repr(C)]
261#[derive(#[automatically_derived]impl ::core::marker::Copy for FramePointerKind { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for FramePointerKind {
}
#[automatically_derived]impl ::core::clone::Clone for FramePointerKind {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self { *self }
}Clone, #[automatically_derived]impl ::core::fmt::Debug for FramePointerKind {
    #[inline]
    #[rustc_trivial_field_reads]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_c_like_enum_write_str(f,
            "None NonLeaf All Reserved NonLeafNoReserve",
            match self {
                FramePointerKind::None => 0usize,
                FramePointerKind::NonLeaf => 5usize,
                FramePointerKind::All => 13usize,
                FramePointerKind::Reserved => 17usize,
                FramePointerKind::NonLeafNoReserve => 26usize,
            })
    }
}Debug)]
262#[expect(dead_code, reason = "Some variants are unused, but are kept to match LLVM")]
263pub(crate) enum FramePointerKind {
264    None = 0,
265    NonLeaf = 1,
266    All = 2,
267    Reserved = 3,
268    NonLeafNoReserve = 4,
269}
270
271/// Must match the layout of `LLVMRustAttributeKind`.
272/// Semantically a subset of the C++ enum llvm::Attribute::AttrKind,
273/// though it is not ABI compatible (since it's a C++ enum)
274#[repr(C)]
275#[derive(#[automatically_derived]impl ::core::marker::Copy for AttributeKind { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for AttributeKind {
}
#[automatically_derived]impl ::core::clone::Clone for AttributeKind {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self { *self }
}Clone, #[automatically_derived]impl ::core::fmt::Debug for AttributeKind {
    #[inline]
    #[rustc_trivial_field_reads]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_c_like_enum_write_str(f,
            "AlwaysInline ByVal Cold InlineHint MinSize Naked NoAlias CapturesAddress NoInline NonNull NoRedZone NoReturn NoUnwind OptimizeForSize ReadOnly SExt StructRet UWTable ZExt InReg SanitizeThread SanitizeAddress SanitizeMemory NonLazyBind OptimizeNone ReadNone SanitizeHWAddress WillReturn StackProtectReq StackProtectStrong StackProtect NoUndef SanitizeMemTag NoCfCheck ShadowCallStack AllocSize AllocatedPointer AllocAlign SanitizeSafeStack FnRetThunkExtern Writable DeadOnUnwind DeadOnReturn CapturesReadOnly CapturesNone SanitizeRealtimeNonblocking SanitizeRealtimeBlocking Convergent NoFree",
            match self {
                AttributeKind::AlwaysInline => 0usize,
                AttributeKind::ByVal => 13usize,
                AttributeKind::Cold => 19usize,
                AttributeKind::InlineHint => 24usize,
                AttributeKind::MinSize => 35usize,
                AttributeKind::Naked => 43usize,
                AttributeKind::NoAlias => 49usize,
                AttributeKind::CapturesAddress => 57usize,
                AttributeKind::NoInline => 73usize,
                AttributeKind::NonNull => 82usize,
                AttributeKind::NoRedZone => 90usize,
                AttributeKind::NoReturn => 100usize,
                AttributeKind::NoUnwind => 109usize,
                AttributeKind::OptimizeForSize => 118usize,
                AttributeKind::ReadOnly => 134usize,
                AttributeKind::SExt => 143usize,
                AttributeKind::StructRet => 148usize,
                AttributeKind::UWTable => 158usize,
                AttributeKind::ZExt => 166usize,
                AttributeKind::InReg => 171usize,
                AttributeKind::SanitizeThread => 177usize,
                AttributeKind::SanitizeAddress => 192usize,
                AttributeKind::SanitizeMemory => 208usize,
                AttributeKind::NonLazyBind => 223usize,
                AttributeKind::OptimizeNone => 235usize,
                AttributeKind::ReadNone => 248usize,
                AttributeKind::SanitizeHWAddress => 257usize,
                AttributeKind::WillReturn => 275usize,
                AttributeKind::StackProtectReq => 286usize,
                AttributeKind::StackProtectStrong => 302usize,
                AttributeKind::StackProtect => 321usize,
                AttributeKind::NoUndef => 334usize,
                AttributeKind::SanitizeMemTag => 342usize,
                AttributeKind::NoCfCheck => 357usize,
                AttributeKind::ShadowCallStack => 367usize,
                AttributeKind::AllocSize => 383usize,
                AttributeKind::AllocatedPointer => 393usize,
                AttributeKind::AllocAlign => 410usize,
                AttributeKind::SanitizeSafeStack => 421usize,
                AttributeKind::FnRetThunkExtern => 439usize,
                AttributeKind::Writable => 456usize,
                AttributeKind::DeadOnUnwind => 465usize,
                AttributeKind::DeadOnReturn => 478usize,
                AttributeKind::CapturesReadOnly => 491usize,
                AttributeKind::CapturesNone => 508usize,
                AttributeKind::SanitizeRealtimeNonblocking => 521usize,
                AttributeKind::SanitizeRealtimeBlocking => 549usize,
                AttributeKind::Convergent => 574usize,
                AttributeKind::NoFree => 585usize,
            })
    }
}Debug)]
276#[expect(dead_code, reason = "Some variants are unused, but are kept to match the C++")]
277pub(crate) enum AttributeKind {
278    AlwaysInline = 0,
279    ByVal = 1,
280    Cold = 2,
281    InlineHint = 3,
282    MinSize = 4,
283    Naked = 5,
284    NoAlias = 6,
285    CapturesAddress = 7,
286    NoInline = 8,
287    NonNull = 9,
288    NoRedZone = 10,
289    NoReturn = 11,
290    NoUnwind = 12,
291    OptimizeForSize = 13,
292    ReadOnly = 14,
293    SExt = 15,
294    StructRet = 16,
295    UWTable = 17,
296    ZExt = 18,
297    InReg = 19,
298    SanitizeThread = 20,
299    SanitizeAddress = 21,
300    SanitizeMemory = 22,
301    NonLazyBind = 23,
302    OptimizeNone = 24,
303    ReadNone = 26,
304    SanitizeHWAddress = 28,
305    WillReturn = 29,
306    StackProtectReq = 30,
307    StackProtectStrong = 31,
308    StackProtect = 32,
309    NoUndef = 33,
310    SanitizeMemTag = 34,
311    NoCfCheck = 35,
312    ShadowCallStack = 36,
313    AllocSize = 37,
314    AllocatedPointer = 38,
315    AllocAlign = 39,
316    SanitizeSafeStack = 40,
317    FnRetThunkExtern = 41,
318    Writable = 42,
319    DeadOnUnwind = 43,
320    DeadOnReturn = 44,
321    CapturesReadOnly = 45,
322    CapturesNone = 46,
323    SanitizeRealtimeNonblocking = 47,
324    SanitizeRealtimeBlocking = 48,
325    Convergent = 49,
326    NoFree = 50,
327}
328
329/// LLVMIntPredicate
330#[derive(#[automatically_derived]impl ::core::marker::Copy for IntPredicate { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for IntPredicate {
}
#[automatically_derived]impl ::core::clone::Clone for IntPredicate {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self { *self }
}Clone)]
331#[repr(C)]
332pub(crate) enum IntPredicate {
333    IntEQ = 32,
334    IntNE = 33,
335    IntUGT = 34,
336    IntUGE = 35,
337    IntULT = 36,
338    IntULE = 37,
339    IntSGT = 38,
340    IntSGE = 39,
341    IntSLT = 40,
342    IntSLE = 41,
343}
344
345/// LLVMRealPredicate
346#[derive(#[automatically_derived]impl ::core::marker::Copy for RealPredicate { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for RealPredicate {
}
#[automatically_derived]impl ::core::clone::Clone for RealPredicate {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self { *self }
}Clone)]
347#[repr(C)]
348pub(crate) enum RealPredicate {
349    RealPredicateFalse = 0,
350    RealOEQ = 1,
351    RealOGT = 2,
352    RealOGE = 3,
353    RealOLT = 4,
354    RealOLE = 5,
355    RealONE = 6,
356    RealORD = 7,
357    RealUNO = 8,
358    RealUEQ = 9,
359    RealUGT = 10,
360    RealUGE = 11,
361    RealULT = 12,
362    RealULE = 13,
363    RealUNE = 14,
364    RealPredicateTrue = 15,
365}
366
367/// Must match the layout of `LLVMTypeKind`.
368///
369/// Use [`RawEnum<TypeKind>`] for values of `LLVMTypeKind` returned from LLVM,
370/// to avoid risk of UB if LLVM adds new enum values.
371///
372/// All of LLVM's variants should be declared here, even if no Rust-side code refers
373/// to them, because unknown variants will cause [`RawEnum::to_rust`] to panic.
374#[derive(#[automatically_derived]impl ::core::marker::Copy for TypeKind { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for TypeKind {
}
#[automatically_derived]impl ::core::clone::Clone for TypeKind {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self { *self }
}Clone, #[automatically_derived]impl ::core::marker::StructuralPartialEq for TypeKind
    {
}
#[automatically_derived]impl ::core::cmp::PartialEq for TypeKind {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
            ::core::intrinsics::discriminant_value(other)
    }
}PartialEq, #[automatically_derived]impl ::core::fmt::Debug for TypeKind {
    #[inline]
    #[rustc_trivial_field_reads]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_c_like_enum_write_str(f,
            "Void Half Float Double X86_FP80 FP128 PPC_FP128 Label Integer Function Struct Array Pointer Vector Metadata Token ScalableVector BFloat X86_AMX",
            match self {
                TypeKind::Void => 0usize,
                TypeKind::Half => 5usize,
                TypeKind::Float => 10usize,
                TypeKind::Double => 16usize,
                TypeKind::X86_FP80 => 23usize,
                TypeKind::FP128 => 32usize,
                TypeKind::PPC_FP128 => 38usize,
                TypeKind::Label => 48usize,
                TypeKind::Integer => 54usize,
                TypeKind::Function => 62usize,
                TypeKind::Struct => 71usize,
                TypeKind::Array => 78usize,
                TypeKind::Pointer => 84usize,
                TypeKind::Vector => 92usize,
                TypeKind::Metadata => 99usize,
                TypeKind::Token => 108usize,
                TypeKind::ScalableVector => 114usize,
                TypeKind::BFloat => 129usize,
                TypeKind::X86_AMX => 136usize,
            })
    }
}Debug, impl ::core::convert::TryFrom<u32> for TypeKind {
    type Error = u32;
    #[allow(deprecated)]
    fn try_from(value: u32) -> ::core::result::Result<TypeKind, Self::Error> {
        if value == const { TypeKind::Void as u32 } {
            return Ok(TypeKind::Void)
        }
        if value == const { TypeKind::Half as u32 } {
            return Ok(TypeKind::Half)
        }
        if value == const { TypeKind::Float as u32 } {
            return Ok(TypeKind::Float)
        }
        if value == const { TypeKind::Double as u32 } {
            return Ok(TypeKind::Double)
        }
        if value == const { TypeKind::X86_FP80 as u32 } {
            return Ok(TypeKind::X86_FP80)
        }
        if value == const { TypeKind::FP128 as u32 } {
            return Ok(TypeKind::FP128)
        }
        if value == const { TypeKind::PPC_FP128 as u32 } {
            return Ok(TypeKind::PPC_FP128)
        }
        if value == const { TypeKind::Label as u32 } {
            return Ok(TypeKind::Label)
        }
        if value == const { TypeKind::Integer as u32 } {
            return Ok(TypeKind::Integer)
        }
        if value == const { TypeKind::Function as u32 } {
            return Ok(TypeKind::Function)
        }
        if value == const { TypeKind::Struct as u32 } {
            return Ok(TypeKind::Struct)
        }
        if value == const { TypeKind::Array as u32 } {
            return Ok(TypeKind::Array)
        }
        if value == const { TypeKind::Pointer as u32 } {
            return Ok(TypeKind::Pointer)
        }
        if value == const { TypeKind::Vector as u32 } {
            return Ok(TypeKind::Vector)
        }
        if value == const { TypeKind::Metadata as u32 } {
            return Ok(TypeKind::Metadata)
        }
        if value == const { TypeKind::Token as u32 } {
            return Ok(TypeKind::Token)
        }
        if value == const { TypeKind::ScalableVector as u32 } {
            return Ok(TypeKind::ScalableVector)
        }
        if value == const { TypeKind::BFloat as u32 } {
            return Ok(TypeKind::BFloat)
        }
        if value == const { TypeKind::X86_AMX as u32 } {
            return Ok(TypeKind::X86_AMX)
        }
        Err(value)
    }
}TryFromU32)]
375#[repr(C)]
376pub(crate) enum TypeKind {
377    Void = 0,
378    Half = 1,
379    Float = 2,
380    Double = 3,
381    X86_FP80 = 4,
382    FP128 = 5,
383    PPC_FP128 = 6,
384    Label = 7,
385    Integer = 8,
386    Function = 9,
387    Struct = 10,
388    Array = 11,
389    Pointer = 12,
390    Vector = 13,
391    Metadata = 14,
392    Token = 16,
393    ScalableVector = 17,
394    BFloat = 18,
395    X86_AMX = 19,
396}
397
398/// LLVMAtomicRmwBinOp
399#[derive(#[automatically_derived]impl ::core::marker::Copy for AtomicRmwBinOp { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for AtomicRmwBinOp {
}
#[automatically_derived]impl ::core::clone::Clone for AtomicRmwBinOp {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self { *self }
}Clone)]
400#[repr(C)]
401pub(crate) enum AtomicRmwBinOp {
402    AtomicXchg = 0,
403    AtomicAdd = 1,
404    AtomicSub = 2,
405    AtomicAnd = 3,
406    AtomicNand = 4,
407    AtomicOr = 5,
408    AtomicXor = 6,
409    AtomicMax = 7,
410    AtomicMin = 8,
411    AtomicUMax = 9,
412    AtomicUMin = 10,
413}
414
415/// LLVMAtomicOrdering
416#[derive(#[automatically_derived]impl ::core::marker::Copy for AtomicOrdering { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for AtomicOrdering {
}
#[automatically_derived]impl ::core::clone::Clone for AtomicOrdering {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self { *self }
}Clone)]
417#[repr(C)]
418pub(crate) enum AtomicOrdering {
419    #[allow(dead_code)]
420    NotAtomic = 0,
421    #[allow(dead_code)]
422    Unordered = 1,
423    Monotonic = 2,
424    // Consume = 3,  // Not specified yet.
425    Acquire = 4,
426    Release = 5,
427    AcquireRelease = 6,
428    SequentiallyConsistent = 7,
429}
430
431/// LLVMRustFileType
432#[derive(#[automatically_derived]impl ::core::marker::Copy for FileType { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for FileType {
}
#[automatically_derived]impl ::core::clone::Clone for FileType {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self { *self }
}Clone)]
433#[repr(C)]
434pub(crate) enum FileType {
435    AssemblyFile,
436    ObjectFile,
437}
438
439/// Must match the layout of `LLVMInlineAsmDialect`.
440#[derive(#[automatically_derived]impl ::core::marker::Copy for AsmDialect { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for AsmDialect {
}
#[automatically_derived]impl ::core::clone::Clone for AsmDialect {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self { *self }
}Clone, #[automatically_derived]impl ::core::marker::StructuralPartialEq for
    AsmDialect {
}
#[automatically_derived]impl ::core::cmp::PartialEq for AsmDialect {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
            ::core::intrinsics::discriminant_value(other)
    }
}PartialEq)]
441#[repr(C)]
442pub(crate) enum AsmDialect {
443    Att,
444    Intel,
445}
446
447/// LLVMRustCodeGenOptLevel
448#[derive(#[automatically_derived]impl ::core::marker::Copy for CodeGenOptLevel { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for CodeGenOptLevel {
}
#[automatically_derived]impl ::core::clone::Clone for CodeGenOptLevel {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self { *self }
}Clone, #[automatically_derived]impl ::core::marker::StructuralPartialEq for
    CodeGenOptLevel {
}
#[automatically_derived]impl ::core::cmp::PartialEq for CodeGenOptLevel {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
            ::core::intrinsics::discriminant_value(other)
    }
}PartialEq)]
449#[repr(C)]
450pub(crate) enum CodeGenOptLevel {
451    None,
452    Less,
453    Default,
454    Aggressive,
455}
456
457/// LLVMRustPassBuilderOptLevel
458#[repr(C)]
459pub(crate) enum PassBuilderOptLevel {
460    O0,
461    O1,
462    O2,
463    O3,
464    Os,
465    Oz,
466}
467
468/// LLVMRustOptStage
469#[derive(#[automatically_derived]impl ::core::marker::StructuralPartialEq for OptStage
    {
}
#[automatically_derived]impl ::core::cmp::PartialEq for OptStage {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
            ::core::intrinsics::discriminant_value(other)
    }
}PartialEq)]
470#[repr(C)]
471pub(crate) enum OptStage {
472    PreLinkNoLTO,
473    PreLinkThinLTO,
474    PreLinkFatLTO,
475    ThinLTO,
476    FatLTO,
477}
478
479/// LLVMRustSanitizerOptions
480#[repr(C)]
481pub(crate) struct SanitizerOptions {
482    pub sanitize_address: bool,
483    pub sanitize_address_recover: bool,
484    pub sanitize_cfi: bool,
485    pub sanitize_dataflow: bool,
486    pub sanitize_dataflow_abilist: *const *const c_char,
487    pub sanitize_dataflow_abilist_len: size_t,
488    pub sanitize_kcfi: bool,
489    pub sanitize_memory: bool,
490    pub sanitize_memory_recover: bool,
491    pub sanitize_memory_track_origins: c_int,
492    pub sanitize_realtime: bool,
493    pub sanitize_thread: bool,
494    pub sanitize_hwaddress: bool,
495    pub sanitize_hwaddress_recover: bool,
496    pub sanitize_kernel_address: bool,
497    pub sanitize_kernel_address_recover: bool,
498    pub sanitize_kernel_hwaddress: bool,
499    pub sanitize_kernel_hwaddress_recover: bool,
500}
501
502/// LLVMRustRelocModel
503#[derive(#[automatically_derived]impl ::core::marker::Copy for RelocModel { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for RelocModel {
}
#[automatically_derived]impl ::core::clone::Clone for RelocModel {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self { *self }
}Clone, #[automatically_derived]impl ::core::marker::StructuralPartialEq for
    RelocModel {
}
#[automatically_derived]impl ::core::cmp::PartialEq for RelocModel {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
            ::core::intrinsics::discriminant_value(other)
    }
}PartialEq)]
504#[repr(C)]
505pub(crate) enum RelocModel {
506    Static,
507    PIC,
508    DynamicNoPic,
509    ROPI,
510    RWPI,
511    ROPI_RWPI,
512}
513
514/// LLVMRustFloatABI
515#[derive(#[automatically_derived]impl ::core::marker::Copy for FloatAbi { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for FloatAbi {
}
#[automatically_derived]impl ::core::clone::Clone for FloatAbi {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self { *self }
}Clone, #[automatically_derived]impl ::core::marker::StructuralPartialEq for FloatAbi
    {
}
#[automatically_derived]impl ::core::cmp::PartialEq for FloatAbi {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
            ::core::intrinsics::discriminant_value(other)
    }
}PartialEq)]
516#[repr(C)]
517pub(crate) enum FloatAbi {
518    Default,
519    Soft,
520    Hard,
521}
522
523/// LLVMRustCodeModel
524#[derive(#[automatically_derived]impl ::core::marker::Copy for CodeModel { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for CodeModel {
}
#[automatically_derived]impl ::core::clone::Clone for CodeModel {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self { *self }
}Clone)]
525#[repr(C)]
526pub(crate) enum CodeModel {
527    Tiny,
528    Small,
529    Kernel,
530    Medium,
531    Large,
532    None,
533}
534
535/// LLVMRustDiagnosticKind
536#[derive(#[automatically_derived]#[allow(dead_code)]
impl ::core::marker::Copy for DiagnosticKind { }Copy, #[automatically_derived]#[doc(hidden)]#[allow(dead_code)]
unsafe impl ::core::clone::TrivialClone for DiagnosticKind { }
#[automatically_derived]#[allow(dead_code)]
impl ::core::clone::Clone for DiagnosticKind {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self { *self }
}Clone)]
537#[repr(C)]
538#[allow(dead_code)] // Variants constructed by C++.
539pub(crate) enum DiagnosticKind {
540    Other,
541    InlineAsm,
542    StackSize,
543    DebugMetadataVersion,
544    SampleProfile,
545    OptimizationRemark,
546    OptimizationRemarkMissed,
547    OptimizationRemarkAnalysis,
548    OptimizationRemarkAnalysisFPCommute,
549    OptimizationRemarkAnalysisAliasing,
550    OptimizationRemarkOther,
551    OptimizationFailure,
552    PGOProfile,
553    Linker,
554    Unsupported,
555    SrcMgr,
556}
557
558/// LLVMDiagnosticSeverity
559#[derive(#[automatically_derived]#[allow(dead_code)]
impl ::core::marker::Copy for DiagnosticSeverity { }Copy, #[automatically_derived]#[doc(hidden)]#[allow(dead_code)]
unsafe impl ::core::clone::TrivialClone for DiagnosticSeverity { }
#[automatically_derived]#[allow(dead_code)]
impl ::core::clone::Clone for DiagnosticSeverity {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self { *self }
}Clone)]
560#[repr(C)]
561#[allow(dead_code)] // Variants constructed by C++.
562pub(crate) enum DiagnosticSeverity {
563    Error,
564    Warning,
565    Remark,
566    Note,
567}
568
569unsafe extern "C" {
570    // LLVMRustThinLTOData
571    pub(crate) type ThinLTOData;
572}
573
574/// LLVMRustThinLTOModule
575#[repr(C)]
576pub(crate) struct ThinLTOModule {
577    pub identifier: *const c_char,
578    pub data: *const u8,
579    pub len: usize,
580}
581
582/// LLVMThreadLocalMode
583#[derive(#[automatically_derived]impl ::core::marker::Copy for ThreadLocalMode { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for ThreadLocalMode {
}
#[automatically_derived]impl ::core::clone::Clone for ThreadLocalMode {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self { *self }
}Clone)]
584#[repr(C)]
585pub(crate) enum ThreadLocalMode {
586    #[expect(dead_code)]
587    NotThreadLocal,
588    GeneralDynamic,
589    LocalDynamic,
590    InitialExec,
591    LocalExec,
592}
593
594/// LLVMRustChecksumKind
595#[derive(#[automatically_derived]impl ::core::marker::Copy for ChecksumKind { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for ChecksumKind {
}
#[automatically_derived]impl ::core::clone::Clone for ChecksumKind {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self { *self }
}Clone)]
596#[repr(C)]
597pub(crate) enum ChecksumKind {
598    None,
599    MD5,
600    SHA1,
601    SHA256,
602}
603
604/// LLVMRustMemoryEffects
605#[derive(#[automatically_derived]impl ::core::marker::Copy for MemoryEffects { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for MemoryEffects {
}
#[automatically_derived]impl ::core::clone::Clone for MemoryEffects {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self { *self }
}Clone)]
606#[repr(C)]
607pub(crate) enum MemoryEffects {
608    None,
609    ReadOnly,
610    InaccessibleMemOnly,
611    ReadOnlyNotPure,
612}
613
614/// LLVMOpcode
615#[derive(#[automatically_derived]impl ::core::marker::Copy for Opcode { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for Opcode {
}
#[automatically_derived]impl ::core::clone::Clone for Opcode {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self { *self }
}Clone, #[automatically_derived]impl ::core::marker::StructuralPartialEq for Opcode {
}
#[automatically_derived]impl ::core::cmp::PartialEq for Opcode {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
            ::core::intrinsics::discriminant_value(other)
    }
}PartialEq, #[automatically_derived]impl ::core::cmp::Eq for Opcode { }Eq)]
616#[repr(C)]
617#[expect(dead_code, reason = "Some variants are unused, but are kept to match LLVM-C")]
618pub(crate) enum Opcode {
619    Ret = 1,
620    Br = 2,
621    Switch = 3,
622    IndirectBr = 4,
623    Invoke = 5,
624    Unreachable = 7,
625    CallBr = 67,
626    FNeg = 66,
627    Add = 8,
628    FAdd = 9,
629    Sub = 10,
630    FSub = 11,
631    Mul = 12,
632    FMul = 13,
633    UDiv = 14,
634    SDiv = 15,
635    FDiv = 16,
636    URem = 17,
637    SRem = 18,
638    FRem = 19,
639    Shl = 20,
640    LShr = 21,
641    AShr = 22,
642    And = 23,
643    Or = 24,
644    Xor = 25,
645    Alloca = 26,
646    Load = 27,
647    Store = 28,
648    GetElementPtr = 29,
649    Trunc = 30,
650    ZExt = 31,
651    SExt = 32,
652    FPToUI = 33,
653    FPToSI = 34,
654    UIToFP = 35,
655    SIToFP = 36,
656    FPTrunc = 37,
657    FPExt = 38,
658    PtrToInt = 39,
659    IntToPtr = 40,
660    BitCast = 41,
661    AddrSpaceCast = 60,
662    ICmp = 42,
663    FCmp = 43,
664    PHI = 44,
665    Call = 45,
666    Select = 46,
667    UserOp1 = 47,
668    UserOp2 = 48,
669    VAArg = 49,
670    ExtractElement = 50,
671    InsertElement = 51,
672    ShuffleVector = 52,
673    ExtractValue = 53,
674    InsertValue = 54,
675    Freeze = 68,
676    Fence = 55,
677    AtomicCmpXchg = 56,
678    AtomicRMW = 57,
679    Resume = 58,
680    LandingPad = 59,
681    CleanupRet = 61,
682    CatchRet = 62,
683    CatchPad = 63,
684    CleanupPad = 64,
685    CatchSwitch = 65,
686}
687
688/// Must match the layout of `LLVMRustCompressionKind`.
689#[derive(#[automatically_derived]impl ::core::marker::Copy for CompressionKind { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for CompressionKind {
}
#[automatically_derived]impl ::core::clone::Clone for CompressionKind {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self { *self }
}Clone)]
690#[repr(C)]
691pub(crate) enum CompressionKind {
692    None = 0,
693    Zlib = 1,
694    Zstd = 2,
695}
696
697unsafe extern "C" {
698    type Opaque;
699}
700#[repr(C)]
701struct InvariantOpaque<'a> {
702    _marker: PhantomData<&'a mut &'a ()>,
703    _opaque: Opaque,
704}
705
706// Opaque pointer types
707
708unsafe extern "C" {
709    pub(crate) type ConstantInt;
710    pub(crate) type Metadata;
711    pub(crate) type BasicBlock;
712    pub(crate) type Comdat;
713    /// `&'ll DbgRecord` represents `LLVMDbgRecordRef`.
714    pub(crate) type DbgRecord;
715}
716#[repr(C)]
717pub(crate) struct Builder<'a>(InvariantOpaque<'a>);
718unsafe extern "C" {
719    pub type TargetMachine;
720}
721unsafe extern "C" {
722    pub(crate) type MCSubtargetInfo;
723    pub(crate) type Twine;
724    pub(crate) type DiagnosticInfo;
725    pub(crate) type SMDiagnostic;
726}
727/// Opaque pointee of `LLVMOperandBundleRef`.
728#[repr(C)]
729pub(crate) struct OperandBundle<'a>(InvariantOpaque<'a>);
730#[repr(C)]
731pub(crate) struct Linker<'a>(InvariantOpaque<'a>);
732
733unsafe extern "C" {
734    /// Corresponds to LLVM's `DiagnosticHandler`.
735    pub(crate) type DiagnosticHandler;
736}
737
738/// Must match the declaration of `LLVMRustDiagnosticHandlerCallback`.
739pub(crate) type DiagnosticHandlerCallback = unsafe extern "C" fn(&DiagnosticInfo, *mut c_void);
740
741pub(crate) mod debuginfo {
742    use bitflags::bitflags;
743
744    use super::{InvariantOpaque, Metadata};
745
746    /// Opaque target type for references to an LLVM debuginfo builder.
747    ///
748    /// `&'_ DIBuilder<'ll>` corresponds to `LLVMDIBuilderRef`, which is the
749    /// LLVM-C wrapper for `DIBuilder *`.
750    ///
751    /// Debuginfo builders are created and destroyed during codegen, so the
752    /// builder reference typically has a shorter lifetime than the LLVM
753    /// session (`'ll`) that it participates in.
754    #[repr(C)]
755    pub(crate) struct DIBuilder<'ll>(InvariantOpaque<'ll>);
756
757    pub(crate) type DIDescriptor = Metadata;
758    pub(crate) type DILocation = Metadata;
759    pub(crate) type DIScope = DIDescriptor;
760    pub(crate) type DIFile = DIScope;
761    pub(crate) type DILexicalBlock = DIScope;
762    pub(crate) type DISubprogram = DIScope;
763    pub(crate) type DIType = DIDescriptor;
764    pub(crate) type DIBasicType = DIType;
765    pub(crate) type DIDerivedType = DIType;
766    pub(crate) type DICompositeType = DIDerivedType;
767    pub(crate) type DIVariable = DIDescriptor;
768    pub(crate) type DIArray = DIDescriptor;
769    pub(crate) type DITemplateTypeParameter = DIDescriptor;
770
771    #[doc = r" Must match the layout of `LLVMDIFlags` in the LLVM-C API."]
#[doc = r""]
#[doc = r" Each value declared here must also be covered by the static"]
#[doc = r" assertions in `RustWrapper.cpp` used by `fromRust(LLVMDIFlags)`."]
#[repr(transparent)]
pub(crate) struct DIFlags(<DIFlags as
    ::bitflags::__private::PublicFlags>::Internal);
#[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for DIFlags {
}
#[automatically_derived]impl ::core::clone::Clone for DIFlags {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self {
        let _:
                ::core::clone::AssertParamIsClone<<DIFlags as
                ::bitflags::__private::PublicFlags>::Internal>;
        *self
    }
}
#[automatically_derived]impl ::core::marker::Copy for DIFlags { }
#[automatically_derived]impl ::core::default::Default for DIFlags {
    #[inline]
    fn default() -> Self { DIFlags(::core::default::Default::default()) }
}
impl DIFlags {
    #[allow(deprecated, non_upper_case_globals,)]
    pub const FlagZero: Self = Self::from_bits_retain(0);
    #[allow(deprecated, non_upper_case_globals,)]
    pub const FlagPrivate: Self = Self::from_bits_retain(1);
    #[allow(deprecated, non_upper_case_globals,)]
    pub const FlagProtected: Self = Self::from_bits_retain(2);
    #[allow(deprecated, non_upper_case_globals,)]
    pub const FlagPublic: Self = Self::from_bits_retain(3);
    #[allow(deprecated, non_upper_case_globals,)]
    pub const FlagFwdDecl: Self = Self::from_bits_retain((1 << 2));
    #[allow(deprecated, non_upper_case_globals,)]
    pub const FlagAppleBlock: Self = Self::from_bits_retain((1 << 3));
    #[allow(deprecated, non_upper_case_globals,)]
    pub const FlagReservedBit4: Self = Self::from_bits_retain((1 << 4));
    #[allow(deprecated, non_upper_case_globals,)]
    pub const FlagVirtual: Self = Self::from_bits_retain((1 << 5));
    #[allow(deprecated, non_upper_case_globals,)]
    pub const FlagArtificial: Self = Self::from_bits_retain((1 << 6));
    #[allow(deprecated, non_upper_case_globals,)]
    pub const FlagExplicit: Self = Self::from_bits_retain((1 << 7));
    #[allow(deprecated, non_upper_case_globals,)]
    pub const FlagPrototyped: Self = Self::from_bits_retain((1 << 8));
    #[allow(deprecated, non_upper_case_globals,)]
    pub const FlagObjcClassComplete: Self = Self::from_bits_retain((1 << 9));
    #[allow(deprecated, non_upper_case_globals,)]
    pub const FlagObjectPointer: Self = Self::from_bits_retain((1 << 10));
    #[allow(deprecated, non_upper_case_globals,)]
    pub const FlagVector: Self = Self::from_bits_retain((1 << 11));
    #[allow(deprecated, non_upper_case_globals,)]
    pub const FlagStaticMember: Self = Self::from_bits_retain((1 << 12));
    #[allow(deprecated, non_upper_case_globals,)]
    pub const FlagLValueReference: Self = Self::from_bits_retain((1 << 13));
    #[allow(deprecated, non_upper_case_globals,)]
    pub const FlagRValueReference: Self = Self::from_bits_retain((1 << 14));
    #[allow(deprecated, non_upper_case_globals,)]
    pub const FlagReserved: Self = Self::from_bits_retain((1 << 15));
    #[allow(deprecated, non_upper_case_globals,)]
    pub const FlagSingleInheritance: Self = Self::from_bits_retain((1 << 16));
    #[allow(deprecated, non_upper_case_globals,)]
    pub const FlagMultipleInheritance: Self =
        Self::from_bits_retain((2 << 16));
    #[allow(deprecated, non_upper_case_globals,)]
    pub const FlagVirtualInheritance: Self =
        Self::from_bits_retain((3 << 16));
    #[allow(deprecated, non_upper_case_globals,)]
    pub const FlagIntroducedVirtual: Self = Self::from_bits_retain((1 << 18));
    #[allow(deprecated, non_upper_case_globals,)]
    pub const FlagBitField: Self = Self::from_bits_retain((1 << 19));
    #[allow(deprecated, non_upper_case_globals,)]
    pub const FlagNoReturn: Self = Self::from_bits_retain((1 << 20));
    #[allow(deprecated, non_upper_case_globals,)]
    pub const FlagTypePassByValue: Self = Self::from_bits_retain((1 << 22));
    #[allow(deprecated, non_upper_case_globals,)]
    pub const FlagTypePassByReference: Self =
        Self::from_bits_retain((1 << 23));
    #[allow(deprecated, non_upper_case_globals,)]
    pub const FlagEnumClass: Self = Self::from_bits_retain((1 << 24));
    #[allow(deprecated, non_upper_case_globals,)]
    pub const FlagThunk: Self = Self::from_bits_retain((1 << 25));
    #[allow(deprecated, non_upper_case_globals,)]
    pub const FlagNonTrivial: Self = Self::from_bits_retain((1 << 26));
    #[allow(deprecated, non_upper_case_globals,)]
    pub const FlagBigEndian: Self = Self::from_bits_retain((1 << 27));
    #[allow(deprecated, non_upper_case_globals,)]
    pub const FlagLittleEndian: Self = Self::from_bits_retain((1 << 28));
}
impl ::bitflags::Flags for DIFlags {
    const FLAGS: &'static [::bitflags::Flag<DIFlags>] =
        &[{

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("FlagZero", DIFlags::FlagZero)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("FlagPrivate", DIFlags::FlagPrivate)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("FlagProtected",
                            DIFlags::FlagProtected)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("FlagPublic", DIFlags::FlagPublic)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("FlagFwdDecl", DIFlags::FlagFwdDecl)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("FlagAppleBlock",
                            DIFlags::FlagAppleBlock)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("FlagReservedBit4",
                            DIFlags::FlagReservedBit4)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("FlagVirtual", DIFlags::FlagVirtual)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("FlagArtificial",
                            DIFlags::FlagArtificial)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("FlagExplicit", DIFlags::FlagExplicit)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("FlagPrototyped",
                            DIFlags::FlagPrototyped)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("FlagObjcClassComplete",
                            DIFlags::FlagObjcClassComplete)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("FlagObjectPointer",
                            DIFlags::FlagObjectPointer)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("FlagVector", DIFlags::FlagVector)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("FlagStaticMember",
                            DIFlags::FlagStaticMember)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("FlagLValueReference",
                            DIFlags::FlagLValueReference)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("FlagRValueReference",
                            DIFlags::FlagRValueReference)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("FlagReserved", DIFlags::FlagReserved)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("FlagSingleInheritance",
                            DIFlags::FlagSingleInheritance)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("FlagMultipleInheritance",
                            DIFlags::FlagMultipleInheritance)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("FlagVirtualInheritance",
                            DIFlags::FlagVirtualInheritance)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("FlagIntroducedVirtual",
                            DIFlags::FlagIntroducedVirtual)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("FlagBitField", DIFlags::FlagBitField)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("FlagNoReturn", DIFlags::FlagNoReturn)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("FlagTypePassByValue",
                            DIFlags::FlagTypePassByValue)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("FlagTypePassByReference",
                            DIFlags::FlagTypePassByReference)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("FlagEnumClass",
                            DIFlags::FlagEnumClass)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("FlagThunk", DIFlags::FlagThunk)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("FlagNonTrivial",
                            DIFlags::FlagNonTrivial)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("FlagBigEndian",
                            DIFlags::FlagBigEndian)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("FlagLittleEndian",
                            DIFlags::FlagLittleEndian)
                    }];
    type Bits = u32;
    fn bits(&self) -> u32 { DIFlags::bits(self) }
    fn from_bits_retain(bits: u32) -> DIFlags {
        DIFlags::from_bits_retain(bits)
    }
}
#[allow(dead_code, deprecated, unused_doc_comments, unused_attributes,
unused_mut, unused_imports, non_upper_case_globals, clippy ::
assign_op_pattern, clippy :: indexing_slicing, clippy :: same_name_method,
clippy :: iter_without_into_iter,)]
const _: () =
    {
        #[repr(transparent)]
        pub(crate) struct InternalBitFlags(u32);
        #[automatically_derived]
        #[doc(hidden)]
        unsafe impl ::core::clone::TrivialClone for InternalBitFlags { }
        #[automatically_derived]
        impl ::core::clone::Clone for InternalBitFlags {
            #[inline]
            #[rustc_trivial_field_reads]
            fn clone(&self) -> Self {
                let _: ::core::clone::AssertParamIsClone<u32>;
                *self
            }
        }
        #[automatically_derived]
        impl ::core::marker::Copy for InternalBitFlags { }
        #[automatically_derived]
        impl ::core::marker::StructuralPartialEq for InternalBitFlags { }
        #[automatically_derived]
        impl ::core::cmp::PartialEq for InternalBitFlags {
            #[inline]
            fn eq(&self, other: &Self) -> bool { self.0 == other.0 }
        }
        #[automatically_derived]
        impl ::core::cmp::Eq for InternalBitFlags {
            #[inline]
            #[doc(hidden)]
            #[coverage(off)]
            fn assert_fields_are_eq(&self) {
                let _: ::core::cmp::AssertParamIsEq<u32>;
            }
        }
        #[automatically_derived]
        impl ::core::cmp::PartialOrd for InternalBitFlags {
            #[inline]
            fn partial_cmp(&self, other: &Self)
                -> ::core::option::Option<::core::cmp::Ordering> {
                ::core::option::Option::Some(::core::cmp::Ord::cmp(self,
                        other))
            }
        }
        #[automatically_derived]
        impl ::core::cmp::Ord for InternalBitFlags {
            #[inline]
            fn cmp(&self, other: &Self) -> ::core::cmp::Ordering {
                ::core::cmp::Ord::cmp(&self.0, &other.0)
            }
        }
        #[automatically_derived]
        impl ::core::hash::Hash for InternalBitFlags {
            #[inline]
            fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
                ::core::hash::Hash::hash(&self.0, state)
            }
        }
        impl ::bitflags::__private::PublicFlags for DIFlags {
            type Primitive = u32;
            type Internal = InternalBitFlags;
        }
        impl ::bitflags::__private::core::default::Default for
            InternalBitFlags {
            #[inline]
            fn default() -> Self { InternalBitFlags::empty() }
        }
        impl ::bitflags::__private::core::fmt::Debug for InternalBitFlags {
            fn fmt(&self,
                f: &mut ::bitflags::__private::core::fmt::Formatter<'_>)
                -> ::bitflags::__private::core::fmt::Result {
                if self.is_empty() {
                    f.write_fmt(format_args!("{0:#x}",
                            <u32 as ::bitflags::Bits>::EMPTY))
                } else {
                    ::bitflags::__private::core::fmt::Display::fmt(self, f)
                }
            }
        }
        impl ::bitflags::__private::core::fmt::Display for InternalBitFlags {
            fn fmt(&self,
                f: &mut ::bitflags::__private::core::fmt::Formatter<'_>)
                -> ::bitflags::__private::core::fmt::Result {
                ::bitflags::parser::to_writer(&DIFlags(*self), f)
            }
        }
        impl ::bitflags::__private::core::str::FromStr for InternalBitFlags {
            type Err = ::bitflags::parser::ParseError;
            fn from_str(s: &str)
                ->
                    ::bitflags::__private::core::result::Result<Self,
                    Self::Err> {
                ::bitflags::parser::from_str::<DIFlags>(s).map(|flags|
                        flags.0)
            }
        }
        impl ::bitflags::__private::core::convert::AsRef<u32> for
            InternalBitFlags {
            fn as_ref(&self) -> &u32 { &self.0 }
        }
        impl ::bitflags::__private::core::convert::From<u32> for
            InternalBitFlags {
            fn from(bits: u32) -> Self { Self::from_bits_retain(bits) }
        }
        #[allow(dead_code, deprecated, unused_attributes)]
        impl InternalBitFlags {
            /// Get a flags value with all bits unset.
            #[inline]
            pub const fn empty() -> Self {
                Self(<u32 as ::bitflags::Bits>::EMPTY)
            }
            /// Get a flags value with all known bits set.
            #[inline]
            pub const fn all() -> Self {
                let mut truncated = <u32 as ::bitflags::Bits>::EMPTY;
                let mut i = 0;
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                let _ = i;
                Self(truncated)
            }
            /// Get the underlying bits value.
            ///
            /// The returned value is exactly the bits set in this flags value.
            #[inline]
            pub const fn bits(&self) -> u32 { self.0 }
            /// Convert from a bits value.
            ///
            /// This method will return `None` if any unknown bits are set.
            #[inline]
            pub const fn from_bits(bits: u32)
                -> ::bitflags::__private::core::option::Option<Self> {
                let truncated = Self::from_bits_truncate(bits).0;
                if truncated == bits {
                    ::bitflags::__private::core::option::Option::Some(Self(bits))
                } else { ::bitflags::__private::core::option::Option::None }
            }
            /// Convert from a bits value, unsetting any unknown bits.
            #[inline]
            pub const fn from_bits_truncate(bits: u32) -> Self {
                Self(bits & Self::all().0)
            }
            /// Convert from a bits value exactly.
            #[inline]
            pub const fn from_bits_retain(bits: u32) -> Self { Self(bits) }
            /// Get a flags value with the bits of a flag with the given name set.
            ///
            /// This method will return `None` if `name` is empty or doesn't
            /// correspond to any named flag.
            #[inline]
            pub fn from_name(name: &str)
                -> ::bitflags::__private::core::option::Option<Self> {
                {
                    if name == "FlagZero" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagZero.bits()));
                    }
                };
                ;
                {
                    if name == "FlagPrivate" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagPrivate.bits()));
                    }
                };
                ;
                {
                    if name == "FlagProtected" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagProtected.bits()));
                    }
                };
                ;
                {
                    if name == "FlagPublic" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagPublic.bits()));
                    }
                };
                ;
                {
                    if name == "FlagFwdDecl" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagFwdDecl.bits()));
                    }
                };
                ;
                {
                    if name == "FlagAppleBlock" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagAppleBlock.bits()));
                    }
                };
                ;
                {
                    if name == "FlagReservedBit4" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagReservedBit4.bits()));
                    }
                };
                ;
                {
                    if name == "FlagVirtual" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagVirtual.bits()));
                    }
                };
                ;
                {
                    if name == "FlagArtificial" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagArtificial.bits()));
                    }
                };
                ;
                {
                    if name == "FlagExplicit" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagExplicit.bits()));
                    }
                };
                ;
                {
                    if name == "FlagPrototyped" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagPrototyped.bits()));
                    }
                };
                ;
                {
                    if name == "FlagObjcClassComplete" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagObjcClassComplete.bits()));
                    }
                };
                ;
                {
                    if name == "FlagObjectPointer" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagObjectPointer.bits()));
                    }
                };
                ;
                {
                    if name == "FlagVector" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagVector.bits()));
                    }
                };
                ;
                {
                    if name == "FlagStaticMember" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagStaticMember.bits()));
                    }
                };
                ;
                {
                    if name == "FlagLValueReference" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagLValueReference.bits()));
                    }
                };
                ;
                {
                    if name == "FlagRValueReference" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagRValueReference.bits()));
                    }
                };
                ;
                {
                    if name == "FlagReserved" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagReserved.bits()));
                    }
                };
                ;
                {
                    if name == "FlagSingleInheritance" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagSingleInheritance.bits()));
                    }
                };
                ;
                {
                    if name == "FlagMultipleInheritance" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagMultipleInheritance.bits()));
                    }
                };
                ;
                {
                    if name == "FlagVirtualInheritance" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagVirtualInheritance.bits()));
                    }
                };
                ;
                {
                    if name == "FlagIntroducedVirtual" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagIntroducedVirtual.bits()));
                    }
                };
                ;
                {
                    if name == "FlagBitField" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagBitField.bits()));
                    }
                };
                ;
                {
                    if name == "FlagNoReturn" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagNoReturn.bits()));
                    }
                };
                ;
                {
                    if name == "FlagTypePassByValue" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagTypePassByValue.bits()));
                    }
                };
                ;
                {
                    if name == "FlagTypePassByReference" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagTypePassByReference.bits()));
                    }
                };
                ;
                {
                    if name == "FlagEnumClass" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagEnumClass.bits()));
                    }
                };
                ;
                {
                    if name == "FlagThunk" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagThunk.bits()));
                    }
                };
                ;
                {
                    if name == "FlagNonTrivial" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagNonTrivial.bits()));
                    }
                };
                ;
                {
                    if name == "FlagBigEndian" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagBigEndian.bits()));
                    }
                };
                ;
                {
                    if name == "FlagLittleEndian" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagLittleEndian.bits()));
                    }
                };
                ;
                let _ = name;
                ::bitflags::__private::core::option::Option::None
            }
            /// Whether all bits in this flags value are unset.
            #[inline]
            pub const fn is_empty(&self) -> bool {
                self.0 == <u32 as ::bitflags::Bits>::EMPTY
            }
            /// Whether all known bits in this flags value are set.
            #[inline]
            pub const fn is_all(&self) -> bool {
                Self::all().0 | self.0 == self.0
            }
            /// Whether any set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn intersects(&self, other: Self) -> bool {
                self.0 & other.0 != <u32 as ::bitflags::Bits>::EMPTY
            }
            /// Whether all set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn contains(&self, other: Self) -> bool {
                self.0 & other.0 == other.0
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            pub fn insert(&mut self, other: Self) {
                *self = Self(self.0).union(other);
            }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `remove` won't truncate `other`, but the `!` operator will.
            #[inline]
            pub fn remove(&mut self, other: Self) {
                *self = Self(self.0).difference(other);
            }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            pub fn toggle(&mut self, other: Self) {
                *self = Self(self.0).symmetric_difference(other);
            }
            /// Call `insert` when `value` is `true` or `remove` when `value` is `false`.
            #[inline]
            pub fn set(&mut self, other: Self, value: bool) {
                if value { self.insert(other); } else { self.remove(other); }
            }
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn intersection(self, other: Self) -> Self {
                Self(self.0 & other.0)
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn union(self, other: Self) -> Self {
                Self(self.0 | other.0)
            }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            #[must_use]
            pub const fn difference(self, other: Self) -> Self {
                Self(self.0 & !other.0)
            }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn symmetric_difference(self, other: Self) -> Self {
                Self(self.0 ^ other.0)
            }
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            #[must_use]
            pub const fn complement(self) -> Self {
                Self::from_bits_truncate(!self.0)
            }
        }
        impl ::bitflags::__private::core::fmt::Binary for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Binary::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::Octal for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Octal::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::LowerHex for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::LowerHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::UpperHex for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::UpperHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::ops::BitOr for InternalBitFlags {
            type Output = Self;
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor(self, other: InternalBitFlags) -> Self {
                self.union(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitOrAssign for
            InternalBitFlags {
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor_assign(&mut self, other: Self) { self.insert(other); }
        }
        impl ::bitflags::__private::core::ops::BitXor for InternalBitFlags {
            type Output = Self;
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor(self, other: Self) -> Self {
                self.symmetric_difference(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitXorAssign for
            InternalBitFlags {
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor_assign(&mut self, other: Self) { self.toggle(other); }
        }
        impl ::bitflags::__private::core::ops::BitAnd for InternalBitFlags {
            type Output = Self;
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand(self, other: Self) -> Self { self.intersection(other) }
        }
        impl ::bitflags::__private::core::ops::BitAndAssign for
            InternalBitFlags {
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand_assign(&mut self, other: Self) {
                *self =
                    Self::from_bits_retain(self.bits()).intersection(other);
            }
        }
        impl ::bitflags::__private::core::ops::Sub for InternalBitFlags {
            type Output = Self;
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub(self, other: Self) -> Self { self.difference(other) }
        }
        impl ::bitflags::__private::core::ops::SubAssign for InternalBitFlags
            {
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub_assign(&mut self, other: Self) { self.remove(other); }
        }
        impl ::bitflags::__private::core::ops::Not for InternalBitFlags {
            type Output = Self;
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            fn not(self) -> Self { self.complement() }
        }
        impl ::bitflags::__private::core::iter::Extend<InternalBitFlags> for
            InternalBitFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn extend<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(&mut self, iterator: T) {
                for item in iterator { self.insert(item) }
            }
        }
        impl ::bitflags::__private::core::iter::FromIterator<InternalBitFlags>
            for InternalBitFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn from_iter<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(iterator: T) -> Self {
                use ::bitflags::__private::core::iter::Extend;
                let mut result = Self::empty();
                result.extend(iterator);
                result
            }
        }
        impl InternalBitFlags {
            /// Yield a set of contained flags values.
            ///
            /// Each yielded flags value will correspond to a defined named flag. Any unknown bits
            /// will be yielded together as a final flags value.
            #[inline]
            pub const fn iter(&self) -> ::bitflags::iter::Iter<DIFlags> {
                ::bitflags::iter::Iter::__private_const_new(<DIFlags as
                        ::bitflags::Flags>::FLAGS,
                    DIFlags::from_bits_retain(self.bits()),
                    DIFlags::from_bits_retain(self.bits()))
            }
            /// Yield a set of contained named flags values.
            ///
            /// This method is like [`iter`](#method.iter), except only yields bits in contained named flags.
            /// Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
            #[inline]
            pub const fn iter_names(&self)
                -> ::bitflags::iter::IterNames<DIFlags> {
                ::bitflags::iter::IterNames::__private_const_new(<DIFlags as
                        ::bitflags::Flags>::FLAGS,
                    DIFlags::from_bits_retain(self.bits()),
                    DIFlags::from_bits_retain(self.bits()))
            }
        }
        impl ::bitflags::__private::core::iter::IntoIterator for
            InternalBitFlags {
            type Item = DIFlags;
            type IntoIter = ::bitflags::iter::Iter<DIFlags>;
            fn into_iter(self) -> Self::IntoIter { self.iter() }
        }
        impl InternalBitFlags {
            /// Returns a mutable reference to the raw value of the flags currently stored.
            #[inline]
            pub fn bits_mut(&mut self) -> &mut u32 { &mut self.0 }
        }
        #[allow(dead_code, deprecated, unused_attributes)]
        impl DIFlags {
            /// Get a flags value with all bits unset.
            #[inline]
            pub const fn empty() -> Self { Self(InternalBitFlags::empty()) }
            /// Get a flags value with all known bits set.
            #[inline]
            pub const fn all() -> Self { Self(InternalBitFlags::all()) }
            /// Get the underlying bits value.
            ///
            /// The returned value is exactly the bits set in this flags value.
            #[inline]
            pub const fn bits(&self) -> u32 { self.0.bits() }
            /// Convert from a bits value.
            ///
            /// This method will return `None` if any unknown bits are set.
            #[inline]
            pub const fn from_bits(bits: u32)
                -> ::bitflags::__private::core::option::Option<Self> {
                match InternalBitFlags::from_bits(bits) {
                    ::bitflags::__private::core::option::Option::Some(bits) =>
                        ::bitflags::__private::core::option::Option::Some(Self(bits)),
                    ::bitflags::__private::core::option::Option::None =>
                        ::bitflags::__private::core::option::Option::None,
                }
            }
            /// Convert from a bits value, unsetting any unknown bits.
            #[inline]
            pub const fn from_bits_truncate(bits: u32) -> Self {
                Self(InternalBitFlags::from_bits_truncate(bits))
            }
            /// Convert from a bits value exactly.
            #[inline]
            pub const fn from_bits_retain(bits: u32) -> Self {
                Self(InternalBitFlags::from_bits_retain(bits))
            }
            /// Get a flags value with the bits of a flag with the given name set.
            ///
            /// This method will return `None` if `name` is empty or doesn't
            /// correspond to any named flag.
            #[inline]
            pub fn from_name(name: &str)
                -> ::bitflags::__private::core::option::Option<Self> {
                match InternalBitFlags::from_name(name) {
                    ::bitflags::__private::core::option::Option::Some(bits) =>
                        ::bitflags::__private::core::option::Option::Some(Self(bits)),
                    ::bitflags::__private::core::option::Option::None =>
                        ::bitflags::__private::core::option::Option::None,
                }
            }
            /// Whether all bits in this flags value are unset.
            #[inline]
            pub const fn is_empty(&self) -> bool { self.0.is_empty() }
            /// Whether all known bits in this flags value are set.
            #[inline]
            pub const fn is_all(&self) -> bool { self.0.is_all() }
            /// Whether any set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn intersects(&self, other: Self) -> bool {
                self.0.intersects(other.0)
            }
            /// Whether all set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn contains(&self, other: Self) -> bool {
                self.0.contains(other.0)
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            pub fn insert(&mut self, other: Self) { self.0.insert(other.0) }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `remove` won't truncate `other`, but the `!` operator will.
            #[inline]
            pub fn remove(&mut self, other: Self) { self.0.remove(other.0) }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            pub fn toggle(&mut self, other: Self) { self.0.toggle(other.0) }
            /// Call `insert` when `value` is `true` or `remove` when `value` is `false`.
            #[inline]
            pub fn set(&mut self, other: Self, value: bool) {
                self.0.set(other.0, value)
            }
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn intersection(self, other: Self) -> Self {
                Self(self.0.intersection(other.0))
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn union(self, other: Self) -> Self {
                Self(self.0.union(other.0))
            }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            #[must_use]
            pub const fn difference(self, other: Self) -> Self {
                Self(self.0.difference(other.0))
            }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn symmetric_difference(self, other: Self) -> Self {
                Self(self.0.symmetric_difference(other.0))
            }
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            #[must_use]
            pub const fn complement(self) -> Self {
                Self(self.0.complement())
            }
        }
        impl ::bitflags::__private::core::fmt::Binary for DIFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Binary::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::Octal for DIFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Octal::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::LowerHex for DIFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::LowerHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::UpperHex for DIFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::UpperHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::ops::BitOr for DIFlags {
            type Output = Self;
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor(self, other: DIFlags) -> Self { self.union(other) }
        }
        impl ::bitflags::__private::core::ops::BitOrAssign for DIFlags {
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor_assign(&mut self, other: Self) { self.insert(other); }
        }
        impl ::bitflags::__private::core::ops::BitXor for DIFlags {
            type Output = Self;
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor(self, other: Self) -> Self {
                self.symmetric_difference(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitXorAssign for DIFlags {
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor_assign(&mut self, other: Self) { self.toggle(other); }
        }
        impl ::bitflags::__private::core::ops::BitAnd for DIFlags {
            type Output = Self;
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand(self, other: Self) -> Self { self.intersection(other) }
        }
        impl ::bitflags::__private::core::ops::BitAndAssign for DIFlags {
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand_assign(&mut self, other: Self) {
                *self =
                    Self::from_bits_retain(self.bits()).intersection(other);
            }
        }
        impl ::bitflags::__private::core::ops::Sub for DIFlags {
            type Output = Self;
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub(self, other: Self) -> Self { self.difference(other) }
        }
        impl ::bitflags::__private::core::ops::SubAssign for DIFlags {
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub_assign(&mut self, other: Self) { self.remove(other); }
        }
        impl ::bitflags::__private::core::ops::Not for DIFlags {
            type Output = Self;
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            fn not(self) -> Self { self.complement() }
        }
        impl ::bitflags::__private::core::iter::Extend<DIFlags> for DIFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn extend<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(&mut self, iterator: T) {
                for item in iterator { self.insert(item) }
            }
        }
        impl ::bitflags::__private::core::iter::FromIterator<DIFlags> for
            DIFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn from_iter<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(iterator: T) -> Self {
                use ::bitflags::__private::core::iter::Extend;
                let mut result = Self::empty();
                result.extend(iterator);
                result
            }
        }
        impl DIFlags {
            /// Yield a set of contained flags values.
            ///
            /// Each yielded flags value will correspond to a defined named flag. Any unknown bits
            /// will be yielded together as a final flags value.
            #[inline]
            pub const fn iter(&self) -> ::bitflags::iter::Iter<DIFlags> {
                ::bitflags::iter::Iter::__private_const_new(<DIFlags as
                        ::bitflags::Flags>::FLAGS,
                    DIFlags::from_bits_retain(self.bits()),
                    DIFlags::from_bits_retain(self.bits()))
            }
            /// Yield a set of contained named flags values.
            ///
            /// This method is like [`iter`](#method.iter), except only yields bits in contained named flags.
            /// Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
            #[inline]
            pub const fn iter_names(&self)
                -> ::bitflags::iter::IterNames<DIFlags> {
                ::bitflags::iter::IterNames::__private_const_new(<DIFlags as
                        ::bitflags::Flags>::FLAGS,
                    DIFlags::from_bits_retain(self.bits()),
                    DIFlags::from_bits_retain(self.bits()))
            }
        }
        impl ::bitflags::__private::core::iter::IntoIterator for DIFlags {
            type Item = DIFlags;
            type IntoIter = ::bitflags::iter::Iter<DIFlags>;
            fn into_iter(self) -> Self::IntoIter { self.iter() }
        }
    };bitflags! {
772        /// Must match the layout of `LLVMDIFlags` in the LLVM-C API.
773        ///
774        /// Each value declared here must also be covered by the static
775        /// assertions in `RustWrapper.cpp` used by `fromRust(LLVMDIFlags)`.
776        #[repr(transparent)]
777        #[derive(Clone, Copy, Default)]
778        pub(crate) struct DIFlags: u32 {
779            const FlagZero                = 0;
780            const FlagPrivate             = 1;
781            const FlagProtected           = 2;
782            const FlagPublic              = 3;
783            const FlagFwdDecl             = (1 << 2);
784            const FlagAppleBlock          = (1 << 3);
785            const FlagReservedBit4        = (1 << 4);
786            const FlagVirtual             = (1 << 5);
787            const FlagArtificial          = (1 << 6);
788            const FlagExplicit            = (1 << 7);
789            const FlagPrototyped          = (1 << 8);
790            const FlagObjcClassComplete   = (1 << 9);
791            const FlagObjectPointer       = (1 << 10);
792            const FlagVector              = (1 << 11);
793            const FlagStaticMember        = (1 << 12);
794            const FlagLValueReference     = (1 << 13);
795            const FlagRValueReference     = (1 << 14);
796            const FlagReserved            = (1 << 15);
797            const FlagSingleInheritance   = (1 << 16);
798            const FlagMultipleInheritance = (2 << 16);
799            const FlagVirtualInheritance  = (3 << 16);
800            const FlagIntroducedVirtual   = (1 << 18);
801            const FlagBitField            = (1 << 19);
802            const FlagNoReturn            = (1 << 20);
803            // The bit at (1 << 21) is unused, but was `LLVMDIFlagMainSubprogram`.
804            const FlagTypePassByValue     = (1 << 22);
805            const FlagTypePassByReference = (1 << 23);
806            const FlagEnumClass           = (1 << 24);
807            const FlagThunk               = (1 << 25);
808            const FlagNonTrivial          = (1 << 26);
809            const FlagBigEndian           = (1 << 27);
810            const FlagLittleEndian        = (1 << 28);
811        }
812    }
813
814    // These values **must** match with LLVMRustDISPFlags!!
815    #[repr(transparent)]
pub(crate) struct DISPFlags(<DISPFlags as
    ::bitflags::__private::PublicFlags>::Internal);
#[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for DISPFlags {
}
#[automatically_derived]impl ::core::clone::Clone for DISPFlags {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self {
        let _:
                ::core::clone::AssertParamIsClone<<DISPFlags as
                ::bitflags::__private::PublicFlags>::Internal>;
        *self
    }
}
#[automatically_derived]impl ::core::marker::Copy for DISPFlags { }
#[automatically_derived]impl ::core::default::Default for DISPFlags {
    #[inline]
    fn default() -> Self { DISPFlags(::core::default::Default::default()) }
}
impl DISPFlags {
    #[allow(deprecated, non_upper_case_globals,)]
    pub const SPFlagZero: Self = Self::from_bits_retain(0);
    #[allow(deprecated, non_upper_case_globals,)]
    pub const SPFlagVirtual: Self = Self::from_bits_retain(1);
    #[allow(deprecated, non_upper_case_globals,)]
    pub const SPFlagPureVirtual: Self = Self::from_bits_retain(2);
    #[allow(deprecated, non_upper_case_globals,)]
    pub const SPFlagLocalToUnit: Self = Self::from_bits_retain((1 << 2));
    #[allow(deprecated, non_upper_case_globals,)]
    pub const SPFlagDefinition: Self = Self::from_bits_retain((1 << 3));
    #[allow(deprecated, non_upper_case_globals,)]
    pub const SPFlagOptimized: Self = Self::from_bits_retain((1 << 4));
    #[allow(deprecated, non_upper_case_globals,)]
    pub const SPFlagMainSubprogram: Self = Self::from_bits_retain((1 << 5));
}
impl ::bitflags::Flags for DISPFlags {
    const FLAGS: &'static [::bitflags::Flag<DISPFlags>] =
        &[{

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("SPFlagZero", DISPFlags::SPFlagZero)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("SPFlagVirtual",
                            DISPFlags::SPFlagVirtual)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("SPFlagPureVirtual",
                            DISPFlags::SPFlagPureVirtual)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("SPFlagLocalToUnit",
                            DISPFlags::SPFlagLocalToUnit)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("SPFlagDefinition",
                            DISPFlags::SPFlagDefinition)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("SPFlagOptimized",
                            DISPFlags::SPFlagOptimized)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("SPFlagMainSubprogram",
                            DISPFlags::SPFlagMainSubprogram)
                    }];
    type Bits = u32;
    fn bits(&self) -> u32 { DISPFlags::bits(self) }
    fn from_bits_retain(bits: u32) -> DISPFlags {
        DISPFlags::from_bits_retain(bits)
    }
}
#[allow(dead_code, deprecated, unused_doc_comments, unused_attributes,
unused_mut, unused_imports, non_upper_case_globals, clippy ::
assign_op_pattern, clippy :: indexing_slicing, clippy :: same_name_method,
clippy :: iter_without_into_iter,)]
const _: () =
    {
        #[repr(transparent)]
        pub(crate) struct InternalBitFlags(u32);
        #[automatically_derived]
        #[doc(hidden)]
        unsafe impl ::core::clone::TrivialClone for InternalBitFlags { }
        #[automatically_derived]
        impl ::core::clone::Clone for InternalBitFlags {
            #[inline]
            #[rustc_trivial_field_reads]
            fn clone(&self) -> Self {
                let _: ::core::clone::AssertParamIsClone<u32>;
                *self
            }
        }
        #[automatically_derived]
        impl ::core::marker::Copy for InternalBitFlags { }
        #[automatically_derived]
        impl ::core::marker::StructuralPartialEq for InternalBitFlags { }
        #[automatically_derived]
        impl ::core::cmp::PartialEq for InternalBitFlags {
            #[inline]
            fn eq(&self, other: &Self) -> bool { self.0 == other.0 }
        }
        #[automatically_derived]
        impl ::core::cmp::Eq for InternalBitFlags {
            #[inline]
            #[doc(hidden)]
            #[coverage(off)]
            fn assert_fields_are_eq(&self) {
                let _: ::core::cmp::AssertParamIsEq<u32>;
            }
        }
        #[automatically_derived]
        impl ::core::cmp::PartialOrd for InternalBitFlags {
            #[inline]
            fn partial_cmp(&self, other: &Self)
                -> ::core::option::Option<::core::cmp::Ordering> {
                ::core::option::Option::Some(::core::cmp::Ord::cmp(self,
                        other))
            }
        }
        #[automatically_derived]
        impl ::core::cmp::Ord for InternalBitFlags {
            #[inline]
            fn cmp(&self, other: &Self) -> ::core::cmp::Ordering {
                ::core::cmp::Ord::cmp(&self.0, &other.0)
            }
        }
        #[automatically_derived]
        impl ::core::hash::Hash for InternalBitFlags {
            #[inline]
            fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
                ::core::hash::Hash::hash(&self.0, state)
            }
        }
        impl ::bitflags::__private::PublicFlags for DISPFlags {
            type Primitive = u32;
            type Internal = InternalBitFlags;
        }
        impl ::bitflags::__private::core::default::Default for
            InternalBitFlags {
            #[inline]
            fn default() -> Self { InternalBitFlags::empty() }
        }
        impl ::bitflags::__private::core::fmt::Debug for InternalBitFlags {
            fn fmt(&self,
                f: &mut ::bitflags::__private::core::fmt::Formatter<'_>)
                -> ::bitflags::__private::core::fmt::Result {
                if self.is_empty() {
                    f.write_fmt(format_args!("{0:#x}",
                            <u32 as ::bitflags::Bits>::EMPTY))
                } else {
                    ::bitflags::__private::core::fmt::Display::fmt(self, f)
                }
            }
        }
        impl ::bitflags::__private::core::fmt::Display for InternalBitFlags {
            fn fmt(&self,
                f: &mut ::bitflags::__private::core::fmt::Formatter<'_>)
                -> ::bitflags::__private::core::fmt::Result {
                ::bitflags::parser::to_writer(&DISPFlags(*self), f)
            }
        }
        impl ::bitflags::__private::core::str::FromStr for InternalBitFlags {
            type Err = ::bitflags::parser::ParseError;
            fn from_str(s: &str)
                ->
                    ::bitflags::__private::core::result::Result<Self,
                    Self::Err> {
                ::bitflags::parser::from_str::<DISPFlags>(s).map(|flags|
                        flags.0)
            }
        }
        impl ::bitflags::__private::core::convert::AsRef<u32> for
            InternalBitFlags {
            fn as_ref(&self) -> &u32 { &self.0 }
        }
        impl ::bitflags::__private::core::convert::From<u32> for
            InternalBitFlags {
            fn from(bits: u32) -> Self { Self::from_bits_retain(bits) }
        }
        #[allow(dead_code, deprecated, unused_attributes)]
        impl InternalBitFlags {
            /// Get a flags value with all bits unset.
            #[inline]
            pub const fn empty() -> Self {
                Self(<u32 as ::bitflags::Bits>::EMPTY)
            }
            /// Get a flags value with all known bits set.
            #[inline]
            pub const fn all() -> Self {
                let mut truncated = <u32 as ::bitflags::Bits>::EMPTY;
                let mut i = 0;
                {
                    {
                        let flag =
                            <DISPFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DISPFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DISPFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DISPFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DISPFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DISPFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DISPFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                let _ = i;
                Self(truncated)
            }
            /// Get the underlying bits value.
            ///
            /// The returned value is exactly the bits set in this flags value.
            #[inline]
            pub const fn bits(&self) -> u32 { self.0 }
            /// Convert from a bits value.
            ///
            /// This method will return `None` if any unknown bits are set.
            #[inline]
            pub const fn from_bits(bits: u32)
                -> ::bitflags::__private::core::option::Option<Self> {
                let truncated = Self::from_bits_truncate(bits).0;
                if truncated == bits {
                    ::bitflags::__private::core::option::Option::Some(Self(bits))
                } else { ::bitflags::__private::core::option::Option::None }
            }
            /// Convert from a bits value, unsetting any unknown bits.
            #[inline]
            pub const fn from_bits_truncate(bits: u32) -> Self {
                Self(bits & Self::all().0)
            }
            /// Convert from a bits value exactly.
            #[inline]
            pub const fn from_bits_retain(bits: u32) -> Self { Self(bits) }
            /// Get a flags value with the bits of a flag with the given name set.
            ///
            /// This method will return `None` if `name` is empty or doesn't
            /// correspond to any named flag.
            #[inline]
            pub fn from_name(name: &str)
                -> ::bitflags::__private::core::option::Option<Self> {
                {
                    if name == "SPFlagZero" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DISPFlags::SPFlagZero.bits()));
                    }
                };
                ;
                {
                    if name == "SPFlagVirtual" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DISPFlags::SPFlagVirtual.bits()));
                    }
                };
                ;
                {
                    if name == "SPFlagPureVirtual" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DISPFlags::SPFlagPureVirtual.bits()));
                    }
                };
                ;
                {
                    if name == "SPFlagLocalToUnit" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DISPFlags::SPFlagLocalToUnit.bits()));
                    }
                };
                ;
                {
                    if name == "SPFlagDefinition" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DISPFlags::SPFlagDefinition.bits()));
                    }
                };
                ;
                {
                    if name == "SPFlagOptimized" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DISPFlags::SPFlagOptimized.bits()));
                    }
                };
                ;
                {
                    if name == "SPFlagMainSubprogram" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DISPFlags::SPFlagMainSubprogram.bits()));
                    }
                };
                ;
                let _ = name;
                ::bitflags::__private::core::option::Option::None
            }
            /// Whether all bits in this flags value are unset.
            #[inline]
            pub const fn is_empty(&self) -> bool {
                self.0 == <u32 as ::bitflags::Bits>::EMPTY
            }
            /// Whether all known bits in this flags value are set.
            #[inline]
            pub const fn is_all(&self) -> bool {
                Self::all().0 | self.0 == self.0
            }
            /// Whether any set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn intersects(&self, other: Self) -> bool {
                self.0 & other.0 != <u32 as ::bitflags::Bits>::EMPTY
            }
            /// Whether all set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn contains(&self, other: Self) -> bool {
                self.0 & other.0 == other.0
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            pub fn insert(&mut self, other: Self) {
                *self = Self(self.0).union(other);
            }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `remove` won't truncate `other`, but the `!` operator will.
            #[inline]
            pub fn remove(&mut self, other: Self) {
                *self = Self(self.0).difference(other);
            }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            pub fn toggle(&mut self, other: Self) {
                *self = Self(self.0).symmetric_difference(other);
            }
            /// Call `insert` when `value` is `true` or `remove` when `value` is `false`.
            #[inline]
            pub fn set(&mut self, other: Self, value: bool) {
                if value { self.insert(other); } else { self.remove(other); }
            }
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn intersection(self, other: Self) -> Self {
                Self(self.0 & other.0)
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn union(self, other: Self) -> Self {
                Self(self.0 | other.0)
            }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            #[must_use]
            pub const fn difference(self, other: Self) -> Self {
                Self(self.0 & !other.0)
            }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn symmetric_difference(self, other: Self) -> Self {
                Self(self.0 ^ other.0)
            }
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            #[must_use]
            pub const fn complement(self) -> Self {
                Self::from_bits_truncate(!self.0)
            }
        }
        impl ::bitflags::__private::core::fmt::Binary for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Binary::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::Octal for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Octal::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::LowerHex for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::LowerHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::UpperHex for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::UpperHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::ops::BitOr for InternalBitFlags {
            type Output = Self;
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor(self, other: InternalBitFlags) -> Self {
                self.union(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitOrAssign for
            InternalBitFlags {
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor_assign(&mut self, other: Self) { self.insert(other); }
        }
        impl ::bitflags::__private::core::ops::BitXor for InternalBitFlags {
            type Output = Self;
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor(self, other: Self) -> Self {
                self.symmetric_difference(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitXorAssign for
            InternalBitFlags {
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor_assign(&mut self, other: Self) { self.toggle(other); }
        }
        impl ::bitflags::__private::core::ops::BitAnd for InternalBitFlags {
            type Output = Self;
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand(self, other: Self) -> Self { self.intersection(other) }
        }
        impl ::bitflags::__private::core::ops::BitAndAssign for
            InternalBitFlags {
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand_assign(&mut self, other: Self) {
                *self =
                    Self::from_bits_retain(self.bits()).intersection(other);
            }
        }
        impl ::bitflags::__private::core::ops::Sub for InternalBitFlags {
            type Output = Self;
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub(self, other: Self) -> Self { self.difference(other) }
        }
        impl ::bitflags::__private::core::ops::SubAssign for InternalBitFlags
            {
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub_assign(&mut self, other: Self) { self.remove(other); }
        }
        impl ::bitflags::__private::core::ops::Not for InternalBitFlags {
            type Output = Self;
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            fn not(self) -> Self { self.complement() }
        }
        impl ::bitflags::__private::core::iter::Extend<InternalBitFlags> for
            InternalBitFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn extend<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(&mut self, iterator: T) {
                for item in iterator { self.insert(item) }
            }
        }
        impl ::bitflags::__private::core::iter::FromIterator<InternalBitFlags>
            for InternalBitFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn from_iter<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(iterator: T) -> Self {
                use ::bitflags::__private::core::iter::Extend;
                let mut result = Self::empty();
                result.extend(iterator);
                result
            }
        }
        impl InternalBitFlags {
            /// Yield a set of contained flags values.
            ///
            /// Each yielded flags value will correspond to a defined named flag. Any unknown bits
            /// will be yielded together as a final flags value.
            #[inline]
            pub const fn iter(&self) -> ::bitflags::iter::Iter<DISPFlags> {
                ::bitflags::iter::Iter::__private_const_new(<DISPFlags as
                        ::bitflags::Flags>::FLAGS,
                    DISPFlags::from_bits_retain(self.bits()),
                    DISPFlags::from_bits_retain(self.bits()))
            }
            /// Yield a set of contained named flags values.
            ///
            /// This method is like [`iter`](#method.iter), except only yields bits in contained named flags.
            /// Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
            #[inline]
            pub const fn iter_names(&self)
                -> ::bitflags::iter::IterNames<DISPFlags> {
                ::bitflags::iter::IterNames::__private_const_new(<DISPFlags as
                        ::bitflags::Flags>::FLAGS,
                    DISPFlags::from_bits_retain(self.bits()),
                    DISPFlags::from_bits_retain(self.bits()))
            }
        }
        impl ::bitflags::__private::core::iter::IntoIterator for
            InternalBitFlags {
            type Item = DISPFlags;
            type IntoIter = ::bitflags::iter::Iter<DISPFlags>;
            fn into_iter(self) -> Self::IntoIter { self.iter() }
        }
        impl InternalBitFlags {
            /// Returns a mutable reference to the raw value of the flags currently stored.
            #[inline]
            pub fn bits_mut(&mut self) -> &mut u32 { &mut self.0 }
        }
        #[allow(dead_code, deprecated, unused_attributes)]
        impl DISPFlags {
            /// Get a flags value with all bits unset.
            #[inline]
            pub const fn empty() -> Self { Self(InternalBitFlags::empty()) }
            /// Get a flags value with all known bits set.
            #[inline]
            pub const fn all() -> Self { Self(InternalBitFlags::all()) }
            /// Get the underlying bits value.
            ///
            /// The returned value is exactly the bits set in this flags value.
            #[inline]
            pub const fn bits(&self) -> u32 { self.0.bits() }
            /// Convert from a bits value.
            ///
            /// This method will return `None` if any unknown bits are set.
            #[inline]
            pub const fn from_bits(bits: u32)
                -> ::bitflags::__private::core::option::Option<Self> {
                match InternalBitFlags::from_bits(bits) {
                    ::bitflags::__private::core::option::Option::Some(bits) =>
                        ::bitflags::__private::core::option::Option::Some(Self(bits)),
                    ::bitflags::__private::core::option::Option::None =>
                        ::bitflags::__private::core::option::Option::None,
                }
            }
            /// Convert from a bits value, unsetting any unknown bits.
            #[inline]
            pub const fn from_bits_truncate(bits: u32) -> Self {
                Self(InternalBitFlags::from_bits_truncate(bits))
            }
            /// Convert from a bits value exactly.
            #[inline]
            pub const fn from_bits_retain(bits: u32) -> Self {
                Self(InternalBitFlags::from_bits_retain(bits))
            }
            /// Get a flags value with the bits of a flag with the given name set.
            ///
            /// This method will return `None` if `name` is empty or doesn't
            /// correspond to any named flag.
            #[inline]
            pub fn from_name(name: &str)
                -> ::bitflags::__private::core::option::Option<Self> {
                match InternalBitFlags::from_name(name) {
                    ::bitflags::__private::core::option::Option::Some(bits) =>
                        ::bitflags::__private::core::option::Option::Some(Self(bits)),
                    ::bitflags::__private::core::option::Option::None =>
                        ::bitflags::__private::core::option::Option::None,
                }
            }
            /// Whether all bits in this flags value are unset.
            #[inline]
            pub const fn is_empty(&self) -> bool { self.0.is_empty() }
            /// Whether all known bits in this flags value are set.
            #[inline]
            pub const fn is_all(&self) -> bool { self.0.is_all() }
            /// Whether any set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn intersects(&self, other: Self) -> bool {
                self.0.intersects(other.0)
            }
            /// Whether all set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn contains(&self, other: Self) -> bool {
                self.0.contains(other.0)
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            pub fn insert(&mut self, other: Self) { self.0.insert(other.0) }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `remove` won't truncate `other`, but the `!` operator will.
            #[inline]
            pub fn remove(&mut self, other: Self) { self.0.remove(other.0) }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            pub fn toggle(&mut self, other: Self) { self.0.toggle(other.0) }
            /// Call `insert` when `value` is `true` or `remove` when `value` is `false`.
            #[inline]
            pub fn set(&mut self, other: Self, value: bool) {
                self.0.set(other.0, value)
            }
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn intersection(self, other: Self) -> Self {
                Self(self.0.intersection(other.0))
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn union(self, other: Self) -> Self {
                Self(self.0.union(other.0))
            }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            #[must_use]
            pub const fn difference(self, other: Self) -> Self {
                Self(self.0.difference(other.0))
            }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn symmetric_difference(self, other: Self) -> Self {
                Self(self.0.symmetric_difference(other.0))
            }
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            #[must_use]
            pub const fn complement(self) -> Self {
                Self(self.0.complement())
            }
        }
        impl ::bitflags::__private::core::fmt::Binary for DISPFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Binary::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::Octal for DISPFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Octal::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::LowerHex for DISPFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::LowerHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::UpperHex for DISPFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::UpperHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::ops::BitOr for DISPFlags {
            type Output = Self;
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor(self, other: DISPFlags) -> Self { self.union(other) }
        }
        impl ::bitflags::__private::core::ops::BitOrAssign for DISPFlags {
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor_assign(&mut self, other: Self) { self.insert(other); }
        }
        impl ::bitflags::__private::core::ops::BitXor for DISPFlags {
            type Output = Self;
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor(self, other: Self) -> Self {
                self.symmetric_difference(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitXorAssign for DISPFlags {
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor_assign(&mut self, other: Self) { self.toggle(other); }
        }
        impl ::bitflags::__private::core::ops::BitAnd for DISPFlags {
            type Output = Self;
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand(self, other: Self) -> Self { self.intersection(other) }
        }
        impl ::bitflags::__private::core::ops::BitAndAssign for DISPFlags {
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand_assign(&mut self, other: Self) {
                *self =
                    Self::from_bits_retain(self.bits()).intersection(other);
            }
        }
        impl ::bitflags::__private::core::ops::Sub for DISPFlags {
            type Output = Self;
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub(self, other: Self) -> Self { self.difference(other) }
        }
        impl ::bitflags::__private::core::ops::SubAssign for DISPFlags {
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub_assign(&mut self, other: Self) { self.remove(other); }
        }
        impl ::bitflags::__private::core::ops::Not for DISPFlags {
            type Output = Self;
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            fn not(self) -> Self { self.complement() }
        }
        impl ::bitflags::__private::core::iter::Extend<DISPFlags> for
            DISPFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn extend<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(&mut self, iterator: T) {
                for item in iterator { self.insert(item) }
            }
        }
        impl ::bitflags::__private::core::iter::FromIterator<DISPFlags> for
            DISPFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn from_iter<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(iterator: T) -> Self {
                use ::bitflags::__private::core::iter::Extend;
                let mut result = Self::empty();
                result.extend(iterator);
                result
            }
        }
        impl DISPFlags {
            /// Yield a set of contained flags values.
            ///
            /// Each yielded flags value will correspond to a defined named flag. Any unknown bits
            /// will be yielded together as a final flags value.
            #[inline]
            pub const fn iter(&self) -> ::bitflags::iter::Iter<DISPFlags> {
                ::bitflags::iter::Iter::__private_const_new(<DISPFlags as
                        ::bitflags::Flags>::FLAGS,
                    DISPFlags::from_bits_retain(self.bits()),
                    DISPFlags::from_bits_retain(self.bits()))
            }
            /// Yield a set of contained named flags values.
            ///
            /// This method is like [`iter`](#method.iter), except only yields bits in contained named flags.
            /// Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
            #[inline]
            pub const fn iter_names(&self)
                -> ::bitflags::iter::IterNames<DISPFlags> {
                ::bitflags::iter::IterNames::__private_const_new(<DISPFlags as
                        ::bitflags::Flags>::FLAGS,
                    DISPFlags::from_bits_retain(self.bits()),
                    DISPFlags::from_bits_retain(self.bits()))
            }
        }
        impl ::bitflags::__private::core::iter::IntoIterator for DISPFlags {
            type Item = DISPFlags;
            type IntoIter = ::bitflags::iter::Iter<DISPFlags>;
            fn into_iter(self) -> Self::IntoIter { self.iter() }
        }
    };bitflags! {
816        #[repr(transparent)]
817        #[derive(Clone, Copy, Default)]
818        pub(crate) struct DISPFlags: u32 {
819            const SPFlagZero              = 0;
820            const SPFlagVirtual           = 1;
821            const SPFlagPureVirtual       = 2;
822            const SPFlagLocalToUnit       = (1 << 2);
823            const SPFlagDefinition        = (1 << 3);
824            const SPFlagOptimized         = (1 << 4);
825            const SPFlagMainSubprogram    = (1 << 5);
826        }
827    }
828
829    /// LLVMRustDebugEmissionKind
830    #[derive(#[automatically_derived]impl ::core::marker::Copy for DebugEmissionKind { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for DebugEmissionKind {
}
#[automatically_derived]impl ::core::clone::Clone for DebugEmissionKind {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self { *self }
}Clone)]
831    #[repr(C)]
832    pub(crate) enum DebugEmissionKind {
833        NoDebug,
834        FullDebug,
835        LineTablesOnly,
836        DebugDirectivesOnly,
837    }
838
839    /// LLVMRustDebugNameTableKind
840    #[derive(#[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for DebugNameTableKind {
}
#[automatically_derived]impl ::core::clone::Clone for DebugNameTableKind {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self { *self }
}Clone, #[automatically_derived]impl ::core::marker::Copy for DebugNameTableKind { }Copy)]
841    #[repr(C)]
842    pub(crate) enum DebugNameTableKind {
843        Default,
844        #[expect(dead_code)]
845        Gnu,
846        None,
847    }
848}
849
850// These values **must** match with LLVMRustAllocKindFlags
851#[repr(transparent)]
pub(crate) struct AllocKindFlags(<AllocKindFlags as
    ::bitflags::__private::PublicFlags>::Internal);
#[automatically_derived]impl ::core::default::Default for AllocKindFlags {
    #[inline]
    fn default() -> Self {
        AllocKindFlags(::core::default::Default::default())
    }
}
impl AllocKindFlags {
    #[allow(deprecated, non_upper_case_globals,)]
    pub const Unknown: Self = Self::from_bits_retain(0);
    #[allow(deprecated, non_upper_case_globals,)]
    pub const Alloc: Self = Self::from_bits_retain(1);
    #[allow(deprecated, non_upper_case_globals,)]
    pub const Realloc: Self = Self::from_bits_retain(1 << 1);
    #[allow(deprecated, non_upper_case_globals,)]
    pub const Free: Self = Self::from_bits_retain(1 << 2);
    #[allow(deprecated, non_upper_case_globals,)]
    pub const Uninitialized: Self = Self::from_bits_retain(1 << 3);
    #[allow(deprecated, non_upper_case_globals,)]
    pub const Zeroed: Self = Self::from_bits_retain(1 << 4);
    #[allow(deprecated, non_upper_case_globals,)]
    pub const Aligned: Self = Self::from_bits_retain(1 << 5);
}
impl ::bitflags::Flags for AllocKindFlags {
    const FLAGS: &'static [::bitflags::Flag<AllocKindFlags>] =
        &[{

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("Unknown", AllocKindFlags::Unknown)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("Alloc", AllocKindFlags::Alloc)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("Realloc", AllocKindFlags::Realloc)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("Free", AllocKindFlags::Free)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("Uninitialized",
                            AllocKindFlags::Uninitialized)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("Zeroed", AllocKindFlags::Zeroed)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("Aligned", AllocKindFlags::Aligned)
                    }];
    type Bits = u64;
    fn bits(&self) -> u64 { AllocKindFlags::bits(self) }
    fn from_bits_retain(bits: u64) -> AllocKindFlags {
        AllocKindFlags::from_bits_retain(bits)
    }
}
#[allow(dead_code, deprecated, unused_doc_comments, unused_attributes,
unused_mut, unused_imports, non_upper_case_globals, clippy ::
assign_op_pattern, clippy :: indexing_slicing, clippy :: same_name_method,
clippy :: iter_without_into_iter,)]
const _: () =
    {
        #[repr(transparent)]
        pub(crate) struct InternalBitFlags(u64);
        #[automatically_derived]
        #[doc(hidden)]
        unsafe impl ::core::clone::TrivialClone for InternalBitFlags { }
        #[automatically_derived]
        impl ::core::clone::Clone for InternalBitFlags {
            #[inline]
            #[rustc_trivial_field_reads]
            fn clone(&self) -> Self {
                let _: ::core::clone::AssertParamIsClone<u64>;
                *self
            }
        }
        #[automatically_derived]
        impl ::core::marker::Copy for InternalBitFlags { }
        #[automatically_derived]
        impl ::core::marker::StructuralPartialEq for InternalBitFlags { }
        #[automatically_derived]
        impl ::core::cmp::PartialEq for InternalBitFlags {
            #[inline]
            fn eq(&self, other: &Self) -> bool { self.0 == other.0 }
        }
        #[automatically_derived]
        impl ::core::cmp::Eq for InternalBitFlags {
            #[inline]
            #[doc(hidden)]
            #[coverage(off)]
            fn assert_fields_are_eq(&self) {
                let _: ::core::cmp::AssertParamIsEq<u64>;
            }
        }
        #[automatically_derived]
        impl ::core::cmp::PartialOrd for InternalBitFlags {
            #[inline]
            fn partial_cmp(&self, other: &Self)
                -> ::core::option::Option<::core::cmp::Ordering> {
                ::core::option::Option::Some(::core::cmp::Ord::cmp(self,
                        other))
            }
        }
        #[automatically_derived]
        impl ::core::cmp::Ord for InternalBitFlags {
            #[inline]
            fn cmp(&self, other: &Self) -> ::core::cmp::Ordering {
                ::core::cmp::Ord::cmp(&self.0, &other.0)
            }
        }
        #[automatically_derived]
        impl ::core::hash::Hash for InternalBitFlags {
            #[inline]
            fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
                ::core::hash::Hash::hash(&self.0, state)
            }
        }
        impl ::bitflags::__private::PublicFlags for AllocKindFlags {
            type Primitive = u64;
            type Internal = InternalBitFlags;
        }
        impl ::bitflags::__private::core::default::Default for
            InternalBitFlags {
            #[inline]
            fn default() -> Self { InternalBitFlags::empty() }
        }
        impl ::bitflags::__private::core::fmt::Debug for InternalBitFlags {
            fn fmt(&self,
                f: &mut ::bitflags::__private::core::fmt::Formatter<'_>)
                -> ::bitflags::__private::core::fmt::Result {
                if self.is_empty() {
                    f.write_fmt(format_args!("{0:#x}",
                            <u64 as ::bitflags::Bits>::EMPTY))
                } else {
                    ::bitflags::__private::core::fmt::Display::fmt(self, f)
                }
            }
        }
        impl ::bitflags::__private::core::fmt::Display for InternalBitFlags {
            fn fmt(&self,
                f: &mut ::bitflags::__private::core::fmt::Formatter<'_>)
                -> ::bitflags::__private::core::fmt::Result {
                ::bitflags::parser::to_writer(&AllocKindFlags(*self), f)
            }
        }
        impl ::bitflags::__private::core::str::FromStr for InternalBitFlags {
            type Err = ::bitflags::parser::ParseError;
            fn from_str(s: &str)
                ->
                    ::bitflags::__private::core::result::Result<Self,
                    Self::Err> {
                ::bitflags::parser::from_str::<AllocKindFlags>(s).map(|flags|
                        flags.0)
            }
        }
        impl ::bitflags::__private::core::convert::AsRef<u64> for
            InternalBitFlags {
            fn as_ref(&self) -> &u64 { &self.0 }
        }
        impl ::bitflags::__private::core::convert::From<u64> for
            InternalBitFlags {
            fn from(bits: u64) -> Self { Self::from_bits_retain(bits) }
        }
        #[allow(dead_code, deprecated, unused_attributes)]
        impl InternalBitFlags {
            /// Get a flags value with all bits unset.
            #[inline]
            pub const fn empty() -> Self {
                Self(<u64 as ::bitflags::Bits>::EMPTY)
            }
            /// Get a flags value with all known bits set.
            #[inline]
            pub const fn all() -> Self {
                let mut truncated = <u64 as ::bitflags::Bits>::EMPTY;
                let mut i = 0;
                {
                    {
                        let flag =
                            <AllocKindFlags as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <AllocKindFlags as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <AllocKindFlags as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <AllocKindFlags as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <AllocKindFlags as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <AllocKindFlags as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <AllocKindFlags as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                let _ = i;
                Self(truncated)
            }
            /// Get the underlying bits value.
            ///
            /// The returned value is exactly the bits set in this flags value.
            #[inline]
            pub const fn bits(&self) -> u64 { self.0 }
            /// Convert from a bits value.
            ///
            /// This method will return `None` if any unknown bits are set.
            #[inline]
            pub const fn from_bits(bits: u64)
                -> ::bitflags::__private::core::option::Option<Self> {
                let truncated = Self::from_bits_truncate(bits).0;
                if truncated == bits {
                    ::bitflags::__private::core::option::Option::Some(Self(bits))
                } else { ::bitflags::__private::core::option::Option::None }
            }
            /// Convert from a bits value, unsetting any unknown bits.
            #[inline]
            pub const fn from_bits_truncate(bits: u64) -> Self {
                Self(bits & Self::all().0)
            }
            /// Convert from a bits value exactly.
            #[inline]
            pub const fn from_bits_retain(bits: u64) -> Self { Self(bits) }
            /// Get a flags value with the bits of a flag with the given name set.
            ///
            /// This method will return `None` if `name` is empty or doesn't
            /// correspond to any named flag.
            #[inline]
            pub fn from_name(name: &str)
                -> ::bitflags::__private::core::option::Option<Self> {
                {
                    if name == "Unknown" {
                        return ::bitflags::__private::core::option::Option::Some(Self(AllocKindFlags::Unknown.bits()));
                    }
                };
                ;
                {
                    if name == "Alloc" {
                        return ::bitflags::__private::core::option::Option::Some(Self(AllocKindFlags::Alloc.bits()));
                    }
                };
                ;
                {
                    if name == "Realloc" {
                        return ::bitflags::__private::core::option::Option::Some(Self(AllocKindFlags::Realloc.bits()));
                    }
                };
                ;
                {
                    if name == "Free" {
                        return ::bitflags::__private::core::option::Option::Some(Self(AllocKindFlags::Free.bits()));
                    }
                };
                ;
                {
                    if name == "Uninitialized" {
                        return ::bitflags::__private::core::option::Option::Some(Self(AllocKindFlags::Uninitialized.bits()));
                    }
                };
                ;
                {
                    if name == "Zeroed" {
                        return ::bitflags::__private::core::option::Option::Some(Self(AllocKindFlags::Zeroed.bits()));
                    }
                };
                ;
                {
                    if name == "Aligned" {
                        return ::bitflags::__private::core::option::Option::Some(Self(AllocKindFlags::Aligned.bits()));
                    }
                };
                ;
                let _ = name;
                ::bitflags::__private::core::option::Option::None
            }
            /// Whether all bits in this flags value are unset.
            #[inline]
            pub const fn is_empty(&self) -> bool {
                self.0 == <u64 as ::bitflags::Bits>::EMPTY
            }
            /// Whether all known bits in this flags value are set.
            #[inline]
            pub const fn is_all(&self) -> bool {
                Self::all().0 | self.0 == self.0
            }
            /// Whether any set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn intersects(&self, other: Self) -> bool {
                self.0 & other.0 != <u64 as ::bitflags::Bits>::EMPTY
            }
            /// Whether all set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn contains(&self, other: Self) -> bool {
                self.0 & other.0 == other.0
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            pub fn insert(&mut self, other: Self) {
                *self = Self(self.0).union(other);
            }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `remove` won't truncate `other`, but the `!` operator will.
            #[inline]
            pub fn remove(&mut self, other: Self) {
                *self = Self(self.0).difference(other);
            }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            pub fn toggle(&mut self, other: Self) {
                *self = Self(self.0).symmetric_difference(other);
            }
            /// Call `insert` when `value` is `true` or `remove` when `value` is `false`.
            #[inline]
            pub fn set(&mut self, other: Self, value: bool) {
                if value { self.insert(other); } else { self.remove(other); }
            }
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn intersection(self, other: Self) -> Self {
                Self(self.0 & other.0)
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn union(self, other: Self) -> Self {
                Self(self.0 | other.0)
            }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            #[must_use]
            pub const fn difference(self, other: Self) -> Self {
                Self(self.0 & !other.0)
            }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn symmetric_difference(self, other: Self) -> Self {
                Self(self.0 ^ other.0)
            }
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            #[must_use]
            pub const fn complement(self) -> Self {
                Self::from_bits_truncate(!self.0)
            }
        }
        impl ::bitflags::__private::core::fmt::Binary for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Binary::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::Octal for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Octal::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::LowerHex for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::LowerHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::UpperHex for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::UpperHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::ops::BitOr for InternalBitFlags {
            type Output = Self;
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor(self, other: InternalBitFlags) -> Self {
                self.union(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitOrAssign for
            InternalBitFlags {
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor_assign(&mut self, other: Self) { self.insert(other); }
        }
        impl ::bitflags::__private::core::ops::BitXor for InternalBitFlags {
            type Output = Self;
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor(self, other: Self) -> Self {
                self.symmetric_difference(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitXorAssign for
            InternalBitFlags {
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor_assign(&mut self, other: Self) { self.toggle(other); }
        }
        impl ::bitflags::__private::core::ops::BitAnd for InternalBitFlags {
            type Output = Self;
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand(self, other: Self) -> Self { self.intersection(other) }
        }
        impl ::bitflags::__private::core::ops::BitAndAssign for
            InternalBitFlags {
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand_assign(&mut self, other: Self) {
                *self =
                    Self::from_bits_retain(self.bits()).intersection(other);
            }
        }
        impl ::bitflags::__private::core::ops::Sub for InternalBitFlags {
            type Output = Self;
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub(self, other: Self) -> Self { self.difference(other) }
        }
        impl ::bitflags::__private::core::ops::SubAssign for InternalBitFlags
            {
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub_assign(&mut self, other: Self) { self.remove(other); }
        }
        impl ::bitflags::__private::core::ops::Not for InternalBitFlags {
            type Output = Self;
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            fn not(self) -> Self { self.complement() }
        }
        impl ::bitflags::__private::core::iter::Extend<InternalBitFlags> for
            InternalBitFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn extend<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(&mut self, iterator: T) {
                for item in iterator { self.insert(item) }
            }
        }
        impl ::bitflags::__private::core::iter::FromIterator<InternalBitFlags>
            for InternalBitFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn from_iter<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(iterator: T) -> Self {
                use ::bitflags::__private::core::iter::Extend;
                let mut result = Self::empty();
                result.extend(iterator);
                result
            }
        }
        impl InternalBitFlags {
            /// Yield a set of contained flags values.
            ///
            /// Each yielded flags value will correspond to a defined named flag. Any unknown bits
            /// will be yielded together as a final flags value.
            #[inline]
            pub const fn iter(&self)
                -> ::bitflags::iter::Iter<AllocKindFlags> {
                ::bitflags::iter::Iter::__private_const_new(<AllocKindFlags as
                        ::bitflags::Flags>::FLAGS,
                    AllocKindFlags::from_bits_retain(self.bits()),
                    AllocKindFlags::from_bits_retain(self.bits()))
            }
            /// Yield a set of contained named flags values.
            ///
            /// This method is like [`iter`](#method.iter), except only yields bits in contained named flags.
            /// Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
            #[inline]
            pub const fn iter_names(&self)
                -> ::bitflags::iter::IterNames<AllocKindFlags> {
                ::bitflags::iter::IterNames::__private_const_new(<AllocKindFlags
                        as ::bitflags::Flags>::FLAGS,
                    AllocKindFlags::from_bits_retain(self.bits()),
                    AllocKindFlags::from_bits_retain(self.bits()))
            }
        }
        impl ::bitflags::__private::core::iter::IntoIterator for
            InternalBitFlags {
            type Item = AllocKindFlags;
            type IntoIter = ::bitflags::iter::Iter<AllocKindFlags>;
            fn into_iter(self) -> Self::IntoIter { self.iter() }
        }
        impl InternalBitFlags {
            /// Returns a mutable reference to the raw value of the flags currently stored.
            #[inline]
            pub fn bits_mut(&mut self) -> &mut u64 { &mut self.0 }
        }
        #[allow(dead_code, deprecated, unused_attributes)]
        impl AllocKindFlags {
            /// Get a flags value with all bits unset.
            #[inline]
            pub const fn empty() -> Self { Self(InternalBitFlags::empty()) }
            /// Get a flags value with all known bits set.
            #[inline]
            pub const fn all() -> Self { Self(InternalBitFlags::all()) }
            /// Get the underlying bits value.
            ///
            /// The returned value is exactly the bits set in this flags value.
            #[inline]
            pub const fn bits(&self) -> u64 { self.0.bits() }
            /// Convert from a bits value.
            ///
            /// This method will return `None` if any unknown bits are set.
            #[inline]
            pub const fn from_bits(bits: u64)
                -> ::bitflags::__private::core::option::Option<Self> {
                match InternalBitFlags::from_bits(bits) {
                    ::bitflags::__private::core::option::Option::Some(bits) =>
                        ::bitflags::__private::core::option::Option::Some(Self(bits)),
                    ::bitflags::__private::core::option::Option::None =>
                        ::bitflags::__private::core::option::Option::None,
                }
            }
            /// Convert from a bits value, unsetting any unknown bits.
            #[inline]
            pub const fn from_bits_truncate(bits: u64) -> Self {
                Self(InternalBitFlags::from_bits_truncate(bits))
            }
            /// Convert from a bits value exactly.
            #[inline]
            pub const fn from_bits_retain(bits: u64) -> Self {
                Self(InternalBitFlags::from_bits_retain(bits))
            }
            /// Get a flags value with the bits of a flag with the given name set.
            ///
            /// This method will return `None` if `name` is empty or doesn't
            /// correspond to any named flag.
            #[inline]
            pub fn from_name(name: &str)
                -> ::bitflags::__private::core::option::Option<Self> {
                match InternalBitFlags::from_name(name) {
                    ::bitflags::__private::core::option::Option::Some(bits) =>
                        ::bitflags::__private::core::option::Option::Some(Self(bits)),
                    ::bitflags::__private::core::option::Option::None =>
                        ::bitflags::__private::core::option::Option::None,
                }
            }
            /// Whether all bits in this flags value are unset.
            #[inline]
            pub const fn is_empty(&self) -> bool { self.0.is_empty() }
            /// Whether all known bits in this flags value are set.
            #[inline]
            pub const fn is_all(&self) -> bool { self.0.is_all() }
            /// Whether any set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn intersects(&self, other: Self) -> bool {
                self.0.intersects(other.0)
            }
            /// Whether all set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn contains(&self, other: Self) -> bool {
                self.0.contains(other.0)
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            pub fn insert(&mut self, other: Self) { self.0.insert(other.0) }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `remove` won't truncate `other`, but the `!` operator will.
            #[inline]
            pub fn remove(&mut self, other: Self) { self.0.remove(other.0) }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            pub fn toggle(&mut self, other: Self) { self.0.toggle(other.0) }
            /// Call `insert` when `value` is `true` or `remove` when `value` is `false`.
            #[inline]
            pub fn set(&mut self, other: Self, value: bool) {
                self.0.set(other.0, value)
            }
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn intersection(self, other: Self) -> Self {
                Self(self.0.intersection(other.0))
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn union(self, other: Self) -> Self {
                Self(self.0.union(other.0))
            }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            #[must_use]
            pub const fn difference(self, other: Self) -> Self {
                Self(self.0.difference(other.0))
            }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn symmetric_difference(self, other: Self) -> Self {
                Self(self.0.symmetric_difference(other.0))
            }
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            #[must_use]
            pub const fn complement(self) -> Self {
                Self(self.0.complement())
            }
        }
        impl ::bitflags::__private::core::fmt::Binary for AllocKindFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Binary::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::Octal for AllocKindFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Octal::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::LowerHex for AllocKindFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::LowerHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::UpperHex for AllocKindFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::UpperHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::ops::BitOr for AllocKindFlags {
            type Output = Self;
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor(self, other: AllocKindFlags) -> Self {
                self.union(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitOrAssign for AllocKindFlags
            {
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor_assign(&mut self, other: Self) { self.insert(other); }
        }
        impl ::bitflags::__private::core::ops::BitXor for AllocKindFlags {
            type Output = Self;
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor(self, other: Self) -> Self {
                self.symmetric_difference(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitXorAssign for AllocKindFlags
            {
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor_assign(&mut self, other: Self) { self.toggle(other); }
        }
        impl ::bitflags::__private::core::ops::BitAnd for AllocKindFlags {
            type Output = Self;
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand(self, other: Self) -> Self { self.intersection(other) }
        }
        impl ::bitflags::__private::core::ops::BitAndAssign for AllocKindFlags
            {
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand_assign(&mut self, other: Self) {
                *self =
                    Self::from_bits_retain(self.bits()).intersection(other);
            }
        }
        impl ::bitflags::__private::core::ops::Sub for AllocKindFlags {
            type Output = Self;
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub(self, other: Self) -> Self { self.difference(other) }
        }
        impl ::bitflags::__private::core::ops::SubAssign for AllocKindFlags {
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub_assign(&mut self, other: Self) { self.remove(other); }
        }
        impl ::bitflags::__private::core::ops::Not for AllocKindFlags {
            type Output = Self;
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            fn not(self) -> Self { self.complement() }
        }
        impl ::bitflags::__private::core::iter::Extend<AllocKindFlags> for
            AllocKindFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn extend<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(&mut self, iterator: T) {
                for item in iterator { self.insert(item) }
            }
        }
        impl ::bitflags::__private::core::iter::FromIterator<AllocKindFlags>
            for AllocKindFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn from_iter<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(iterator: T) -> Self {
                use ::bitflags::__private::core::iter::Extend;
                let mut result = Self::empty();
                result.extend(iterator);
                result
            }
        }
        impl AllocKindFlags {
            /// Yield a set of contained flags values.
            ///
            /// Each yielded flags value will correspond to a defined named flag. Any unknown bits
            /// will be yielded together as a final flags value.
            #[inline]
            pub const fn iter(&self)
                -> ::bitflags::iter::Iter<AllocKindFlags> {
                ::bitflags::iter::Iter::__private_const_new(<AllocKindFlags as
                        ::bitflags::Flags>::FLAGS,
                    AllocKindFlags::from_bits_retain(self.bits()),
                    AllocKindFlags::from_bits_retain(self.bits()))
            }
            /// Yield a set of contained named flags values.
            ///
            /// This method is like [`iter`](#method.iter), except only yields bits in contained named flags.
            /// Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
            #[inline]
            pub const fn iter_names(&self)
                -> ::bitflags::iter::IterNames<AllocKindFlags> {
                ::bitflags::iter::IterNames::__private_const_new(<AllocKindFlags
                        as ::bitflags::Flags>::FLAGS,
                    AllocKindFlags::from_bits_retain(self.bits()),
                    AllocKindFlags::from_bits_retain(self.bits()))
            }
        }
        impl ::bitflags::__private::core::iter::IntoIterator for
            AllocKindFlags {
            type Item = AllocKindFlags;
            type IntoIter = ::bitflags::iter::Iter<AllocKindFlags>;
            fn into_iter(self) -> Self::IntoIter { self.iter() }
        }
    };bitflags! {
852    #[repr(transparent)]
853    #[derive(Default)]
854    pub(crate) struct AllocKindFlags : u64 {
855        const Unknown = 0;
856        const Alloc = 1;
857        const Realloc = 1 << 1;
858        const Free = 1 << 2;
859        const Uninitialized = 1 << 3;
860        const Zeroed = 1 << 4;
861        const Aligned = 1 << 5;
862    }
863}
864
865// These values **must** match with LLVMGEPNoWrapFlags
866#[repr(transparent)]
pub struct GEPNoWrapFlags(<GEPNoWrapFlags as
    ::bitflags::__private::PublicFlags>::Internal);
#[automatically_derived]impl ::core::default::Default for GEPNoWrapFlags {
    #[inline]
    fn default() -> Self {
        GEPNoWrapFlags(::core::default::Default::default())
    }
}
impl GEPNoWrapFlags {
    #[allow(deprecated, non_upper_case_globals,)]
    pub const InBounds: Self = Self::from_bits_retain(1 << 0);
    #[allow(deprecated, non_upper_case_globals,)]
    pub const NUSW: Self = Self::from_bits_retain(1 << 1);
    #[allow(deprecated, non_upper_case_globals,)]
    pub const NUW: Self = Self::from_bits_retain(1 << 2);
}
impl ::bitflags::Flags for GEPNoWrapFlags {
    const FLAGS: &'static [::bitflags::Flag<GEPNoWrapFlags>] =
        &[{

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("InBounds", GEPNoWrapFlags::InBounds)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("NUSW", GEPNoWrapFlags::NUSW)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("NUW", GEPNoWrapFlags::NUW)
                    }];
    type Bits = c_uint;
    fn bits(&self) -> c_uint { GEPNoWrapFlags::bits(self) }
    fn from_bits_retain(bits: c_uint) -> GEPNoWrapFlags {
        GEPNoWrapFlags::from_bits_retain(bits)
    }
}
#[allow(dead_code, deprecated, unused_doc_comments, unused_attributes,
unused_mut, unused_imports, non_upper_case_globals, clippy ::
assign_op_pattern, clippy :: indexing_slicing, clippy :: same_name_method,
clippy :: iter_without_into_iter,)]
const _: () =
    {
        #[repr(transparent)]
        pub struct InternalBitFlags(c_uint);
        #[automatically_derived]
        #[doc(hidden)]
        unsafe impl ::core::clone::TrivialClone for InternalBitFlags { }
        #[automatically_derived]
        impl ::core::clone::Clone for InternalBitFlags {
            #[inline]
            #[rustc_trivial_field_reads]
            fn clone(&self) -> Self {
                let _: ::core::clone::AssertParamIsClone<c_uint>;
                *self
            }
        }
        #[automatically_derived]
        impl ::core::marker::Copy for InternalBitFlags { }
        #[automatically_derived]
        impl ::core::marker::StructuralPartialEq for InternalBitFlags { }
        #[automatically_derived]
        impl ::core::cmp::PartialEq for InternalBitFlags {
            #[inline]
            fn eq(&self, other: &Self) -> bool { self.0 == other.0 }
        }
        #[automatically_derived]
        impl ::core::cmp::Eq for InternalBitFlags {
            #[inline]
            #[doc(hidden)]
            #[coverage(off)]
            fn assert_fields_are_eq(&self) {
                let _: ::core::cmp::AssertParamIsEq<c_uint>;
            }
        }
        #[automatically_derived]
        impl ::core::cmp::PartialOrd for InternalBitFlags {
            #[inline]
            fn partial_cmp(&self, other: &Self)
                -> ::core::option::Option<::core::cmp::Ordering> {
                ::core::option::Option::Some(::core::cmp::Ord::cmp(self,
                        other))
            }
        }
        #[automatically_derived]
        impl ::core::cmp::Ord for InternalBitFlags {
            #[inline]
            fn cmp(&self, other: &Self) -> ::core::cmp::Ordering {
                ::core::cmp::Ord::cmp(&self.0, &other.0)
            }
        }
        #[automatically_derived]
        impl ::core::hash::Hash for InternalBitFlags {
            #[inline]
            fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
                ::core::hash::Hash::hash(&self.0, state)
            }
        }
        impl ::bitflags::__private::PublicFlags for GEPNoWrapFlags {
            type Primitive = c_uint;
            type Internal = InternalBitFlags;
        }
        impl ::bitflags::__private::core::default::Default for
            InternalBitFlags {
            #[inline]
            fn default() -> Self { InternalBitFlags::empty() }
        }
        impl ::bitflags::__private::core::fmt::Debug for InternalBitFlags {
            fn fmt(&self,
                f: &mut ::bitflags::__private::core::fmt::Formatter<'_>)
                -> ::bitflags::__private::core::fmt::Result {
                if self.is_empty() {
                    f.write_fmt(format_args!("{0:#x}",
                            <c_uint as ::bitflags::Bits>::EMPTY))
                } else {
                    ::bitflags::__private::core::fmt::Display::fmt(self, f)
                }
            }
        }
        impl ::bitflags::__private::core::fmt::Display for InternalBitFlags {
            fn fmt(&self,
                f: &mut ::bitflags::__private::core::fmt::Formatter<'_>)
                -> ::bitflags::__private::core::fmt::Result {
                ::bitflags::parser::to_writer(&GEPNoWrapFlags(*self), f)
            }
        }
        impl ::bitflags::__private::core::str::FromStr for InternalBitFlags {
            type Err = ::bitflags::parser::ParseError;
            fn from_str(s: &str)
                ->
                    ::bitflags::__private::core::result::Result<Self,
                    Self::Err> {
                ::bitflags::parser::from_str::<GEPNoWrapFlags>(s).map(|flags|
                        flags.0)
            }
        }
        impl ::bitflags::__private::core::convert::AsRef<c_uint> for
            InternalBitFlags {
            fn as_ref(&self) -> &c_uint { &self.0 }
        }
        impl ::bitflags::__private::core::convert::From<c_uint> for
            InternalBitFlags {
            fn from(bits: c_uint) -> Self { Self::from_bits_retain(bits) }
        }
        #[allow(dead_code, deprecated, unused_attributes)]
        impl InternalBitFlags {
            /// Get a flags value with all bits unset.
            #[inline]
            pub const fn empty() -> Self {
                Self(<c_uint as ::bitflags::Bits>::EMPTY)
            }
            /// Get a flags value with all known bits set.
            #[inline]
            pub const fn all() -> Self {
                let mut truncated = <c_uint as ::bitflags::Bits>::EMPTY;
                let mut i = 0;
                {
                    {
                        let flag =
                            <GEPNoWrapFlags as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <GEPNoWrapFlags as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <GEPNoWrapFlags as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                let _ = i;
                Self(truncated)
            }
            /// Get the underlying bits value.
            ///
            /// The returned value is exactly the bits set in this flags value.
            #[inline]
            pub const fn bits(&self) -> c_uint { self.0 }
            /// Convert from a bits value.
            ///
            /// This method will return `None` if any unknown bits are set.
            #[inline]
            pub const fn from_bits(bits: c_uint)
                -> ::bitflags::__private::core::option::Option<Self> {
                let truncated = Self::from_bits_truncate(bits).0;
                if truncated == bits {
                    ::bitflags::__private::core::option::Option::Some(Self(bits))
                } else { ::bitflags::__private::core::option::Option::None }
            }
            /// Convert from a bits value, unsetting any unknown bits.
            #[inline]
            pub const fn from_bits_truncate(bits: c_uint) -> Self {
                Self(bits & Self::all().0)
            }
            /// Convert from a bits value exactly.
            #[inline]
            pub const fn from_bits_retain(bits: c_uint) -> Self { Self(bits) }
            /// Get a flags value with the bits of a flag with the given name set.
            ///
            /// This method will return `None` if `name` is empty or doesn't
            /// correspond to any named flag.
            #[inline]
            pub fn from_name(name: &str)
                -> ::bitflags::__private::core::option::Option<Self> {
                {
                    if name == "InBounds" {
                        return ::bitflags::__private::core::option::Option::Some(Self(GEPNoWrapFlags::InBounds.bits()));
                    }
                };
                ;
                {
                    if name == "NUSW" {
                        return ::bitflags::__private::core::option::Option::Some(Self(GEPNoWrapFlags::NUSW.bits()));
                    }
                };
                ;
                {
                    if name == "NUW" {
                        return ::bitflags::__private::core::option::Option::Some(Self(GEPNoWrapFlags::NUW.bits()));
                    }
                };
                ;
                let _ = name;
                ::bitflags::__private::core::option::Option::None
            }
            /// Whether all bits in this flags value are unset.
            #[inline]
            pub const fn is_empty(&self) -> bool {
                self.0 == <c_uint as ::bitflags::Bits>::EMPTY
            }
            /// Whether all known bits in this flags value are set.
            #[inline]
            pub const fn is_all(&self) -> bool {
                Self::all().0 | self.0 == self.0
            }
            /// Whether any set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn intersects(&self, other: Self) -> bool {
                self.0 & other.0 != <c_uint as ::bitflags::Bits>::EMPTY
            }
            /// Whether all set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn contains(&self, other: Self) -> bool {
                self.0 & other.0 == other.0
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            pub fn insert(&mut self, other: Self) {
                *self = Self(self.0).union(other);
            }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `remove` won't truncate `other`, but the `!` operator will.
            #[inline]
            pub fn remove(&mut self, other: Self) {
                *self = Self(self.0).difference(other);
            }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            pub fn toggle(&mut self, other: Self) {
                *self = Self(self.0).symmetric_difference(other);
            }
            /// Call `insert` when `value` is `true` or `remove` when `value` is `false`.
            #[inline]
            pub fn set(&mut self, other: Self, value: bool) {
                if value { self.insert(other); } else { self.remove(other); }
            }
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn intersection(self, other: Self) -> Self {
                Self(self.0 & other.0)
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn union(self, other: Self) -> Self {
                Self(self.0 | other.0)
            }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            #[must_use]
            pub const fn difference(self, other: Self) -> Self {
                Self(self.0 & !other.0)
            }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn symmetric_difference(self, other: Self) -> Self {
                Self(self.0 ^ other.0)
            }
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            #[must_use]
            pub const fn complement(self) -> Self {
                Self::from_bits_truncate(!self.0)
            }
        }
        impl ::bitflags::__private::core::fmt::Binary for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Binary::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::Octal for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Octal::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::LowerHex for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::LowerHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::UpperHex for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::UpperHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::ops::BitOr for InternalBitFlags {
            type Output = Self;
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor(self, other: InternalBitFlags) -> Self {
                self.union(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitOrAssign for
            InternalBitFlags {
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor_assign(&mut self, other: Self) { self.insert(other); }
        }
        impl ::bitflags::__private::core::ops::BitXor for InternalBitFlags {
            type Output = Self;
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor(self, other: Self) -> Self {
                self.symmetric_difference(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitXorAssign for
            InternalBitFlags {
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor_assign(&mut self, other: Self) { self.toggle(other); }
        }
        impl ::bitflags::__private::core::ops::BitAnd for InternalBitFlags {
            type Output = Self;
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand(self, other: Self) -> Self { self.intersection(other) }
        }
        impl ::bitflags::__private::core::ops::BitAndAssign for
            InternalBitFlags {
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand_assign(&mut self, other: Self) {
                *self =
                    Self::from_bits_retain(self.bits()).intersection(other);
            }
        }
        impl ::bitflags::__private::core::ops::Sub for InternalBitFlags {
            type Output = Self;
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub(self, other: Self) -> Self { self.difference(other) }
        }
        impl ::bitflags::__private::core::ops::SubAssign for InternalBitFlags
            {
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub_assign(&mut self, other: Self) { self.remove(other); }
        }
        impl ::bitflags::__private::core::ops::Not for InternalBitFlags {
            type Output = Self;
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            fn not(self) -> Self { self.complement() }
        }
        impl ::bitflags::__private::core::iter::Extend<InternalBitFlags> for
            InternalBitFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn extend<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(&mut self, iterator: T) {
                for item in iterator { self.insert(item) }
            }
        }
        impl ::bitflags::__private::core::iter::FromIterator<InternalBitFlags>
            for InternalBitFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn from_iter<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(iterator: T) -> Self {
                use ::bitflags::__private::core::iter::Extend;
                let mut result = Self::empty();
                result.extend(iterator);
                result
            }
        }
        impl InternalBitFlags {
            /// Yield a set of contained flags values.
            ///
            /// Each yielded flags value will correspond to a defined named flag. Any unknown bits
            /// will be yielded together as a final flags value.
            #[inline]
            pub const fn iter(&self)
                -> ::bitflags::iter::Iter<GEPNoWrapFlags> {
                ::bitflags::iter::Iter::__private_const_new(<GEPNoWrapFlags as
                        ::bitflags::Flags>::FLAGS,
                    GEPNoWrapFlags::from_bits_retain(self.bits()),
                    GEPNoWrapFlags::from_bits_retain(self.bits()))
            }
            /// Yield a set of contained named flags values.
            ///
            /// This method is like [`iter`](#method.iter), except only yields bits in contained named flags.
            /// Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
            #[inline]
            pub const fn iter_names(&self)
                -> ::bitflags::iter::IterNames<GEPNoWrapFlags> {
                ::bitflags::iter::IterNames::__private_const_new(<GEPNoWrapFlags
                        as ::bitflags::Flags>::FLAGS,
                    GEPNoWrapFlags::from_bits_retain(self.bits()),
                    GEPNoWrapFlags::from_bits_retain(self.bits()))
            }
        }
        impl ::bitflags::__private::core::iter::IntoIterator for
            InternalBitFlags {
            type Item = GEPNoWrapFlags;
            type IntoIter = ::bitflags::iter::Iter<GEPNoWrapFlags>;
            fn into_iter(self) -> Self::IntoIter { self.iter() }
        }
        impl InternalBitFlags {
            /// Returns a mutable reference to the raw value of the flags currently stored.
            #[inline]
            pub fn bits_mut(&mut self) -> &mut c_uint { &mut self.0 }
        }
        #[allow(dead_code, deprecated, unused_attributes)]
        impl GEPNoWrapFlags {
            /// Get a flags value with all bits unset.
            #[inline]
            pub const fn empty() -> Self { Self(InternalBitFlags::empty()) }
            /// Get a flags value with all known bits set.
            #[inline]
            pub const fn all() -> Self { Self(InternalBitFlags::all()) }
            /// Get the underlying bits value.
            ///
            /// The returned value is exactly the bits set in this flags value.
            #[inline]
            pub const fn bits(&self) -> c_uint { self.0.bits() }
            /// Convert from a bits value.
            ///
            /// This method will return `None` if any unknown bits are set.
            #[inline]
            pub const fn from_bits(bits: c_uint)
                -> ::bitflags::__private::core::option::Option<Self> {
                match InternalBitFlags::from_bits(bits) {
                    ::bitflags::__private::core::option::Option::Some(bits) =>
                        ::bitflags::__private::core::option::Option::Some(Self(bits)),
                    ::bitflags::__private::core::option::Option::None =>
                        ::bitflags::__private::core::option::Option::None,
                }
            }
            /// Convert from a bits value, unsetting any unknown bits.
            #[inline]
            pub const fn from_bits_truncate(bits: c_uint) -> Self {
                Self(InternalBitFlags::from_bits_truncate(bits))
            }
            /// Convert from a bits value exactly.
            #[inline]
            pub const fn from_bits_retain(bits: c_uint) -> Self {
                Self(InternalBitFlags::from_bits_retain(bits))
            }
            /// Get a flags value with the bits of a flag with the given name set.
            ///
            /// This method will return `None` if `name` is empty or doesn't
            /// correspond to any named flag.
            #[inline]
            pub fn from_name(name: &str)
                -> ::bitflags::__private::core::option::Option<Self> {
                match InternalBitFlags::from_name(name) {
                    ::bitflags::__private::core::option::Option::Some(bits) =>
                        ::bitflags::__private::core::option::Option::Some(Self(bits)),
                    ::bitflags::__private::core::option::Option::None =>
                        ::bitflags::__private::core::option::Option::None,
                }
            }
            /// Whether all bits in this flags value are unset.
            #[inline]
            pub const fn is_empty(&self) -> bool { self.0.is_empty() }
            /// Whether all known bits in this flags value are set.
            #[inline]
            pub const fn is_all(&self) -> bool { self.0.is_all() }
            /// Whether any set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn intersects(&self, other: Self) -> bool {
                self.0.intersects(other.0)
            }
            /// Whether all set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn contains(&self, other: Self) -> bool {
                self.0.contains(other.0)
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            pub fn insert(&mut self, other: Self) { self.0.insert(other.0) }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `remove` won't truncate `other`, but the `!` operator will.
            #[inline]
            pub fn remove(&mut self, other: Self) { self.0.remove(other.0) }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            pub fn toggle(&mut self, other: Self) { self.0.toggle(other.0) }
            /// Call `insert` when `value` is `true` or `remove` when `value` is `false`.
            #[inline]
            pub fn set(&mut self, other: Self, value: bool) {
                self.0.set(other.0, value)
            }
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn intersection(self, other: Self) -> Self {
                Self(self.0.intersection(other.0))
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn union(self, other: Self) -> Self {
                Self(self.0.union(other.0))
            }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            #[must_use]
            pub const fn difference(self, other: Self) -> Self {
                Self(self.0.difference(other.0))
            }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn symmetric_difference(self, other: Self) -> Self {
                Self(self.0.symmetric_difference(other.0))
            }
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            #[must_use]
            pub const fn complement(self) -> Self {
                Self(self.0.complement())
            }
        }
        impl ::bitflags::__private::core::fmt::Binary for GEPNoWrapFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Binary::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::Octal for GEPNoWrapFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Octal::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::LowerHex for GEPNoWrapFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::LowerHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::UpperHex for GEPNoWrapFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::UpperHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::ops::BitOr for GEPNoWrapFlags {
            type Output = Self;
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor(self, other: GEPNoWrapFlags) -> Self {
                self.union(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitOrAssign for GEPNoWrapFlags
            {
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor_assign(&mut self, other: Self) { self.insert(other); }
        }
        impl ::bitflags::__private::core::ops::BitXor for GEPNoWrapFlags {
            type Output = Self;
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor(self, other: Self) -> Self {
                self.symmetric_difference(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitXorAssign for GEPNoWrapFlags
            {
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor_assign(&mut self, other: Self) { self.toggle(other); }
        }
        impl ::bitflags::__private::core::ops::BitAnd for GEPNoWrapFlags {
            type Output = Self;
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand(self, other: Self) -> Self { self.intersection(other) }
        }
        impl ::bitflags::__private::core::ops::BitAndAssign for GEPNoWrapFlags
            {
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand_assign(&mut self, other: Self) {
                *self =
                    Self::from_bits_retain(self.bits()).intersection(other);
            }
        }
        impl ::bitflags::__private::core::ops::Sub for GEPNoWrapFlags {
            type Output = Self;
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub(self, other: Self) -> Self { self.difference(other) }
        }
        impl ::bitflags::__private::core::ops::SubAssign for GEPNoWrapFlags {
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub_assign(&mut self, other: Self) { self.remove(other); }
        }
        impl ::bitflags::__private::core::ops::Not for GEPNoWrapFlags {
            type Output = Self;
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            fn not(self) -> Self { self.complement() }
        }
        impl ::bitflags::__private::core::iter::Extend<GEPNoWrapFlags> for
            GEPNoWrapFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn extend<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(&mut self, iterator: T) {
                for item in iterator { self.insert(item) }
            }
        }
        impl ::bitflags::__private::core::iter::FromIterator<GEPNoWrapFlags>
            for GEPNoWrapFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn from_iter<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(iterator: T) -> Self {
                use ::bitflags::__private::core::iter::Extend;
                let mut result = Self::empty();
                result.extend(iterator);
                result
            }
        }
        impl GEPNoWrapFlags {
            /// Yield a set of contained flags values.
            ///
            /// Each yielded flags value will correspond to a defined named flag. Any unknown bits
            /// will be yielded together as a final flags value.
            #[inline]
            pub const fn iter(&self)
                -> ::bitflags::iter::Iter<GEPNoWrapFlags> {
                ::bitflags::iter::Iter::__private_const_new(<GEPNoWrapFlags as
                        ::bitflags::Flags>::FLAGS,
                    GEPNoWrapFlags::from_bits_retain(self.bits()),
                    GEPNoWrapFlags::from_bits_retain(self.bits()))
            }
            /// Yield a set of contained named flags values.
            ///
            /// This method is like [`iter`](#method.iter), except only yields bits in contained named flags.
            /// Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
            #[inline]
            pub const fn iter_names(&self)
                -> ::bitflags::iter::IterNames<GEPNoWrapFlags> {
                ::bitflags::iter::IterNames::__private_const_new(<GEPNoWrapFlags
                        as ::bitflags::Flags>::FLAGS,
                    GEPNoWrapFlags::from_bits_retain(self.bits()),
                    GEPNoWrapFlags::from_bits_retain(self.bits()))
            }
        }
        impl ::bitflags::__private::core::iter::IntoIterator for
            GEPNoWrapFlags {
            type Item = GEPNoWrapFlags;
            type IntoIter = ::bitflags::iter::Iter<GEPNoWrapFlags>;
            fn into_iter(self) -> Self::IntoIter { self.iter() }
        }
    };bitflags! {
867    #[repr(transparent)]
868    #[derive(Default)]
869    pub struct GEPNoWrapFlags : c_uint {
870        const InBounds = 1 << 0;
871        const NUSW = 1 << 1;
872        const NUW = 1 << 2;
873    }
874}
875
876unsafe extern "C" {
877    pub(crate) type Buffer;
878}
879
880pub(crate) type SelfProfileBeforePassCallback =
881    unsafe extern "C" fn(*mut c_void, *const c_char, *const c_char);
882pub(crate) type SelfProfileAfterPassCallback = unsafe extern "C" fn(*mut c_void);
883
884pub(crate) type GetSymbolsCallback =
885    unsafe extern "C" fn(*mut c_void, *const c_char) -> *mut c_void;
886pub(crate) type GetSymbolsErrorCallback = unsafe extern "C" fn(*const c_char) -> *mut c_void;
887
888unsafe extern "C" {
889    // Create and destroy contexts.
890    pub(crate) fn LLVMContextCreate() -> ptr::NonNull<ContextRaw>;
891    pub(crate) fn LLVMContextDispose(C: ptr::NonNull<ContextRaw>);
892    pub(crate) fn LLVMContextSetDiscardValueNames<'ll>(C: Context<'ll>, Discard: Bool);
893    pub(crate) fn LLVMGetMDKindIDInContext<'ll>(
894        C: Context<'ll>,
895        Name: *const c_uchar, // See "PTR_LEN_STR".
896        SLen: c_uint,
897    ) -> MetadataKindId;
898
899    /// Gets the actual version of LLVM that we are linked to at runtime.
900    ///
901    /// # Safety
902    /// Can be called without initializing LLVM.
903    pub(crate) safe fn LLVMGetVersion(major: &mut c_uint, minor: &mut c_uint, patch: &mut c_uint);
904
905    pub(crate) fn LLVMDisposeTargetMachine(T: ptr::NonNull<TargetMachine>);
906
907    // Create modules.
908    pub(crate) fn LLVMModuleCreateWithNameInContext<'ll>(
909        ModuleID: *const c_char,
910        C: Context<'ll>,
911    ) -> Module<'ll>;
912    pub(crate) safe fn LLVMCloneModule<'ll>(M: Module<'ll>) -> Module<'ll>;
913
914    /// Data layout. See Module::getDataLayout.
915    pub(crate) fn LLVMGetDataLayoutStr<'ll>(M: Module<'ll>) -> *const c_char;
916    pub(crate) fn LLVMSetDataLayout<'ll>(M: Module<'ll>, Triple: *const c_char);
917
918    /// Create the specified uniqued inline asm string. See `InlineAsm::get()`.
919    pub(crate) fn LLVMGetInlineAsm<'ll>(
920        Ty: Type<'ll>,
921        AsmString: *const c_uchar, // See "PTR_LEN_STR".
922        AsmStringSize: size_t,
923        Constraints: *const c_uchar, // See "PTR_LEN_STR".
924        ConstraintsSize: size_t,
925        HasSideEffects: llvm::Bool,
926        IsAlignStack: llvm::Bool,
927        Dialect: AsmDialect,
928        CanThrow: llvm::Bool,
929    ) -> Value<'ll>;
930
931    pub(crate) safe fn LLVMGetTypeKind<'ll>(Ty: Type<'ll>) -> RawEnum<TypeKind>;
932
933    // Operations on integer types
934    pub(crate) fn LLVMInt1TypeInContext<'ll>(C: Context<'ll>) -> Type<'ll>;
935    pub(crate) fn LLVMInt8TypeInContext<'ll>(C: Context<'ll>) -> Type<'ll>;
936    pub(crate) fn LLVMInt16TypeInContext<'ll>(C: Context<'ll>) -> Type<'ll>;
937    pub(crate) fn LLVMInt32TypeInContext<'ll>(C: Context<'ll>) -> Type<'ll>;
938    pub(crate) fn LLVMInt64TypeInContext<'ll>(C: Context<'ll>) -> Type<'ll>;
939    pub(crate) safe fn LLVMIntTypeInContext<'ll>(C: Context<'ll>, NumBits: c_uint) -> Type<'ll>;
940
941    pub(crate) fn LLVMGetIntTypeWidth<'ll>(IntegerTy: Type<'ll>) -> c_uint;
942
943    // Operations on real types
944    pub(crate) fn LLVMHalfTypeInContext<'ll>(C: Context<'ll>) -> Type<'ll>;
945    pub(crate) fn LLVMFloatTypeInContext<'ll>(C: Context<'ll>) -> Type<'ll>;
946    pub(crate) fn LLVMDoubleTypeInContext<'ll>(C: Context<'ll>) -> Type<'ll>;
947    pub(crate) fn LLVMFP128TypeInContext<'ll>(C: Context<'ll>) -> Type<'ll>;
948
949    // Operations on non-IEEE real types
950    pub(crate) fn LLVMBFloatTypeInContext<'ll>(C: Context<'ll>) -> Type<'ll>;
951    pub(crate) fn LLVMX86FP80TypeInContext<'ll>(C: Context<'ll>) -> Type<'ll>;
952    pub(crate) fn LLVMPPCFP128TypeInContext<'ll>(C: Context<'ll>) -> Type<'ll>;
953
954    // Operations on function types
955    pub(crate) fn LLVMFunctionType<'ll>(
956        ReturnType: Type<'ll>,
957        ParamTypes: *const Type<'ll>,
958        ParamCount: c_uint,
959        IsVarArg: Bool,
960    ) -> Type<'ll>;
961    pub(crate) fn LLVMCountParamTypes<'ll>(FunctionTy: Type<'ll>) -> c_uint;
962    pub(crate) fn LLVMGetParamTypes<'ll>(FunctionTy: Type<'ll>, Dest: *mut Type<'ll>);
963    pub(crate) fn LLVMGetReturnType<'ll>(FunctionTy: Type<'ll>) -> Type<'ll>;
964    pub(crate) fn LLVMIsFunctionVarArg<'ll>(FunctionTy: Type<'ll>) -> Bool;
965
966    // Operations on struct types
967    pub(crate) fn LLVMStructTypeInContext<'ll>(
968        C: Context<'ll>,
969        ElementTypes: *const Type<'ll>,
970        ElementCount: c_uint,
971        Packed: Bool,
972    ) -> Type<'ll>;
973
974    // Operations on array, pointer, and vector types (sequence types)
975    pub(crate) safe fn LLVMPointerTypeInContext<'ll>(
976        C: Context<'ll>,
977        AddressSpace: c_uint,
978    ) -> Type<'ll>;
979    pub(crate) fn LLVMVectorType<'ll>(ElementType: Type<'ll>, ElementCount: c_uint) -> Type<'ll>;
980    pub(crate) fn LLVMScalableVectorType<'ll>(
981        ElementType: Type<'ll>,
982        ElementCount: c_uint,
983    ) -> Type<'ll>;
984
985    pub(crate) fn LLVMGetElementType<'ll>(Ty: Type<'ll>) -> Type<'ll>;
986    pub(crate) fn LLVMGetVectorSize<'ll>(VectorTy: Type<'ll>) -> c_uint;
987
988    // Operations on other types
989    pub(crate) fn LLVMVoidTypeInContext<'ll>(C: Context<'ll>) -> Type<'ll>;
990
991    // Operations on all values
992    pub(crate) fn LLVMTypeOf<'ll>(Val: Value<'ll>) -> Type<'ll>;
993    pub(crate) fn LLVMGetValueName2<'ll>(Val: Value<'ll>, Length: *mut size_t) -> *const c_char;
994    pub(crate) fn LLVMSetValueName2<'ll>(
995        Val: Value<'ll>,
996        Name: *const c_uchar, // See "PTR_LEN_STR".
997        NameLen: size_t,
998    );
999    pub(crate) fn LLVMReplaceAllUsesWith<'ll>(OldVal: Value<'ll>, NewVal: Value<'ll>);
1000    pub(crate) safe fn LLVMGetMetadata<'ll>(
1001        Val: Value<'ll>,
1002        KindID: MetadataKindId,
1003    ) -> Option<Value<'ll>>;
1004    pub(crate) safe fn LLVMSetMetadata<'ll>(
1005        Val: Value<'ll>,
1006        KindID: MetadataKindId,
1007        Node: Value<'ll>,
1008    );
1009    pub(crate) fn LLVMGlobalSetMetadata<'ll>(
1010        Val: Value<'ll>,
1011        KindID: MetadataKindId,
1012        Metadata: &'ll Metadata,
1013    );
1014    pub(crate) fn LLVMGlobalAddMetadata<'ll>(
1015        Global: Value<'ll>,
1016        Kind: MetadataKindId,
1017        MD: &'ll Metadata,
1018    );
1019    pub(crate) safe fn LLVMValueAsMetadata<'ll>(Node: Value<'ll>) -> &'ll Metadata;
1020
1021    // Operations on constants of any type
1022    pub(crate) fn LLVMConstNull<'ll>(Ty: Type<'ll>) -> Value<'ll>;
1023    pub(crate) fn LLVMGetUndef<'ll>(Ty: Type<'ll>) -> Value<'ll>;
1024    pub(crate) fn LLVMGetPoison<'ll>(Ty: Type<'ll>) -> Value<'ll>;
1025
1026    // Operations on metadata
1027    pub(crate) fn LLVMMDStringInContext2<'ll>(
1028        C: Context<'ll>,
1029        Str: *const c_uchar, // See "PTR_LEN_STR".
1030        SLen: size_t,
1031    ) -> &'ll Metadata;
1032    pub(crate) fn LLVMMDNodeInContext2<'ll>(
1033        C: Context<'ll>,
1034        Vals: *const &'ll Metadata,
1035        Count: size_t,
1036    ) -> &'ll Metadata;
1037    pub(crate) fn LLVMAddNamedMetadataOperand<'ll>(
1038        M: Module<'ll>,
1039        Name: *const c_char,
1040        Val: Value<'ll>,
1041    );
1042    pub(crate) fn LLVMReplaceMDNodeOperandWith<'ll>(
1043        Val: Value<'ll>,
1044        index: u32,
1045        replacement: &'ll Metadata,
1046    );
1047
1048    // Operations on scalar constants
1049    pub(crate) fn LLVMConstInt<'ll>(
1050        IntTy: Type<'ll>,
1051        N: c_ulonglong,
1052        SignExtend: Bool,
1053    ) -> Value<'ll>;
1054    pub(crate) fn LLVMConstIntOfArbitraryPrecision<'ll>(
1055        IntTy: Type<'ll>,
1056        Wn: c_uint,
1057        Ws: *const u64,
1058    ) -> Value<'ll>;
1059    pub(crate) fn LLVMConstReal<'ll>(RealTy: Type<'ll>, N: f64) -> Value<'ll>;
1060
1061    // Operations on composite constants
1062    pub(crate) fn LLVMConstArray2<'ll>(
1063        ElementTy: Type<'ll>,
1064        ConstantVals: *const Value<'ll>,
1065        Length: u64,
1066    ) -> Value<'ll>;
1067    pub(crate) fn LLVMArrayType2<'ll>(ElementType: Type<'ll>, ElementCount: u64) -> Type<'ll>;
1068    pub(crate) fn LLVMConstStringInContext2<'ll>(
1069        C: Context<'ll>,
1070        Str: *const c_uchar, // See "PTR_LEN_STR".
1071        Length: size_t,
1072        DontNullTerminate: Bool,
1073    ) -> Value<'ll>;
1074    pub(crate) fn LLVMConstStructInContext<'ll>(
1075        C: Context<'ll>,
1076        ConstantVals: *const Value<'ll>,
1077        Count: c_uint,
1078        Packed: Bool,
1079    ) -> Value<'ll>;
1080    pub(crate) fn LLVMConstNamedStruct<'ll>(
1081        StructTy: Type<'ll>,
1082        ConstantVals: *const Value<'ll>,
1083        Count: c_uint,
1084    ) -> Value<'ll>;
1085    pub(crate) fn LLVMConstVector<'ll>(
1086        ScalarConstantVals: *const Value<'ll>,
1087        Size: c_uint,
1088    ) -> Value<'ll>;
1089
1090    // Constant expressions
1091    pub(crate) fn LLVMConstInBoundsGEP2<'ll>(
1092        ty: Type<'ll>,
1093        ConstantVal: Value<'ll>,
1094        ConstantIndices: *const Value<'ll>,
1095        NumIndices: c_uint,
1096    ) -> Value<'ll>;
1097    pub(crate) fn LLVMConstPtrToInt<'ll>(ConstantVal: Value<'ll>, ToType: Type<'ll>) -> Value<'ll>;
1098    pub(crate) fn LLVMConstIntToPtr<'ll>(ConstantVal: Value<'ll>, ToType: Type<'ll>) -> Value<'ll>;
1099    pub(crate) fn LLVMConstBitCast<'ll>(ConstantVal: Value<'ll>, ToType: Type<'ll>) -> Value<'ll>;
1100    pub(crate) fn LLVMConstPointerCast<'ll>(
1101        ConstantVal: Value<'ll>,
1102        ToType: Type<'ll>,
1103    ) -> Value<'ll>;
1104    pub(crate) fn LLVMGetAggregateElement<'ll>(
1105        ConstantVal: Value<'ll>,
1106        Idx: c_uint,
1107    ) -> Option<Value<'ll>>;
1108    pub(crate) fn LLVMGetConstOpcode<'ll>(ConstantVal: Value<'ll>) -> Opcode;
1109    pub(crate) fn LLVMIsAConstantExpr<'ll>(Val: Value<'ll>) -> Option<Value<'ll>>;
1110
1111    // Operations on global variables, functions, and aliases (globals)
1112    pub(crate) fn LLVMIsDeclaration<'ll>(Global: Value<'ll>) -> Bool;
1113    pub(crate) fn LLVMGetLinkage<'ll>(Global: Value<'ll>) -> RawEnum<Linkage>;
1114    pub(crate) fn LLVMSetLinkage<'ll>(Global: Value<'ll>, RustLinkage: Linkage);
1115    pub(crate) fn LLVMSetSection<'ll>(Global: Value<'ll>, Section: *const c_char);
1116    pub(crate) fn LLVMGetVisibility<'ll>(Global: Value<'ll>) -> RawEnum<Visibility>;
1117    pub(crate) fn LLVMSetVisibility<'ll>(Global: Value<'ll>, Viz: Visibility);
1118    pub(crate) fn LLVMGetAlignment<'ll>(Global: Value<'ll>) -> c_uint;
1119    pub(crate) fn LLVMSetAlignment<'ll>(Global: Value<'ll>, Bytes: c_uint);
1120    pub(crate) fn LLVMSetDLLStorageClass<'ll>(V: Value<'ll>, C: DLLStorageClass);
1121    pub(crate) fn LLVMGlobalGetValueType<'ll>(Global: Value<'ll>) -> Type<'ll>;
1122
1123    // Operations on global variables
1124    pub(crate) safe fn LLVMIsAGlobalVariable<'ll>(GlobalVar: Value<'ll>) -> Option<Value<'ll>>;
1125    pub(crate) fn LLVMAddGlobal<'ll>(
1126        M: Module<'ll>,
1127        Ty: Type<'ll>,
1128        Name: *const c_char,
1129    ) -> Value<'ll>;
1130    pub(crate) fn LLVMGetNamedGlobal<'ll>(
1131        M: Module<'ll>,
1132        Name: *const c_char,
1133    ) -> Option<Value<'ll>>;
1134    pub(crate) fn LLVMGetFirstGlobal<'ll>(M: Module<'ll>) -> Option<Value<'ll>>;
1135    pub(crate) fn LLVMGetNextGlobal<'ll>(GlobalVar: Value<'ll>) -> Option<Value<'ll>>;
1136    pub(crate) fn LLVMDeleteGlobal<'ll>(GlobalVar: Value<'ll>);
1137    pub(crate) safe fn LLVMGetInitializer<'ll>(GlobalVar: Value<'ll>) -> Option<Value<'ll>>;
1138    pub(crate) fn LLVMSetInitializer<'ll>(GlobalVar: Value<'ll>, ConstantVal: Value<'ll>);
1139    pub(crate) safe fn LLVMIsThreadLocal<'ll>(GlobalVar: Value<'ll>) -> Bool;
1140    pub(crate) fn LLVMSetThreadLocalMode<'ll>(GlobalVar: Value<'ll>, Mode: ThreadLocalMode);
1141    pub(crate) safe fn LLVMIsGlobalConstant<'ll>(GlobalVar: Value<'ll>) -> Bool;
1142    pub(crate) safe fn LLVMSetGlobalConstant<'ll>(GlobalVar: Value<'ll>, IsConstant: Bool);
1143    pub(crate) safe fn LLVMSetTailCall<'ll>(CallInst: Value<'ll>, IsTailCall: Bool);
1144    pub(crate) safe fn LLVMSetTailCallKind<'ll>(CallInst: Value<'ll>, kind: TailCallKind);
1145    pub(crate) safe fn LLVMSetExternallyInitialized<'ll>(GlobalVar: Value<'ll>, IsExtInit: Bool);
1146
1147    // Operations on global aliases
1148    pub(crate) fn LLVMAddAlias2<'ll>(
1149        M: Module<'ll>,
1150        ValueTy: Type<'ll>,
1151        AddressSpace: c_uint,
1152        Aliasee: Value<'ll>,
1153        Name: *const c_char,
1154    ) -> Value<'ll>;
1155    pub(crate) fn LLVMGetFirstGlobalAlias<'ll>(M: Module<'ll>) -> Option<Value<'ll>>;
1156    pub(crate) fn LLVMGetNextGlobalAlias<'ll>(GlobalAlias: Value<'ll>) -> Option<Value<'ll>>;
1157
1158    // Operations on attributes
1159    pub(crate) fn LLVMCreateStringAttribute<'ll>(
1160        C: Context<'ll>,
1161        Name: *const c_uchar, // See "PTR_LEN_STR".
1162        NameLen: c_uint,
1163        Value: *const c_uchar, // See "PTR_LEN_STR".
1164        ValueLen: c_uint,
1165    ) -> Attribute<'ll>;
1166
1167    // Operations on functions
1168    pub(crate) fn LLVMSetFunctionCallConv<'ll>(Fn: Value<'ll>, CC: c_uint);
1169    pub(crate) fn LLVMAddFunction<'ll>(
1170        Mod: Module<'ll>,
1171        Name: *const c_char,
1172        FunctionTy: Type<'ll>,
1173    ) -> Value<'ll>;
1174    pub(crate) fn LLVMDeleteFunction<'ll>(Fn: Value<'ll>);
1175    pub(crate) fn LLVMGetOrInsertFunction<'ll>(
1176        M: Module<'ll>,
1177        Name: *const c_uchar, // See "PTR_LEN_STR".
1178        NameLen: size_t,
1179        FunctionTy: Type<'ll>,
1180    ) -> Value<'ll>;
1181
1182    // Operations about llvm intrinsics
1183    pub(crate) fn LLVMLookupIntrinsicID(
1184        Name: *const c_uchar, // See "PTR_LEN_STR".
1185        NameLen: size_t,
1186    ) -> c_uint;
1187    pub(crate) fn LLVMIntrinsicIsOverloaded(ID: NonZero<c_uint>) -> Bool;
1188    pub(crate) fn LLVMGetIntrinsicDeclaration<'ll>(
1189        Mod: Module<'ll>,
1190        ID: NonZero<c_uint>,
1191        ParamTypes: *const Type<'ll>,
1192        ParamCount: size_t,
1193    ) -> Value<'ll>;
1194    pub(crate) fn LLVMRustUpgradeIntrinsicFunction<'ll>(
1195        Fn: Value<'ll>,
1196        NewFn: &mut Option<Value<'ll>>,
1197    ) -> bool;
1198    pub(crate) fn LLVMRustIsTargetIntrinsic(ID: NonZero<c_uint>) -> bool;
1199
1200    // Operations on parameters
1201    pub(crate) fn LLVMIsAArgument<'ll>(Val: Value<'ll>) -> Option<Value<'ll>>;
1202    pub(crate) safe fn LLVMCountParams<'ll>(Fn: Value<'ll>) -> c_uint;
1203    pub(crate) fn LLVMGetParam<'ll>(Fn: Value<'ll>, Index: c_uint) -> Value<'ll>;
1204
1205    // Operations on basic blocks
1206    pub(crate) fn LLVMGetBasicBlockParent<'ll>(BB: &'ll BasicBlock) -> Value<'ll>;
1207    pub(crate) fn LLVMAppendBasicBlockInContext<'ll>(
1208        C: Context<'ll>,
1209        Fn: Value<'ll>,
1210        Name: *const c_char,
1211    ) -> &'ll BasicBlock;
1212
1213    // Operations on instructions
1214    pub(crate) fn LLVMIsAInstruction<'ll>(Val: Value<'ll>) -> Option<Value<'ll>>;
1215    pub(crate) fn LLVMGetFirstBasicBlock<'ll>(Fn: Value<'ll>) -> &'ll BasicBlock;
1216    pub(crate) fn LLVMGetOperand<'ll>(Val: Value<'ll>, Index: c_uint) -> Option<Value<'ll>>;
1217
1218    // Operations on call sites
1219    pub(crate) fn LLVMSetInstructionCallConv<'ll>(Instr: Value<'ll>, CC: c_uint);
1220
1221    // Operations on load/store instructions (only)
1222    pub(crate) fn LLVMSetVolatile<'ll>(MemoryAccessInst: Value<'ll>, volatile: Bool);
1223    pub(crate) fn LLVMSetOrdering<'ll>(MemoryAccessInst: Value<'ll>, Ordering: AtomicOrdering);
1224
1225    // Operations on phi nodes
1226    pub(crate) fn LLVMAddIncoming<'ll>(
1227        PhiNode: Value<'ll>,
1228        IncomingValues: *const Value<'ll>,
1229        IncomingBlocks: *const &'ll BasicBlock,
1230        Count: c_uint,
1231    );
1232
1233    // Instruction builders
1234    pub(crate) fn LLVMCreateBuilderForModule<'ll>(M: Module<'ll>) -> ptr::NonNull<Builder<'ll>>;
1235    pub(crate) fn LLVMPositionBuilderAtEnd<'a>(Builder: &Builder<'a>, Block: &'a BasicBlock);
1236    pub(crate) fn LLVMGetInsertBlock<'a>(Builder: &Builder<'a>) -> &'a BasicBlock;
1237    pub(crate) fn LLVMDisposeBuilder<'ll>(Builder: ptr::NonNull<Builder<'ll>>);
1238
1239    // Metadata
1240    pub(crate) fn LLVMSetCurrentDebugLocation2<'a>(Builder: &Builder<'a>, Loc: *const Metadata);
1241    pub(crate) fn LLVMGetCurrentDebugLocation2<'a>(Builder: &Builder<'a>) -> Option<&'a Metadata>;
1242
1243    // Terminators
1244    pub(crate) safe fn LLVMBuildRetVoid<'ll>(B: &Builder<'ll>) -> Value<'ll>;
1245    pub(crate) fn LLVMBuildRet<'ll>(B: &Builder<'ll>, V: Value<'ll>) -> Value<'ll>;
1246    pub(crate) fn LLVMBuildBr<'ll>(B: &Builder<'ll>, Dest: &'ll BasicBlock) -> Value<'ll>;
1247    pub(crate) fn LLVMBuildCondBr<'ll>(
1248        B: &Builder<'ll>,
1249        If: Value<'ll>,
1250        Then: &'ll BasicBlock,
1251        Else: &'ll BasicBlock,
1252    ) -> Value<'ll>;
1253    pub(crate) fn LLVMBuildSwitch<'ll>(
1254        B: &Builder<'ll>,
1255        V: Value<'ll>,
1256        Else: &'ll BasicBlock,
1257        NumCases: c_uint,
1258    ) -> Value<'ll>;
1259    pub(crate) fn LLVMBuildLandingPad<'ll>(
1260        B: &Builder<'ll>,
1261        Ty: Type<'ll>,
1262        PersFn: Option<Value<'ll>>,
1263        NumClauses: c_uint,
1264        Name: *const c_char,
1265    ) -> Value<'ll>;
1266    pub(crate) fn LLVMBuildResume<'ll>(B: &Builder<'ll>, Exn: Value<'ll>) -> Value<'ll>;
1267    pub(crate) fn LLVMBuildUnreachable<'ll>(B: &Builder<'ll>) -> Value<'ll>;
1268
1269    pub(crate) fn LLVMBuildCleanupPad<'ll>(
1270        B: &Builder<'ll>,
1271        ParentPad: Option<Value<'ll>>,
1272        Args: *const Value<'ll>,
1273        NumArgs: c_uint,
1274        Name: *const c_char,
1275    ) -> Option<Value<'ll>>;
1276    pub(crate) fn LLVMBuildCleanupRet<'ll>(
1277        B: &Builder<'ll>,
1278        CleanupPad: Value<'ll>,
1279        BB: Option<&'ll BasicBlock>,
1280    ) -> Option<Value<'ll>>;
1281    pub(crate) fn LLVMBuildCatchPad<'ll>(
1282        B: &Builder<'ll>,
1283        ParentPad: Value<'ll>,
1284        Args: *const Value<'ll>,
1285        NumArgs: c_uint,
1286        Name: *const c_char,
1287    ) -> Option<Value<'ll>>;
1288    pub(crate) fn LLVMBuildCatchRet<'ll>(
1289        B: &Builder<'ll>,
1290        CatchPad: Value<'ll>,
1291        BB: &'ll BasicBlock,
1292    ) -> Option<Value<'ll>>;
1293    pub(crate) fn LLVMBuildCatchSwitch<'ll>(
1294        Builder: &Builder<'ll>,
1295        ParentPad: Option<Value<'ll>>,
1296        UnwindBB: Option<&'ll BasicBlock>,
1297        NumHandlers: c_uint,
1298        Name: *const c_char,
1299    ) -> Option<Value<'ll>>;
1300    pub(crate) fn LLVMAddHandler<'ll>(CatchSwitch: Value<'ll>, Dest: &'ll BasicBlock);
1301    pub(crate) fn LLVMSetPersonalityFn<'ll>(Func: Value<'ll>, Pers: Value<'ll>);
1302
1303    // Add a case to the switch instruction
1304    pub(crate) fn LLVMAddCase<'ll>(Switch: Value<'ll>, OnVal: Value<'ll>, Dest: &'ll BasicBlock);
1305
1306    // Add a clause to the landing pad instruction
1307    pub(crate) fn LLVMAddClause<'ll>(LandingPad: Value<'ll>, ClauseVal: Value<'ll>);
1308
1309    // Set the cleanup on a landing pad instruction
1310    pub(crate) fn LLVMSetCleanup<'ll>(LandingPad: Value<'ll>, Val: Bool);
1311
1312    // Arithmetic
1313    pub(crate) fn LLVMBuildAdd<'ll>(
1314        B: &Builder<'ll>,
1315        LHS: Value<'ll>,
1316        RHS: Value<'ll>,
1317        Name: *const c_char,
1318    ) -> Value<'ll>;
1319    pub(crate) fn LLVMBuildFAdd<'ll>(
1320        B: &Builder<'ll>,
1321        LHS: Value<'ll>,
1322        RHS: Value<'ll>,
1323        Name: *const c_char,
1324    ) -> Value<'ll>;
1325    pub(crate) fn LLVMBuildSub<'ll>(
1326        B: &Builder<'ll>,
1327        LHS: Value<'ll>,
1328        RHS: Value<'ll>,
1329        Name: *const c_char,
1330    ) -> Value<'ll>;
1331    pub(crate) fn LLVMBuildFSub<'ll>(
1332        B: &Builder<'ll>,
1333        LHS: Value<'ll>,
1334        RHS: Value<'ll>,
1335        Name: *const c_char,
1336    ) -> Value<'ll>;
1337    pub(crate) fn LLVMBuildMul<'ll>(
1338        B: &Builder<'ll>,
1339        LHS: Value<'ll>,
1340        RHS: Value<'ll>,
1341        Name: *const c_char,
1342    ) -> Value<'ll>;
1343    pub(crate) fn LLVMBuildFMul<'ll>(
1344        B: &Builder<'ll>,
1345        LHS: Value<'ll>,
1346        RHS: Value<'ll>,
1347        Name: *const c_char,
1348    ) -> Value<'ll>;
1349    pub(crate) fn LLVMBuildUDiv<'ll>(
1350        B: &Builder<'ll>,
1351        LHS: Value<'ll>,
1352        RHS: Value<'ll>,
1353        Name: *const c_char,
1354    ) -> Value<'ll>;
1355    pub(crate) fn LLVMBuildExactUDiv<'ll>(
1356        B: &Builder<'ll>,
1357        LHS: Value<'ll>,
1358        RHS: Value<'ll>,
1359        Name: *const c_char,
1360    ) -> Value<'ll>;
1361    pub(crate) fn LLVMBuildSDiv<'ll>(
1362        B: &Builder<'ll>,
1363        LHS: Value<'ll>,
1364        RHS: Value<'ll>,
1365        Name: *const c_char,
1366    ) -> Value<'ll>;
1367    pub(crate) fn LLVMBuildExactSDiv<'ll>(
1368        B: &Builder<'ll>,
1369        LHS: Value<'ll>,
1370        RHS: Value<'ll>,
1371        Name: *const c_char,
1372    ) -> Value<'ll>;
1373    pub(crate) fn LLVMBuildFDiv<'ll>(
1374        B: &Builder<'ll>,
1375        LHS: Value<'ll>,
1376        RHS: Value<'ll>,
1377        Name: *const c_char,
1378    ) -> Value<'ll>;
1379    pub(crate) fn LLVMBuildURem<'ll>(
1380        B: &Builder<'ll>,
1381        LHS: Value<'ll>,
1382        RHS: Value<'ll>,
1383        Name: *const c_char,
1384    ) -> Value<'ll>;
1385    pub(crate) fn LLVMBuildSRem<'ll>(
1386        B: &Builder<'ll>,
1387        LHS: Value<'ll>,
1388        RHS: Value<'ll>,
1389        Name: *const c_char,
1390    ) -> Value<'ll>;
1391    pub(crate) fn LLVMBuildFRem<'ll>(
1392        B: &Builder<'ll>,
1393        LHS: Value<'ll>,
1394        RHS: Value<'ll>,
1395        Name: *const c_char,
1396    ) -> Value<'ll>;
1397    pub(crate) fn LLVMBuildShl<'ll>(
1398        B: &Builder<'ll>,
1399        LHS: Value<'ll>,
1400        RHS: Value<'ll>,
1401        Name: *const c_char,
1402    ) -> Value<'ll>;
1403    pub(crate) fn LLVMBuildLShr<'ll>(
1404        B: &Builder<'ll>,
1405        LHS: Value<'ll>,
1406        RHS: Value<'ll>,
1407        Name: *const c_char,
1408    ) -> Value<'ll>;
1409    pub(crate) fn LLVMBuildAShr<'ll>(
1410        B: &Builder<'ll>,
1411        LHS: Value<'ll>,
1412        RHS: Value<'ll>,
1413        Name: *const c_char,
1414    ) -> Value<'ll>;
1415    pub(crate) fn LLVMBuildNSWAdd<'ll>(
1416        B: &Builder<'ll>,
1417        LHS: Value<'ll>,
1418        RHS: Value<'ll>,
1419        Name: *const c_char,
1420    ) -> Value<'ll>;
1421    pub(crate) fn LLVMBuildNUWAdd<'ll>(
1422        B: &Builder<'ll>,
1423        LHS: Value<'ll>,
1424        RHS: Value<'ll>,
1425        Name: *const c_char,
1426    ) -> Value<'ll>;
1427    pub(crate) fn LLVMBuildNSWSub<'ll>(
1428        B: &Builder<'ll>,
1429        LHS: Value<'ll>,
1430        RHS: Value<'ll>,
1431        Name: *const c_char,
1432    ) -> Value<'ll>;
1433    pub(crate) fn LLVMBuildNUWSub<'ll>(
1434        B: &Builder<'ll>,
1435        LHS: Value<'ll>,
1436        RHS: Value<'ll>,
1437        Name: *const c_char,
1438    ) -> Value<'ll>;
1439    pub(crate) fn LLVMBuildNSWMul<'ll>(
1440        B: &Builder<'ll>,
1441        LHS: Value<'ll>,
1442        RHS: Value<'ll>,
1443        Name: *const c_char,
1444    ) -> Value<'ll>;
1445    pub(crate) fn LLVMBuildNUWMul<'ll>(
1446        B: &Builder<'ll>,
1447        LHS: Value<'ll>,
1448        RHS: Value<'ll>,
1449        Name: *const c_char,
1450    ) -> Value<'ll>;
1451    pub(crate) fn LLVMBuildAnd<'ll>(
1452        B: &Builder<'ll>,
1453        LHS: Value<'ll>,
1454        RHS: Value<'ll>,
1455        Name: *const c_char,
1456    ) -> Value<'ll>;
1457    pub(crate) fn LLVMBuildOr<'ll>(
1458        B: &Builder<'ll>,
1459        LHS: Value<'ll>,
1460        RHS: Value<'ll>,
1461        Name: *const c_char,
1462    ) -> Value<'ll>;
1463    pub(crate) fn LLVMBuildXor<'ll>(
1464        B: &Builder<'ll>,
1465        LHS: Value<'ll>,
1466        RHS: Value<'ll>,
1467        Name: *const c_char,
1468    ) -> Value<'ll>;
1469    pub(crate) fn LLVMBuildNeg<'ll>(
1470        B: &Builder<'ll>,
1471        V: Value<'ll>,
1472        Name: *const c_char,
1473    ) -> Value<'ll>;
1474    pub(crate) fn LLVMBuildFNeg<'ll>(
1475        B: &Builder<'ll>,
1476        V: Value<'ll>,
1477        Name: *const c_char,
1478    ) -> Value<'ll>;
1479    pub(crate) fn LLVMBuildNot<'ll>(
1480        B: &Builder<'ll>,
1481        V: Value<'ll>,
1482        Name: *const c_char,
1483    ) -> Value<'ll>;
1484
1485    // Extra flags on arithmetic
1486    pub(crate) fn LLVMSetIsDisjoint<'ll>(Instr: Value<'ll>, IsDisjoint: Bool);
1487    pub(crate) fn LLVMSetNUW<'ll>(ArithInst: Value<'ll>, HasNUW: Bool);
1488    pub(crate) fn LLVMSetNSW<'ll>(ArithInst: Value<'ll>, HasNSW: Bool);
1489
1490    // Memory
1491    pub(crate) fn LLVMBuildAlloca<'ll>(
1492        B: &Builder<'ll>,
1493        Ty: Type<'ll>,
1494        Name: *const c_char,
1495    ) -> Value<'ll>;
1496    pub(crate) fn LLVMBuildLoad2<'ll>(
1497        B: &Builder<'ll>,
1498        Ty: Type<'ll>,
1499        PointerVal: Value<'ll>,
1500        Name: *const c_char,
1501    ) -> Value<'ll>;
1502
1503    pub(crate) fn LLVMBuildStore<'ll>(
1504        B: &Builder<'ll>,
1505        Val: Value<'ll>,
1506        Ptr: Value<'ll>,
1507    ) -> Value<'ll>;
1508
1509    pub(crate) fn LLVMBuildGEPWithNoWrapFlags<'ll>(
1510        B: &Builder<'ll>,
1511        Ty: Type<'ll>,
1512        Pointer: Value<'ll>,
1513        Indices: *const Value<'ll>,
1514        NumIndices: c_uint,
1515        Name: *const c_char,
1516        Flags: GEPNoWrapFlags,
1517    ) -> Value<'ll>;
1518
1519    // Casts
1520    pub(crate) fn LLVMBuildTrunc<'ll>(
1521        B: &Builder<'ll>,
1522        Val: Value<'ll>,
1523        DestTy: Type<'ll>,
1524        Name: *const c_char,
1525    ) -> Value<'ll>;
1526    pub(crate) fn LLVMBuildZExt<'ll>(
1527        B: &Builder<'ll>,
1528        Val: Value<'ll>,
1529        DestTy: Type<'ll>,
1530        Name: *const c_char,
1531    ) -> Value<'ll>;
1532    pub(crate) fn LLVMBuildSExt<'ll>(
1533        B: &Builder<'ll>,
1534        Val: Value<'ll>,
1535        DestTy: Type<'ll>,
1536        Name: *const c_char,
1537    ) -> Value<'ll>;
1538    pub(crate) fn LLVMBuildFPToUI<'ll>(
1539        B: &Builder<'ll>,
1540        Val: Value<'ll>,
1541        DestTy: Type<'ll>,
1542        Name: *const c_char,
1543    ) -> Value<'ll>;
1544    pub(crate) fn LLVMBuildFPToSI<'ll>(
1545        B: &Builder<'ll>,
1546        Val: Value<'ll>,
1547        DestTy: Type<'ll>,
1548        Name: *const c_char,
1549    ) -> Value<'ll>;
1550    pub(crate) fn LLVMBuildUIToFP<'ll>(
1551        B: &Builder<'ll>,
1552        Val: Value<'ll>,
1553        DestTy: Type<'ll>,
1554        Name: *const c_char,
1555    ) -> Value<'ll>;
1556    pub(crate) fn LLVMBuildSIToFP<'ll>(
1557        B: &Builder<'ll>,
1558        Val: Value<'ll>,
1559        DestTy: Type<'ll>,
1560        Name: *const c_char,
1561    ) -> Value<'ll>;
1562    pub(crate) fn LLVMBuildFPTrunc<'ll>(
1563        B: &Builder<'ll>,
1564        Val: Value<'ll>,
1565        DestTy: Type<'ll>,
1566        Name: *const c_char,
1567    ) -> Value<'ll>;
1568    pub(crate) fn LLVMBuildFPExt<'ll>(
1569        B: &Builder<'ll>,
1570        Val: Value<'ll>,
1571        DestTy: Type<'ll>,
1572        Name: *const c_char,
1573    ) -> Value<'ll>;
1574    pub(crate) fn LLVMBuildPtrToInt<'ll>(
1575        B: &Builder<'ll>,
1576        Val: Value<'ll>,
1577        DestTy: Type<'ll>,
1578        Name: *const c_char,
1579    ) -> Value<'ll>;
1580    pub(crate) fn LLVMBuildIntToPtr<'ll>(
1581        B: &Builder<'ll>,
1582        Val: Value<'ll>,
1583        DestTy: Type<'ll>,
1584        Name: *const c_char,
1585    ) -> Value<'ll>;
1586    pub(crate) fn LLVMBuildBitCast<'ll>(
1587        B: &Builder<'ll>,
1588        Val: Value<'ll>,
1589        DestTy: Type<'ll>,
1590        Name: *const c_char,
1591    ) -> Value<'ll>;
1592    pub(crate) fn LLVMBuildPointerCast<'ll>(
1593        B: &Builder<'ll>,
1594        Val: Value<'ll>,
1595        DestTy: Type<'ll>,
1596        Name: *const c_char,
1597    ) -> Value<'ll>;
1598    pub(crate) fn LLVMBuildIntCast2<'ll>(
1599        B: &Builder<'ll>,
1600        Val: Value<'ll>,
1601        DestTy: Type<'ll>,
1602        IsSigned: Bool,
1603        Name: *const c_char,
1604    ) -> Value<'ll>;
1605
1606    // Comparisons
1607    pub(crate) fn LLVMBuildICmp<'ll>(
1608        B: &Builder<'ll>,
1609        Op: c_uint,
1610        LHS: Value<'ll>,
1611        RHS: Value<'ll>,
1612        Name: *const c_char,
1613    ) -> Value<'ll>;
1614    pub(crate) fn LLVMBuildFCmp<'ll>(
1615        B: &Builder<'ll>,
1616        Op: c_uint,
1617        LHS: Value<'ll>,
1618        RHS: Value<'ll>,
1619        Name: *const c_char,
1620    ) -> Value<'ll>;
1621
1622    // Miscellaneous instructions
1623    pub(crate) fn LLVMBuildPhi<'ll>(
1624        B: &Builder<'ll>,
1625        Ty: Type<'ll>,
1626        Name: *const c_char,
1627    ) -> Value<'ll>;
1628    pub(crate) fn LLVMBuildSelect<'ll>(
1629        B: &Builder<'ll>,
1630        If: Value<'ll>,
1631        Then: Value<'ll>,
1632        Else: Value<'ll>,
1633        Name: *const c_char,
1634    ) -> Value<'ll>;
1635    pub(crate) fn LLVMBuildVAArg<'ll>(
1636        B: &Builder<'ll>,
1637        list: Value<'ll>,
1638        Ty: Type<'ll>,
1639        Name: *const c_char,
1640    ) -> Value<'ll>;
1641    pub(crate) fn LLVMBuildExtractElement<'ll>(
1642        B: &Builder<'ll>,
1643        VecVal: Value<'ll>,
1644        Index: Value<'ll>,
1645        Name: *const c_char,
1646    ) -> Value<'ll>;
1647    pub(crate) fn LLVMBuildInsertElement<'ll>(
1648        B: &Builder<'ll>,
1649        VecVal: Value<'ll>,
1650        EltVal: Value<'ll>,
1651        Index: Value<'ll>,
1652        Name: *const c_char,
1653    ) -> Value<'ll>;
1654    pub(crate) fn LLVMBuildShuffleVector<'ll>(
1655        B: &Builder<'ll>,
1656        V1: Value<'ll>,
1657        V2: Value<'ll>,
1658        Mask: Value<'ll>,
1659        Name: *const c_char,
1660    ) -> Value<'ll>;
1661    pub(crate) fn LLVMBuildExtractValue<'ll>(
1662        B: &Builder<'ll>,
1663        AggVal: Value<'ll>,
1664        Index: c_uint,
1665        Name: *const c_char,
1666    ) -> Value<'ll>;
1667    pub(crate) fn LLVMBuildInsertValue<'ll>(
1668        B: &Builder<'ll>,
1669        AggVal: Value<'ll>,
1670        EltVal: Value<'ll>,
1671        Index: c_uint,
1672        Name: *const c_char,
1673    ) -> Value<'ll>;
1674    pub(crate) fn LLVMBuildFreeze<'ll>(
1675        B: &Builder<'ll>,
1676        Val: Value<'ll>,
1677        Name: *const c_char,
1678    ) -> Value<'ll>;
1679
1680    // Atomic Operations
1681    pub(crate) fn LLVMBuildAtomicCmpXchg<'ll>(
1682        B: &Builder<'ll>,
1683        LHS: Value<'ll>,
1684        CMP: Value<'ll>,
1685        RHS: Value<'ll>,
1686        Order: AtomicOrdering,
1687        FailureOrder: AtomicOrdering,
1688        SingleThreaded: Bool,
1689    ) -> Value<'ll>;
1690
1691    pub(crate) fn LLVMSetWeak<'ll>(CmpXchgInst: Value<'ll>, IsWeak: Bool);
1692
1693    pub(crate) fn LLVMBuildAtomicRMW<'ll>(
1694        B: &Builder<'ll>,
1695        Op: AtomicRmwBinOp,
1696        LHS: Value<'ll>,
1697        RHS: Value<'ll>,
1698        Order: AtomicOrdering,
1699        SingleThreaded: Bool,
1700    ) -> Value<'ll>;
1701
1702    pub(crate) fn LLVMBuildFence<'ll>(
1703        B: &Builder<'ll>,
1704        Order: AtomicOrdering,
1705        SingleThreaded: Bool,
1706        Name: *const c_char,
1707    ) -> Value<'ll>;
1708
1709    /// Writes a module to the specified path. Returns 0 on success.
1710    pub(crate) fn LLVMWriteBitcodeToFile<'ll>(M: Module<'ll>, Path: *const c_char) -> c_int;
1711
1712    pub(crate) fn LLVMGetHostCPUFeatures() -> *mut c_char;
1713
1714    pub(crate) fn LLVMDisposeMessage(message: *mut c_char);
1715
1716    pub(crate) fn LLVMIsMultithreaded() -> Bool;
1717
1718    pub(crate) fn LLVMStructCreateNamed<'ll>(C: Context<'ll>, Name: *const c_char) -> Type<'ll>;
1719
1720    pub(crate) fn LLVMStructSetBody<'ll>(
1721        StructTy: Type<'ll>,
1722        ElementTypes: *const Type<'ll>,
1723        ElementCount: c_uint,
1724        Packed: Bool,
1725    );
1726
1727    pub(crate) fn LLVMCountStructElementTypes<'ll>(StructTy: Type<'ll>) -> c_uint;
1728    pub(crate) fn LLVMGetStructElementTypes<'ll>(StructTy: Type<'ll>, Dest: *mut Type<'ll>);
1729
1730    pub(crate) safe fn LLVMMetadataAsValue<'ll>(C: Context<'ll>, MD: &'ll Metadata) -> Value<'ll>;
1731
1732    pub(crate) safe fn LLVMSetUnnamedAddress<'ll>(Global: Value<'ll>, UnnamedAddr: UnnamedAddr);
1733
1734    pub(crate) fn LLVMIsAConstantInt<'ll>(value_ref: Value<'ll>) -> Option<&'ll ConstantInt>;
1735
1736    pub(crate) fn LLVMGetOrInsertComdat<'ll>(M: Module<'ll>, Name: *const c_char) -> &'ll Comdat;
1737    pub(crate) fn LLVMSetComdat<'ll>(V: Value<'ll>, C: &Comdat);
1738
1739    pub(crate) fn LLVMCreateOperandBundle<'ll>(
1740        Tag: *const c_uchar, // See "PTR_LEN_STR".
1741        TagLen: size_t,
1742        Args: *const Value<'ll>,
1743        NumArgs: c_uint,
1744    ) -> *mut OperandBundle<'ll>;
1745    pub(crate) fn LLVMDisposeOperandBundle(Bundle: ptr::NonNull<OperandBundle<'_>>);
1746
1747    pub(crate) fn LLVMBuildCallWithOperandBundles<'ll>(
1748        B: &Builder<'ll>,
1749        Ty: Type<'ll>,
1750        Fn: Value<'ll>,
1751        Args: *const Value<'ll>,
1752        NumArgs: c_uint,
1753        Bundles: *const &OperandBundle<'ll>,
1754        NumBundles: c_uint,
1755        Name: *const c_char,
1756    ) -> Value<'ll>;
1757    pub(crate) fn LLVMBuildInvokeWithOperandBundles<'ll>(
1758        B: &Builder<'ll>,
1759        Ty: Type<'ll>,
1760        Fn: Value<'ll>,
1761        Args: *const Value<'ll>,
1762        NumArgs: c_uint,
1763        Then: &'ll BasicBlock,
1764        Catch: &'ll BasicBlock,
1765        Bundles: *const &OperandBundle<'ll>,
1766        NumBundles: c_uint,
1767        Name: *const c_char,
1768    ) -> Value<'ll>;
1769    pub(crate) fn LLVMBuildCallBr<'ll>(
1770        B: &Builder<'ll>,
1771        Ty: Type<'ll>,
1772        Fn: Value<'ll>,
1773        DefaultDest: &'ll BasicBlock,
1774        IndirectDests: *const &'ll BasicBlock,
1775        NumIndirectDests: c_uint,
1776        Args: *const Value<'ll>,
1777        NumArgs: c_uint,
1778        Bundles: *const &OperandBundle<'ll>,
1779        NumBundles: c_uint,
1780        Name: *const c_char,
1781    ) -> Value<'ll>;
1782}
1783
1784// FFI bindings for `DIBuilder` functions in the LLVM-C API.
1785// Try to keep these in the same order as in `llvm/include/llvm-c/DebugInfo.h`.
1786//
1787// FIXME(#134001): Audit all `Option` parameters, especially in lists, to check
1788// that they really are nullable on the C/C++ side. LLVM doesn't appear to
1789// actually document which ones are nullable.
1790unsafe extern "C" {
1791    pub(crate) fn LLVMCreateDIBuilder<'ll>(M: Module<'ll>) -> *mut DIBuilder<'ll>;
1792    pub(crate) fn LLVMDisposeDIBuilder<'ll>(Builder: ptr::NonNull<DIBuilder<'ll>>);
1793
1794    pub(crate) fn LLVMDIBuilderFinalize<'ll>(Builder: &DIBuilder<'ll>);
1795
1796    pub(crate) fn LLVMDIBuilderCreateNameSpace<'ll>(
1797        Builder: &DIBuilder<'ll>,
1798        ParentScope: Option<&'ll Metadata>,
1799        Name: *const c_uchar, // See "PTR_LEN_STR".
1800        NameLen: size_t,
1801        ExportSymbols: llvm::Bool,
1802    ) -> &'ll Metadata;
1803
1804    pub(crate) fn LLVMDIBuilderCreateLexicalBlock<'ll>(
1805        Builder: &DIBuilder<'ll>,
1806        Scope: &'ll Metadata,
1807        File: &'ll Metadata,
1808        Line: c_uint,
1809        Column: c_uint,
1810    ) -> &'ll Metadata;
1811
1812    pub(crate) fn LLVMDIBuilderCreateLexicalBlockFile<'ll>(
1813        Builder: &DIBuilder<'ll>,
1814        Scope: &'ll Metadata,
1815        File: &'ll Metadata,
1816        Discriminator: c_uint, // (optional "DWARF path discriminator"; default is 0)
1817    ) -> &'ll Metadata;
1818
1819    pub(crate) fn LLVMDIBuilderCreateDebugLocation<'ll>(
1820        Ctx: Context<'ll>,
1821        Line: c_uint,
1822        Column: c_uint,
1823        Scope: &'ll Metadata,
1824        InlinedAt: Option<&'ll Metadata>,
1825    ) -> &'ll Metadata;
1826
1827    pub(crate) fn LLVMDIBuilderCreateSubroutineType<'ll>(
1828        Builder: &DIBuilder<'ll>,
1829        File: Option<&'ll Metadata>, // (ignored and has no effect)
1830        ParameterTypes: *const Option<&'ll Metadata>,
1831        NumParameterTypes: c_uint,
1832        Flags: DIFlags, // (default is `DIFlags::DIFlagZero`)
1833    ) -> &'ll Metadata;
1834
1835    pub(crate) fn LLVMDIBuilderCreateEnumeratorOfArbitraryPrecision<'ll>(
1836        Builder: &DIBuilder<'ll>,
1837        Name: *const c_uchar, // See "PTR_LEN_STR".
1838        NameLen: size_t,
1839        SizeInBits: u64,
1840        Words: *const u64, // LLVM computes `NumWords = (SizeInBits + 63) / 64`.
1841        IsUnsigned: llvm::Bool,
1842    ) -> &'ll Metadata;
1843
1844    pub(crate) fn LLVMDIBuilderCreateUnionType<'ll>(
1845        Builder: &DIBuilder<'ll>,
1846        Scope: Option<&'ll Metadata>,
1847        Name: *const c_uchar, // See "PTR_LEN_STR".
1848        NameLen: size_t,
1849        File: &'ll Metadata,
1850        LineNumber: c_uint,
1851        SizeInBits: u64,
1852        AlignInBits: u32,
1853        Flags: DIFlags,
1854        Elements: *const Option<&'ll Metadata>,
1855        NumElements: c_uint,
1856        RunTimeLang: c_uint, // (optional Objective-C runtime version; default is 0)
1857        UniqueId: *const c_uchar, // See "PTR_LEN_STR".
1858        UniqueIdLen: size_t,
1859    ) -> &'ll Metadata;
1860
1861    pub(crate) fn LLVMDIBuilderCreateArrayType<'ll>(
1862        Builder: &DIBuilder<'ll>,
1863        Size: u64,
1864        Align: u32,
1865        Ty: &'ll Metadata,
1866        Subscripts: *const &'ll Metadata,
1867        NumSubscripts: c_uint,
1868    ) -> &'ll Metadata;
1869
1870    pub(crate) fn LLVMDIBuilderCreateBasicType<'ll>(
1871        Builder: &DIBuilder<'ll>,
1872        Name: *const c_uchar, // See "PTR_LEN_STR".
1873        NameLen: size_t,
1874        SizeInBits: u64,
1875        Encoding: c_uint, // (`LLVMDWARFTypeEncoding`)
1876        Flags: DIFlags,   // (default is `DIFlags::DIFlagZero`)
1877    ) -> &'ll Metadata;
1878
1879    pub(crate) fn LLVMDIBuilderCreatePointerType<'ll>(
1880        Builder: &DIBuilder<'ll>,
1881        PointeeTy: &'ll Metadata,
1882        SizeInBits: u64,
1883        AlignInBits: u32,
1884        AddressSpace: c_uint, // (optional DWARF address space; default is 0)
1885        Name: *const c_uchar, // See "PTR_LEN_STR".
1886        NameLen: size_t,
1887    ) -> &'ll Metadata;
1888
1889    pub(crate) fn LLVMDIBuilderCreateStructType<'ll>(
1890        Builder: &DIBuilder<'ll>,
1891        Scope: Option<&'ll Metadata>,
1892        Name: *const c_uchar, // See "PTR_LEN_STR".
1893        NameLen: size_t,
1894        File: &'ll Metadata,
1895        LineNumber: c_uint,
1896        SizeInBits: u64,
1897        AlignInBits: u32,
1898        Flags: DIFlags,
1899        DerivedFrom: Option<&'ll Metadata>,
1900        Elements: *const Option<&'ll Metadata>,
1901        NumElements: c_uint,
1902        RunTimeLang: c_uint, // (optional Objective-C runtime version; default is 0)
1903        VTableHolder: Option<&'ll Metadata>,
1904        UniqueId: *const c_uchar, // See "PTR_LEN_STR".
1905        UniqueIdLen: size_t,
1906    ) -> &'ll Metadata;
1907
1908    pub(crate) fn LLVMDIBuilderCreateMemberType<'ll>(
1909        Builder: &DIBuilder<'ll>,
1910        Scope: &'ll Metadata,
1911        Name: *const c_uchar, // See "PTR_LEN_STR".
1912        NameLen: size_t,
1913        File: &'ll Metadata,
1914        LineNo: c_uint,
1915        SizeInBits: u64,
1916        AlignInBits: u32,
1917        OffsetInBits: u64,
1918        Flags: DIFlags,
1919        Ty: &'ll Metadata,
1920    ) -> &'ll Metadata;
1921
1922    pub(crate) fn LLVMDIBuilderCreateStaticMemberType<'ll>(
1923        Builder: &DIBuilder<'ll>,
1924        Scope: &'ll Metadata,
1925        Name: *const c_uchar, // See "PTR_LEN_STR".
1926        NameLen: size_t,
1927        File: &'ll Metadata,
1928        LineNumber: c_uint,
1929        Type: &'ll Metadata,
1930        Flags: DIFlags,
1931        ConstantVal: Option<Value<'ll>>,
1932        AlignInBits: u32,
1933    ) -> &'ll Metadata;
1934
1935    /// Creates a "qualified type" in the C/C++ sense, by adding modifiers
1936    /// like `const` or `volatile`.
1937    pub(crate) fn LLVMDIBuilderCreateQualifiedType<'ll>(
1938        Builder: &DIBuilder<'ll>,
1939        Tag: c_uint, // (DWARF tag, e.g. `DW_TAG_const_type`)
1940        Type: &'ll Metadata,
1941    ) -> &'ll Metadata;
1942
1943    pub(crate) fn LLVMDIBuilderCreateTypedef<'ll>(
1944        Builder: &DIBuilder<'ll>,
1945        Type: &'ll Metadata,
1946        Name: *const c_uchar, // See "PTR_LEN_STR".
1947        NameLen: size_t,
1948        File: &'ll Metadata,
1949        LineNo: c_uint,
1950        Scope: Option<&'ll Metadata>,
1951        AlignInBits: u32, // (optional; default is 0)
1952    ) -> &'ll Metadata;
1953
1954    pub(crate) fn LLVMDIBuilderGetOrCreateSubrange<'ll>(
1955        Builder: &DIBuilder<'ll>,
1956        LowerBound: i64,
1957        Count: i64,
1958    ) -> &'ll Metadata;
1959
1960    pub(crate) fn LLVMDIBuilderGetOrCreateArray<'ll>(
1961        Builder: &DIBuilder<'ll>,
1962        Data: *const Option<&'ll Metadata>,
1963        NumElements: size_t,
1964    ) -> &'ll Metadata;
1965
1966    pub(crate) fn LLVMDIBuilderCreateExpression<'ll>(
1967        Builder: &DIBuilder<'ll>,
1968        Addr: *const u64,
1969        Length: size_t,
1970    ) -> &'ll Metadata;
1971
1972    pub(crate) fn LLVMDIBuilderCreateGlobalVariableExpression<'ll>(
1973        Builder: &DIBuilder<'ll>,
1974        Scope: Option<&'ll Metadata>,
1975        Name: *const c_uchar, // See "PTR_LEN_STR".
1976        NameLen: size_t,
1977        Linkage: *const c_uchar, // See "PTR_LEN_STR".
1978        LinkLen: size_t,
1979        File: &'ll Metadata,
1980        LineNo: c_uint,
1981        Ty: &'ll Metadata,
1982        LocalToUnit: llvm::Bool,
1983        Expr: &'ll Metadata,
1984        Decl: Option<&'ll Metadata>,
1985        AlignInBits: u32,
1986    ) -> &'ll Metadata;
1987
1988    pub(crate) fn LLVMDIBuilderInsertDeclareRecordAtEnd<'ll>(
1989        Builder: &DIBuilder<'ll>,
1990        Storage: Value<'ll>,
1991        VarInfo: &'ll Metadata,
1992        Expr: &'ll Metadata,
1993        DebugLoc: &'ll Metadata,
1994        Block: &'ll BasicBlock,
1995    ) -> &'ll DbgRecord;
1996
1997    pub(crate) fn LLVMDIBuilderInsertDbgValueRecordAtEnd<'ll>(
1998        Builder: &DIBuilder<'ll>,
1999        Val: Value<'ll>,
2000        VarInfo: &'ll Metadata,
2001        Expr: &'ll Metadata,
2002        DebugLoc: &'ll Metadata,
2003        Block: &'ll BasicBlock,
2004    ) -> &'ll DbgRecord;
2005
2006    pub(crate) fn LLVMDIBuilderCreateAutoVariable<'ll>(
2007        Builder: &DIBuilder<'ll>,
2008        Scope: &'ll Metadata,
2009        Name: *const c_uchar, // See "PTR_LEN_STR".
2010        NameLen: size_t,
2011        File: &'ll Metadata,
2012        LineNo: c_uint,
2013        Ty: &'ll Metadata,
2014        AlwaysPreserve: llvm::Bool, // "If true, this descriptor will survive optimizations."
2015        Flags: DIFlags,
2016        AlignInBits: u32,
2017    ) -> &'ll Metadata;
2018
2019    pub(crate) fn LLVMDIBuilderCreateParameterVariable<'ll>(
2020        Builder: &DIBuilder<'ll>,
2021        Scope: &'ll Metadata,
2022        Name: *const c_uchar, // See "PTR_LEN_STR".
2023        NameLen: size_t,
2024        ArgNo: c_uint,
2025        File: &'ll Metadata,
2026        LineNo: c_uint,
2027        Ty: &'ll Metadata,
2028        AlwaysPreserve: llvm::Bool, // "If true, this descriptor will survive optimizations."
2029        Flags: DIFlags,
2030    ) -> &'ll Metadata;
2031}
2032
2033#[link(name = "llvm-wrapper", kind = "static")]
2034unsafe extern "C" {
2035    pub(crate) fn LLVMRustInstallErrorHandlers();
2036    pub(crate) fn LLVMRustDisableSystemDialogsOnCrash();
2037
2038    // Operations on all values
2039    pub(crate) fn LLVMRustIsNonGVFunctionPointerTy<'ll>(Val: Value<'ll>) -> bool;
2040    pub(crate) fn LLVMRustStripPointerCasts<'ll>(Val: Value<'ll>) -> Value<'ll>;
2041
2042    // Operations on scalar constants
2043    pub(crate) fn LLVMRustConstIntGetZExtValue(ConstantVal: &ConstantInt, Value: &mut u64) -> bool;
2044    pub(crate) fn LLVMRustConstInt128Get(
2045        ConstantVal: &ConstantInt,
2046        SExt: bool,
2047        high: &mut u64,
2048        low: &mut u64,
2049    ) -> bool;
2050
2051    // Operations on global variables, functions, and aliases (globals)
2052    pub(crate) fn LLVMRustSetDSOLocal<'ll>(Global: Value<'ll>, is_dso_local: bool);
2053
2054    // Operations on global variables
2055    pub(crate) fn LLVMRustGetOrInsertGlobal<'ll>(
2056        M: Module<'ll>,
2057        Name: *const c_uchar, // See "PTR_LEN_STR".
2058        NameLen: size_t,
2059        T: Type<'ll>,
2060    ) -> Value<'ll>;
2061    pub(crate) fn LLVMRustGetOrInsertGlobalInAddrspace<'ll>(
2062        M: Module<'ll>,
2063        Name: *const c_uchar, // See "PTR_LEN_STR".
2064        NameLen: size_t,
2065        T: Type<'ll>,
2066        AddressSpace: c_uint,
2067    ) -> Value<'ll>;
2068    pub(crate) fn LLVMRustGetNamedValue<'ll>(
2069        M: Module<'ll>,
2070        Name: *const c_uchar, // See "PTR_LEN_STR".
2071        NameLen: size_t,
2072    ) -> Option<Value<'ll>>;
2073
2074    // Operations on attributes
2075    pub(crate) fn LLVMRustCreateAttrNoValue<'ll>(
2076        C: Context<'ll>,
2077        attr: AttributeKind,
2078    ) -> Attribute<'ll>;
2079    pub(crate) fn LLVMRustCreateAlignmentAttr<'ll>(C: Context<'ll>, bytes: u64) -> Attribute<'ll>;
2080    pub(crate) fn LLVMRustCreateDereferenceableAttr<'ll>(
2081        C: Context<'ll>,
2082        bytes: u64,
2083    ) -> Attribute<'ll>;
2084    pub(crate) fn LLVMRustCreateDereferenceableOrNullAttr<'ll>(
2085        C: Context<'ll>,
2086        bytes: u64,
2087    ) -> Attribute<'ll>;
2088    pub(crate) fn LLVMRustCreateByValAttr<'ll>(C: Context<'ll>, ty: Type<'ll>) -> Attribute<'ll>;
2089    pub(crate) fn LLVMRustCreateByRefAttr<'ll>(C: Context<'ll>, ty: Type<'ll>) -> Attribute<'ll>;
2090    pub(crate) fn LLVMRustCreateStructRetAttr<'ll>(
2091        C: Context<'ll>,
2092        ty: Type<'ll>,
2093    ) -> Attribute<'ll>;
2094    pub(crate) fn LLVMRustCreateElementTypeAttr<'ll>(
2095        C: Context<'ll>,
2096        ty: Type<'ll>,
2097    ) -> Attribute<'ll>;
2098    pub(crate) fn LLVMRustCreateUWTableAttr<'ll>(C: Context<'ll>, async_: bool) -> Attribute<'ll>;
2099    pub(crate) fn LLVMRustCreateAllocSizeAttr<'ll>(
2100        C: Context<'ll>,
2101        size_arg: u32,
2102    ) -> Attribute<'ll>;
2103    pub(crate) fn LLVMRustCreateAllocKindAttr<'ll>(
2104        C: Context<'ll>,
2105        size_arg: u64,
2106    ) -> Attribute<'ll>;
2107    pub(crate) fn LLVMRustCreateMemoryEffectsAttr<'ll>(
2108        C: Context<'ll>,
2109        effects: MemoryEffects,
2110    ) -> Attribute<'ll>;
2111    /// ## Safety
2112    /// - Each of `LowerWords` and `UpperWords` must point to an array that is
2113    ///   long enough to fully define an integer of size `NumBits`, i.e. each
2114    ///   pointer must point to `NumBits.div_ceil(64)` elements or more.
2115    /// - The implementation will make its own copy of the pointed-to `u64`
2116    ///   values, so the pointers only need to outlive this function call.
2117    pub(crate) fn LLVMRustCreateRangeAttribute<'ll>(
2118        C: Context<'ll>,
2119        NumBits: c_uint,
2120        LowerWords: *const u64,
2121        UpperWords: *const u64,
2122    ) -> Attribute<'ll>;
2123
2124    // Operations on functions
2125    pub(crate) fn LLVMRustAddFunctionAttributes<'ll>(
2126        Fn: Value<'ll>,
2127        index: c_uint,
2128        Attrs: *const Attribute<'ll>,
2129        AttrsLen: size_t,
2130    );
2131
2132    // Operations on call sites
2133    pub(crate) fn LLVMRustAddCallSiteAttributes<'ll>(
2134        Instr: Value<'ll>,
2135        index: c_uint,
2136        Attrs: *const Attribute<'ll>,
2137        AttrsLen: size_t,
2138    );
2139
2140    pub(crate) fn LLVMRustSetFastMath<'ll>(Instr: Value<'ll>);
2141    pub(crate) fn LLVMRustSetAlgebraicMath<'ll>(Instr: Value<'ll>);
2142    pub(crate) fn LLVMRustSetAllowReassoc<'ll>(Instr: Value<'ll>);
2143    pub(crate) fn LLVMRustSetNoSignedZeros<'ll>(Instr: Value<'ll>);
2144
2145    // Miscellaneous instructions
2146    pub(crate) fn LLVMRustBuildMemCpy<'ll>(
2147        B: &Builder<'ll>,
2148        Dst: Value<'ll>,
2149        DstAlign: c_uint,
2150        Src: Value<'ll>,
2151        SrcAlign: c_uint,
2152        Size: Value<'ll>,
2153        IsVolatile: bool,
2154    ) -> Value<'ll>;
2155    pub(crate) fn LLVMRustBuildMemMove<'ll>(
2156        B: &Builder<'ll>,
2157        Dst: Value<'ll>,
2158        DstAlign: c_uint,
2159        Src: Value<'ll>,
2160        SrcAlign: c_uint,
2161        Size: Value<'ll>,
2162        IsVolatile: bool,
2163    ) -> Value<'ll>;
2164    pub(crate) fn LLVMRustBuildMemSet<'ll>(
2165        B: &Builder<'ll>,
2166        Dst: Value<'ll>,
2167        DstAlign: c_uint,
2168        Val: Value<'ll>,
2169        Size: Value<'ll>,
2170        IsVolatile: bool,
2171    ) -> Value<'ll>;
2172
2173    pub(crate) fn LLVMRustBuildVScale<'ll>(B: &Builder<'ll>, Ty: Type<'ll>) -> Value<'ll>;
2174
2175    pub(crate) fn LLVMRustTimeTraceProfilerInitialize();
2176
2177    pub(crate) fn LLVMRustTimeTraceProfilerFinishThread();
2178
2179    pub(crate) fn LLVMRustTimeTraceProfilerFinish(FileName: *const c_char);
2180
2181    /// Returns a string describing the last error caused by an LLVMRust* call.
2182    pub(crate) fn LLVMRustGetLastError() -> *const c_char;
2183
2184    /// Prints the timing information collected by `-Ztime-llvm-passes`.
2185    pub(crate) fn LLVMRustPrintPassTimings(OutStr: &RustString);
2186
2187    /// Prints the statistics collected by `-Zprint-codegen-stats`.
2188    pub(crate) fn LLVMRustPrintStatistics(OutStr: &RustString);
2189
2190    /// Save the statistics collected by `-Zprint-codegen-stats-json`
2191    pub(crate) fn LLVMRustPrintStatisticsJSON(OutStr: &RustString);
2192
2193    pub(crate) fn LLVMRustInlineAsmVerify<'ll>(
2194        Ty: Type<'ll>,
2195        Constraints: *const c_uchar, // See "PTR_LEN_STR".
2196        ConstraintsLen: size_t,
2197    ) -> bool;
2198
2199    /// Append inline assembly to a module. See `Module::appendModuleInlineAsm`.
2200    pub(crate) fn LLVMRustAppendModuleInlineAsm<'ll>(
2201        M: Module<'ll>,
2202        Asm: *const c_uchar, // See "PTR_LEN_STR".
2203        AsmLen: size_t,
2204        TargetFeatures: *const c_uchar, // See "PTR_LEN_STR".
2205        TargetFeaturesLen: size_t,
2206        TargetCpu: *const c_uchar, // See "PTR_LEN_STR".
2207        TargetCpuLen: size_t,
2208    );
2209
2210    /// A list of pointer-length strings is passed as two pointer-length slices,
2211    /// one slice containing pointers and one slice containing their corresponding
2212    /// lengths. The implementation will check that both slices have the same length.
2213    pub(crate) fn LLVMRustCoverageWriteFilenamesToBuffer(
2214        Filenames: *const *const c_uchar, // See "PTR_LEN_STR".
2215        FilenamesLen: size_t,
2216        Lengths: *const size_t,
2217        LengthsLen: size_t,
2218        BufferOut: &RustString,
2219    );
2220
2221    pub(crate) fn LLVMRustCoverageWriteFunctionMappingsToBuffer(
2222        VirtualFileMappingIDs: *const c_uint,
2223        NumVirtualFileMappingIDs: size_t,
2224        Expressions: *const crate::coverageinfo::ffi::CounterExpression,
2225        NumExpressions: size_t,
2226        CodeRegions: *const crate::coverageinfo::ffi::CodeRegion,
2227        NumCodeRegions: size_t,
2228        ExpansionRegions: *const crate::coverageinfo::ffi::ExpansionRegion,
2229        NumExpansionRegions: size_t,
2230        BranchRegions: *const crate::coverageinfo::ffi::BranchRegion,
2231        NumBranchRegions: size_t,
2232        BufferOut: &RustString,
2233    );
2234
2235    pub(crate) fn LLVMRustCoverageCreatePGOFuncNameVar<'ll>(
2236        F: Value<'ll>,
2237        FuncName: *const c_uchar, // See "PTR_LEN_STR".
2238        FuncNameLen: size_t,
2239    ) -> Value<'ll>;
2240    pub(crate) fn LLVMRustCoverageHashBytes(
2241        Bytes: *const c_uchar, // See "PTR_LEN_STR".
2242        NumBytes: size_t,
2243    ) -> u64;
2244
2245    pub(crate) safe fn LLVMRustCoverageWriteCovmapSectionNameToString<'ll>(
2246        M: Module<'ll>,
2247        OutStr: &RustString,
2248    );
2249    pub(crate) safe fn LLVMRustCoverageWriteCovfunSectionNameToString<'ll>(
2250        M: Module<'ll>,
2251        OutStr: &RustString,
2252    );
2253    pub(crate) safe fn LLVMRustCoverageWriteCovmapVarNameToString(OutStr: &RustString);
2254
2255    pub(crate) safe fn LLVMRustCoverageMappingVersion() -> u32;
2256    pub(crate) fn LLVMRustDebugMetadataVersion() -> u32;
2257
2258    /// Returns the LLVM major version that the compiler was built with.
2259    ///
2260    /// Note that this is hard-coded as `LLVM_VERSION_MAJOR` when `RustWrapper.cpp` is built. This
2261    /// could be different than what the runtime LLVM library reports in [`LLVMGetVersion`], so we
2262    /// assert their equality in `configure_llvm`.
2263    pub(crate) safe fn LLVMRustVersionMajor() -> u32;
2264
2265    /// Add LLVM module flags.
2266    ///
2267    /// In order for Rust-C LTO to work, module flags must be compatible with Clang. What
2268    /// "compatible" means depends on the merge behaviors involved.
2269    pub(crate) fn LLVMRustAddModuleFlagU32<'ll>(
2270        M: Module<'ll>,
2271        MergeBehavior: ModuleFlagMergeBehavior,
2272        Name: *const c_uchar, // See "PTR_LEN_STR".
2273        NameLen: size_t,
2274        Value: u32,
2275    );
2276
2277    pub(crate) fn LLVMRustAddModuleFlagString<'ll>(
2278        M: Module<'ll>,
2279        MergeBehavior: ModuleFlagMergeBehavior,
2280        Name: *const c_uchar, // See "PTR_LEN_STR".
2281        NameLen: size_t,
2282        Value: *const c_uchar, // See "PTR_LEN_STR".
2283        ValueLen: size_t,
2284    );
2285
2286    /// We can't use LLVM-C's `LLVMDIBuilderCreateCompileUnit` because it hardcodes
2287    /// `DICompileUnit::DebugNameTableKind::Default`, but we want to be able to
2288    /// pass other values.
2289    pub(crate) fn LLVMRustDIBuilderCreateCompileUnit<'a>(
2290        Builder: &DIBuilder<'a>,
2291        Lang: c_uint,
2292        File: &'a DIFile,
2293        Producer: *const c_uchar, // See "PTR_LEN_STR".
2294        ProducerLen: size_t,
2295        isOptimized: bool,
2296        Flags: *const c_char,
2297        RuntimeVer: c_uint,
2298        SplitName: *const c_uchar, // See "PTR_LEN_STR".
2299        SplitNameLen: size_t,
2300        kind: DebugEmissionKind,
2301        DWOId: u64,
2302        SplitDebugInlining: bool,
2303        DebugInfoForProfiling: bool,
2304        DebugNameTableKind: DebugNameTableKind,
2305    ) -> &'a DIDescriptor;
2306
2307    /// We can't use LLVM-C's `LLVMDIBuilderCreateFileWithChecksum` because it
2308    /// _requires_ a checksum, but we sometimes don't provide one.
2309    pub(crate) fn LLVMRustDIBuilderCreateFile<'a>(
2310        Builder: &DIBuilder<'a>,
2311        Filename: *const c_uchar, // See "PTR_LEN_STR".
2312        FilenameLen: size_t,
2313        Directory: *const c_uchar, // See "PTR_LEN_STR".
2314        DirectoryLen: size_t,
2315        CSKind: ChecksumKind,
2316        Checksum: *const c_uchar, // See "PTR_LEN_STR".
2317        ChecksumLen: size_t,
2318        Source: *const c_uchar, // See "PTR_LEN_STR".
2319        SourceLen: size_t,
2320    ) -> &'a DIFile;
2321
2322    /// We can't use LLVM-C's `LLVMDIBuilderCreateFunction` because it only
2323    /// supports a subset of `DISubprogram::DISPFlags`.
2324    pub(crate) fn LLVMRustDIBuilderCreateFunction<'ll>(
2325        Builder: &DIBuilder<'ll>,
2326        Scope: &'ll DIDescriptor,
2327        Name: *const c_uchar, // See "PTR_LEN_STR".
2328        NameLen: size_t,
2329        LinkageName: *const c_uchar, // See "PTR_LEN_STR".
2330        LinkageNameLen: size_t,
2331        File: &'ll DIFile,
2332        LineNo: c_uint,
2333        Ty: &'ll DIType,
2334        ScopeLine: c_uint,
2335        Flags: DIFlags,
2336        SPFlags: DISPFlags,
2337        MaybeFn: Option<Value<'ll>>,
2338        TParam: &'ll DIArray,
2339        Decl: Option<&'ll DIDescriptor>,
2340    ) -> &'ll DISubprogram;
2341
2342    /// As of LLVM 22 there is no corresponding LLVM-C function.
2343    pub(crate) fn LLVMRustDIBuilderCreateMethod<'a>(
2344        Builder: &DIBuilder<'a>,
2345        Scope: &'a DIDescriptor,
2346        Name: *const c_uchar, // See "PTR_LEN_STR".
2347        NameLen: size_t,
2348        LinkageName: *const c_uchar, // See "PTR_LEN_STR".
2349        LinkageNameLen: size_t,
2350        File: &'a DIFile,
2351        LineNo: c_uint,
2352        Ty: &'a DIType,
2353        Flags: DIFlags,
2354        SPFlags: DISPFlags,
2355        TParam: &'a DIArray,
2356    ) -> &'a DISubprogram;
2357
2358    /// As of LLVM 22 there is no corresponding LLVM-C function.
2359    pub(crate) fn LLVMRustDIBuilderCreateVariantMemberType<'ll>(
2360        Builder: &DIBuilder<'ll>,
2361        Scope: &'ll DIScope,
2362        Name: *const c_uchar, // See "PTR_LEN_STR".
2363        NameLen: size_t,
2364        File: &'ll DIFile,
2365        LineNumber: c_uint,
2366        SizeInBits: u64,
2367        AlignInBits: u32,
2368        OffsetInBits: u64,
2369        Discriminant: Option<Value<'ll>>,
2370        Flags: DIFlags,
2371        Ty: &'ll DIType,
2372    ) -> &'ll DIType;
2373
2374    /// As of LLVM 22 there is no corresponding LLVM-C function.
2375    pub(crate) fn LLVMRustDIBuilderCreateEnumerationType<'a>(
2376        Builder: &DIBuilder<'a>,
2377        Scope: &'a DIScope,
2378        Name: *const c_uchar, // See "PTR_LEN_STR".
2379        NameLen: size_t,
2380        File: &'a DIFile,
2381        LineNumber: c_uint,
2382        SizeInBits: u64,
2383        AlignInBits: u32,
2384        Elements: &'a DIArray,
2385        ClassType: &'a DIType,
2386        IsScoped: bool,
2387    ) -> &'a DIType;
2388
2389    /// As of LLVM 22 there is no corresponding LLVM-C function.
2390    pub(crate) fn LLVMRustDIBuilderCreateVariantPart<'a>(
2391        Builder: &DIBuilder<'a>,
2392        Scope: &'a DIScope,
2393        Name: *const c_uchar, // See "PTR_LEN_STR".
2394        NameLen: size_t,
2395        File: &'a DIFile,
2396        LineNo: c_uint,
2397        SizeInBits: u64,
2398        AlignInBits: u32,
2399        Flags: DIFlags,
2400        Discriminator: Option<&'a DIDerivedType>,
2401        Elements: &'a DIArray,
2402        UniqueId: *const c_uchar, // See "PTR_LEN_STR".
2403        UniqueIdLen: size_t,
2404    ) -> &'a DIDerivedType;
2405
2406    /// As of LLVM 22 there is no corresponding LLVM-C function.
2407    pub(crate) fn LLVMRustDIBuilderCreateTemplateTypeParameter<'a>(
2408        Builder: &DIBuilder<'a>,
2409        Scope: Option<&'a DIScope>,
2410        Name: *const c_uchar, // See "PTR_LEN_STR".
2411        NameLen: size_t,
2412        Ty: &'a DIType,
2413    ) -> &'a DITemplateTypeParameter;
2414
2415    /// We can't use LLVM-C's `LLVMReplaceArrays` because it doesn't take a
2416    /// `Params` argument.
2417    pub(crate) fn LLVMRustDICompositeTypeReplaceArrays<'a>(
2418        Builder: &DIBuilder<'a>,
2419        CompositeType: &'a DIType,
2420        Elements: Option<&'a DIArray>,
2421        Params: Option<&'a DIArray>,
2422    );
2423
2424    /// We can't use LLVM-C's `LLVMDIBuilderGetOrCreateSubrange` because it doesn't
2425    /// call the overload that takes a `Metadata` upper bound.
2426    pub(crate) fn LLVMRustDIGetOrCreateSubrange<'a>(
2427        Builder: &DIBuilder<'a>,
2428        CountNode: Option<&'a Metadata>,
2429        LB: &'a Metadata,
2430        UB: &'a Metadata,
2431        Stride: Option<&'a Metadata>,
2432    ) -> &'a Metadata;
2433
2434    /// We can't use LLVM-C's `LLVMDIBuilderCreateVectorType` because it doesn't
2435    /// take a `BitStride` argument.
2436    pub(crate) fn LLVMRustDICreateVectorType<'a>(
2437        Builder: &DIBuilder<'a>,
2438        Size: u64,
2439        AlignInBits: u32,
2440        Type: &'a DIType,
2441        Subscripts: &'a DIArray,
2442        BitStride: Option<&'a Metadata>,
2443    ) -> &'a Metadata;
2444
2445    /// As of LLVM 22 there is no corresponding LLVM-C function.
2446    pub(crate) fn LLVMRustDILocationCloneWithBaseDiscriminator<'a>(
2447        Location: &'a DILocation,
2448        BD: c_uint,
2449    ) -> Option<&'a DILocation>;
2450
2451    pub(crate) fn LLVMRustWriteTypeToString<'ll>(Type: Type<'ll>, s: &RustString);
2452    pub(crate) fn LLVMRustWriteValueToString<'ll>(value_ref: Value<'ll>, s: &RustString);
2453
2454    pub(crate) fn LLVMRustTargetHasMnemonic(T: &TargetMachine, s: *const c_char) -> bool;
2455
2456    pub(crate) fn LLVMRustPrintTargetCPUs(TM: &TargetMachine, OutStr: &RustString);
2457    pub(crate) fn LLVMRustGetTargetFeaturesCount(T: &TargetMachine) -> size_t;
2458    pub(crate) fn LLVMRustGetTargetFeature(
2459        T: &TargetMachine,
2460        Index: size_t,
2461        Feature: &mut *const c_char,
2462        Desc: &mut *const c_char,
2463    );
2464
2465    pub(crate) fn LLVMRustGetHostCPUName(LenOut: &mut size_t) -> *const u8;
2466
2467    // This function makes copies of pointed to data, so the data's lifetime may end after this
2468    // function returns.
2469    pub(crate) fn LLVMRustCreateTargetMachine(
2470        Triple: *const c_char,
2471        CPU: *const c_char,
2472        Features: *const c_char,
2473        Abi: *const c_char,
2474        Model: CodeModel,
2475        Reloc: RelocModel,
2476        Level: CodeGenOptLevel,
2477        FloatABIType: FloatAbi,
2478        FunctionSections: bool,
2479        DataSections: bool,
2480        UniqueSectionNames: bool,
2481        TrapUnreachable: bool,
2482        Singlethread: bool,
2483        VerboseAsm: bool,
2484        EmitStackSizeSection: bool,
2485        RelaxELFRelocations: bool,
2486        UseInitArray: bool,
2487        SplitDwarfFile: *const c_char,
2488        OutputObjFile: *const c_char,
2489        DebugInfoCompression: CompressionKind,
2490        UseEmulatedTls: bool,
2491        UseWasmEH: bool,
2492        LargeDataThreshold: u64,
2493    ) -> *mut TargetMachine;
2494
2495    pub(crate) fn LLVMRustCreateMCSubtargetInfo(
2496        TripleStr: *const c_char,
2497        CPU: *const c_char,
2498        Features: *const c_char,
2499    ) -> *mut MCSubtargetInfo;
2500
2501    pub(crate) fn LLVMRustMCSubtargetInfoCheckFeatures(
2502        MCInfo: &MCSubtargetInfo,
2503        Features: *const c_uchar, // See "PTR_LEN_STR".
2504        FeaturesLen: usize,
2505    ) -> bool;
2506
2507    pub(crate) fn LLVMRustDisposeMCSubtargetInfo(MCInfo: ptr::NonNull<MCSubtargetInfo>);
2508
2509    pub(crate) fn LLVMRustWriteOutputFile<'ll>(
2510        T: &'ll TargetMachine,
2511        M: Module<'ll>,
2512        Output: *const c_char,
2513        DwoOutput: *const c_char,
2514        FileType: FileType,
2515        VerifyIR: bool,
2516        DisableSimplifyLibCalls: bool,
2517        TpdeOptions: LLVMRustTpdeOptions,
2518    ) -> LLVMRustResult;
2519    pub(crate) fn LLVMRustOptimize<'ll>(
2520        M: Module<'ll>,
2521        TM: &'ll TargetMachine,
2522        OptLevel: PassBuilderOptLevel,
2523        OptStage: OptStage,
2524        IsLinkerPluginLTO: bool,
2525        NoPrepopulatePasses: bool,
2526        VerifyIR: bool,
2527        LintIR: bool,
2528        ThinLTOBuffer: Option<&mut Option<crate::back::lto::Buffer>>,
2529        ThinLTOSummaryBuffer: Option<&mut Option<crate::back::lto::Buffer>>,
2530        MergeFunctions: bool,
2531        UnrollLoops: bool,
2532        SLPVectorize: bool,
2533        LoopVectorize: bool,
2534        DisableSimplifyLibCalls: bool,
2535        EmitLifetimeMarkers: bool,
2536        RunEnzyme: *const c_void,
2537        PrintBeforeEnzyme: bool,
2538        PrintAfterEnzyme: bool,
2539        PrintPasses: bool,
2540        SanitizerOptions: Option<&SanitizerOptions>,
2541        PGOGenPath: *const c_char,
2542        PGOUsePath: *const c_char,
2543        InstrumentCoverage: bool,
2544        InstrProfileOutput: *const c_char,
2545        PGOSampleUsePath: *const c_char,
2546        DebugInfoForProfiling: bool,
2547        llvm_selfprofiler: *mut c_void,
2548        begin_callback: SelfProfileBeforePassCallback,
2549        end_callback: SelfProfileAfterPassCallback,
2550        PostEnzymePasses: *const c_uchar, // See "PTR_LEN_STR".
2551        PostEnzymePassesLen: size_t,
2552        ExtraPasses: *const c_uchar, // See "PTR_LEN_STR".
2553        ExtraPassesLen: size_t,
2554        LLVMPlugins: *const c_uchar, // See "PTR_LEN_STR".
2555        LLVMPluginsLen: size_t,
2556    ) -> LLVMRustResult;
2557    pub(crate) fn LLVMRustPrintModule<'ll>(
2558        M: Module<'ll>,
2559        Output: *const c_char,
2560        Demangle: extern "C" fn(*const c_char, size_t, *mut c_char, size_t) -> size_t,
2561    ) -> LLVMRustResult;
2562    pub(crate) fn LLVMRustSetLLVMOptions(Argc: c_int, Argv: *const *const c_char);
2563    pub(crate) fn LLVMRustPrintPasses();
2564    pub(crate) fn LLVMRustSetNormalizedTarget<'ll>(M: Module<'ll>, triple: *const c_char);
2565    pub(crate) fn LLVMRustRunRestrictionPass<'ll>(
2566        M: Module<'ll>,
2567        syms: *const *const c_char,
2568        len: size_t,
2569    );
2570
2571    pub(crate) fn LLVMRustWriteTwineToString(T: &Twine, s: &RustString);
2572
2573    pub(crate) fn LLVMRustUnpackOptimizationDiagnostic<'ll>(
2574        DI: &'ll DiagnosticInfo,
2575        pass_name_out: &RustString,
2576        function_out: &mut Option<Value<'ll>>,
2577        loc_line_out: &mut c_uint,
2578        loc_column_out: &mut c_uint,
2579        loc_filename_out: &RustString,
2580        message_out: &RustString,
2581    );
2582
2583    pub(crate) fn LLVMRustUnpackInlineAsmDiagnostic<'a>(
2584        DI: &'a DiagnosticInfo,
2585        cookie_out: &mut u64,
2586        message_out: &mut Option<&'a Twine>,
2587    );
2588
2589    pub(crate) fn LLVMRustWriteDiagnosticInfoToString(DI: &DiagnosticInfo, s: &RustString);
2590    pub(crate) fn LLVMRustGetDiagInfoKind(DI: &DiagnosticInfo) -> DiagnosticKind;
2591    pub(crate) fn LLVMGetDiagInfoSeverity(DI: &DiagnosticInfo) -> DiagnosticSeverity;
2592
2593    pub(crate) fn LLVMRustGetSMDiagnostic<'a>(
2594        DI: &'a DiagnosticInfo,
2595        cookie_out: &mut u64,
2596    ) -> &'a SMDiagnostic;
2597
2598    pub(crate) fn LLVMRustUnpackSMDiagnostic(
2599        d: &SMDiagnostic,
2600        message_out: &RustString,
2601        buffer_out: &RustString,
2602        loc_out: &mut c_uint,
2603        ranges_out: *mut c_uint,
2604        num_ranges: &mut usize,
2605    ) -> bool;
2606
2607    pub(crate) fn LLVMRustSetDataLayoutFromTargetMachine<'ll>(M: Module<'ll>, TM: &TargetMachine);
2608
2609    pub(crate) fn LLVMRustPositionBuilderPastAllocas<'ll>(B: &Builder<'ll>, Fn: Value<'ll>);
2610    pub(crate) fn LLVMRustPositionBuilderAtStart<'a>(B: &Builder<'a>, BB: &'a BasicBlock);
2611
2612    pub(crate) fn LLVMRustSetModulePICLevel<'ll>(M: Module<'ll>);
2613    pub(crate) fn LLVMRustSetModulePIELevel<'ll>(M: Module<'ll>);
2614    pub(crate) fn LLVMRustSetModuleCodeModel<'ll>(M: Module<'ll>, Model: CodeModel);
2615    pub(crate) fn LLVMRustSetModuleLargeDataThreshold<'ll>(M: Module<'ll>, Threshold: u64);
2616    pub(crate) fn LLVMRustBufferPtr(p: &Buffer) -> *const u8;
2617    pub(crate) fn LLVMRustBufferLen(p: &Buffer) -> usize;
2618    pub(crate) fn LLVMRustBufferFree(p: &'static mut Buffer);
2619    pub(crate) fn LLVMRustModuleCost<'ll>(M: Module<'ll>) -> u64;
2620    pub(crate) fn LLVMRustModuleInstructionStats<'ll>(M: Module<'ll>) -> u64;
2621
2622    pub(crate) fn LLVMRustModuleSerialize<'ll>(
2623        M: Module<'ll>,
2624        is_thin: bool,
2625    ) -> &'static mut Buffer;
2626    pub(crate) fn LLVMRustCreateThinLTOData(
2627        Modules: *const ThinLTOModule,
2628        NumModules: size_t,
2629        PreservedSymbols: *const *const c_char,
2630        PreservedSymbolsLen: size_t,
2631    ) -> Option<&'static mut ThinLTOData>;
2632    pub(crate) fn LLVMRustPrepareThinLTORename<'ll>(
2633        Data: &ThinLTOData,
2634        Module: Module<'ll>,
2635        Target: &TargetMachine,
2636    );
2637    pub(crate) fn LLVMRustPrepareThinLTOResolveWeak<'ll>(
2638        Data: &ThinLTOData,
2639        Module: Module<'ll>,
2640    ) -> bool;
2641    pub(crate) fn LLVMRustPrepareThinLTOInternalize<'ll>(
2642        Data: &ThinLTOData,
2643        Module: Module<'ll>,
2644    ) -> bool;
2645    pub(crate) fn LLVMRustPrepareThinLTOImport<'ll>(
2646        Data: &ThinLTOData,
2647        Module: Module<'ll>,
2648        Target: &TargetMachine,
2649    ) -> bool;
2650    pub(crate) fn LLVMRustFreeThinLTOData(Data: &'static mut ThinLTOData);
2651    pub(crate) fn LLVMRustParseBitcodeForLTO<'ll>(
2652        Context: Context<'ll>,
2653        Data: *const u8,
2654        len: usize,
2655        Identifier: *const c_char,
2656    ) -> Option<Module<'ll>>;
2657
2658    pub(crate) fn LLVMRustLinkerNew<'ll>(M: Module<'ll>) -> &'ll mut Linker<'ll>;
2659    pub(crate) fn LLVMRustLinkerAdd(
2660        linker: &Linker<'_>,
2661        bytecode: *const c_uchar, // See "PTR_LEN_STR".
2662        bytecode_len: usize,
2663    ) -> bool;
2664    pub(crate) fn LLVMRustLinkerFree<'a>(linker: &'a mut Linker<'a>);
2665    pub(crate) fn LLVMRustComputeLTOCacheKey(
2666        key_out: &RustString,
2667        mod_id: *const c_char,
2668        data: &ThinLTOData,
2669    );
2670
2671    /// Removes the currently-installed `DiagnosticHandler`, and returns an owning pointer to it.
2672    pub(crate) fn LLVMRustContextTakeDiagnosticHandler<'ll>(
2673        Context: Context<'ll>,
2674    ) -> Option<ptr::NonNull<DiagnosticHandler>>;
2675
2676    /// Installs a diagnostic handler that was previously removed by
2677    /// [`LLVMRustContextTakeDiagnosticHandler`].
2678    pub(crate) fn LLVMRustContextSetDiagnosticHandler<'ll>(
2679        context: Context<'ll>,
2680        diagnostic_handler: Option<ptr::NonNull<DiagnosticHandler>>,
2681    );
2682
2683    /// Installs a custom diagnostic handler.
2684    pub(crate) fn LLVMRustContextConfigureDiagnosticHandler<'ll>(
2685        context: Context<'ll>,
2686        diagnostic_handler_callback: DiagnosticHandlerCallback,
2687        diagnostic_handler_callback_data: *mut c_void,
2688        remark_all_passes: bool,
2689        remark_passes: *const *const c_char,
2690        remark_passes_len: usize,
2691        remark_file: *const c_char,
2692        pgo_available: bool,
2693    );
2694
2695    pub(crate) fn LLVMRustGetMangledName<'ll>(V: Value<'ll>, out: &RustString);
2696
2697    pub(crate) fn LLVMRustGetElementTypeArgIndex<'ll>(CallSite: Value<'ll>) -> i32;
2698
2699    pub(crate) safe fn LLVMRustLLVMHasZlibCompression() -> bool;
2700    pub(crate) safe fn LLVMRustLLVMHasZstdCompression() -> bool;
2701
2702    pub(crate) fn LLVMRustGetSymbols(
2703        buf_ptr: *const u8,
2704        buf_len: usize,
2705        state: *mut c_void,
2706        callback: GetSymbolsCallback,
2707        error_callback: GetSymbolsErrorCallback,
2708    ) -> *mut c_void;
2709
2710    pub(crate) fn LLVMRustIs64BitSymbolicFile(buf_ptr: *const u8, buf_len: usize) -> bool;
2711
2712    pub(crate) fn LLVMRustIsECObject(buf_ptr: *const u8, buf_len: usize) -> bool;
2713
2714    pub(crate) fn LLVMRustIsAnyArm64Coff(buf_ptr: *const u8, buf_len: usize) -> bool;
2715
2716    pub(crate) fn LLVMRustSetNoSanitizeAddress<'ll>(Global: Value<'ll>);
2717    pub(crate) fn LLVMRustSetNoSanitizeHWAddress<'ll>(Global: Value<'ll>);
2718
2719    pub(crate) fn LLVMRustConstPtrAuth<'ll>(
2720        ptr: Value<'ll>,
2721        key: u32,
2722        disc: u64,
2723        addr_diversity: Option<Value<'ll>>,
2724        deactivation_symbol: Option<Value<'ll>>,
2725    ) -> Value<'ll>;
2726}