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
23use super::RustString;
24use super::debuginfo::{
25    DIArray, DIBuilder, DIDerivedType, DIDescriptor, DIFile, DIFlags, DILocation, DISPFlags,
26    DIScope, DISubprogram, DITemplateTypeParameter, DIType, DebugEmissionKind, DebugNameTableKind,
27};
28use crate::llvm::MetadataKindId;
29use crate::{TryFromU32, llvm};
30
31/// In the LLVM-C API, boolean values are passed as `typedef int LLVMBool`,
32/// which has a different ABI from Rust or C++ `bool`.
33///
34/// This wrapper does not implement `PartialEq`.
35/// To test the underlying boolean value, use [`Self::is_true`].
36#[derive(#[automatically_derived]
impl ::core::clone::Clone for Bool {
    #[inline]
    fn clone(&self) -> Bool {
        let _: ::core::clone::AssertParamIsClone<c_int>;
        *self
    }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for Bool { }Copy)]
37#[repr(transparent)]
38pub(crate) struct Bool {
39    value: c_int,
40}
41
42pub(crate) const TRUE: Bool = Bool::TRUE;
43pub(crate) const FALSE: Bool = Bool::FALSE;
44
45impl Bool {
46    pub(crate) const TRUE: Self = Self { value: 1 };
47    pub(crate) const FALSE: Self = Self { value: 0 };
48
49    pub(crate) const fn from_bool(rust_bool: bool) -> Self {
50        if rust_bool { Self::TRUE } else { Self::FALSE }
51    }
52
53    /// Converts this LLVM-C boolean to a Rust `bool`
54    pub(crate) fn is_true(self) -> bool {
55        // Since we're interacting with a C API, follow the C convention of
56        // treating any nonzero value as true.
57        self.value != Self::FALSE.value
58    }
59}
60
61impl Debug for Bool {
62    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
63        match self.value {
64            0 => f.write_str("FALSE"),
65            1 => f.write_str("TRUE"),
66            // As with `Self::is_true`, treat any nonzero value as true.
67            v => f.write_fmt(format_args!("TRUE ({0})", v))write!(f, "TRUE ({v})"),
68        }
69    }
70}
71
72/// Convenience trait to convert `bool` to `llvm::Bool` with an explicit method call.
73///
74/// Being able to write `b.to_llvm_bool()` is less noisy than `llvm::Bool::from(b)`,
75/// while being more explicit and less mistake-prone than something like `b.into()`.
76pub(crate) trait ToLlvmBool: Copy {
77    fn to_llvm_bool(self) -> llvm::Bool;
78}
79
80impl ToLlvmBool for bool {
81    #[inline(always)]
82    fn to_llvm_bool(self) -> llvm::Bool {
83        llvm::Bool::from_bool(self)
84    }
85}
86
87/// Wrapper for a raw enum value returned from LLVM's C APIs.
88///
89/// For C enums returned by LLVM, it's risky to use a Rust enum as the return
90/// type, because it would be UB if a later version of LLVM adds a new enum
91/// value and returns it. Instead, return this raw wrapper, then convert to the
92/// Rust-side enum explicitly.
93#[repr(transparent)]
94pub(crate) struct RawEnum<T> {
95    value: u32,
96    /// We don't own or consume a `T`, but we can produce one.
97    _rust_side_type: PhantomData<fn() -> T>,
98}
99
100impl<T: TryFrom<u32>> RawEnum<T> {
101    #[track_caller]
102    pub(crate) fn to_rust(self) -> T
103    where
104        T::Error: Debug,
105    {
106        // If this fails, the Rust-side enum is out of sync with LLVM's enum.
107        T::try_from(self.value).expect("enum value returned by LLVM should be known")
108    }
109}
110
111#[derive(#[automatically_derived]
#[allow(dead_code)]
impl ::core::marker::Copy for LLVMRustResult { }Copy, #[automatically_derived]
#[allow(dead_code)]
impl ::core::clone::Clone for LLVMRustResult {
    #[inline]
    fn clone(&self) -> LLVMRustResult { *self }
}Clone, #[automatically_derived]
#[allow(dead_code)]
impl ::core::cmp::PartialEq for LLVMRustResult {
    #[inline]
    fn eq(&self, other: &LLVMRustResult) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq)]
112#[repr(C)]
113#[allow(dead_code)] // Variants constructed by C++.
114pub(crate) enum LLVMRustResult {
115    Success,
116    Failure,
117}
118
119/// Must match the layout of `LLVMRustModuleFlagMergeBehavior`.
120///
121/// When merging modules (e.g. during LTO), their metadata flags are combined. Conflicts are
122/// resolved according to the merge behaviors specified here. Flags differing only in merge
123/// behavior are still considered to be in conflict.
124///
125/// In order for Rust-C LTO to work, we must specify behaviors compatible with Clang. Notably,
126/// 'Error' and 'Warning' cannot be mixed for a given flag.
127///
128/// There is a stable LLVM-C version of this enum (`LLVMModuleFlagBehavior`),
129/// but as of LLVM 19 it does not support all of the enum values in the unstable
130/// C++ API.
131#[derive(#[automatically_derived]
impl ::core::marker::Copy for ModuleFlagMergeBehavior { }Copy, #[automatically_derived]
impl ::core::clone::Clone for ModuleFlagMergeBehavior {
    #[inline]
    fn clone(&self) -> ModuleFlagMergeBehavior { *self }
}Clone, #[automatically_derived]
impl ::core::cmp::PartialEq for ModuleFlagMergeBehavior {
    #[inline]
    fn eq(&self, other: &ModuleFlagMergeBehavior) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq)]
132#[repr(C)]
133pub(crate) enum ModuleFlagMergeBehavior {
134    Error = 1,
135    Warning = 2,
136    Require = 3,
137    Override = 4,
138    Append = 5,
139    AppendUnique = 6,
140    Max = 7,
141    Min = 8,
142}
143
144// Consts for the LLVM CallConv type, pre-cast to usize.
145
146/// Must match the layout of `LLVMTailCallKind`.
147#[derive(#[automatically_derived]
#[allow(dead_code)]
impl ::core::marker::Copy for TailCallKind { }Copy, #[automatically_derived]
#[allow(dead_code)]
impl ::core::clone::Clone for TailCallKind {
    #[inline]
    fn clone(&self) -> TailCallKind { *self }
}Clone, #[automatically_derived]
#[allow(dead_code)]
impl ::core::cmp::PartialEq for TailCallKind {
    #[inline]
    fn eq(&self, other: &TailCallKind) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq, #[automatically_derived]
#[allow(dead_code)]
impl ::core::fmt::Debug for TailCallKind {
    #[inline]
    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)]
148#[repr(C)]
149#[allow(dead_code)]
150pub(crate) enum TailCallKind {
151    None = 0,
152    Tail = 1,
153    MustTail = 2,
154    NoTail = 3,
155}
156
157/// LLVM CallingConv::ID. Should we wrap this?
158///
159/// See <https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/IR/CallingConv.h>
160#[derive(#[automatically_derived]
impl ::core::marker::Copy for CallConv { }Copy, #[automatically_derived]
impl ::core::clone::Clone for CallConv {
    #[inline]
    fn clone(&self) -> CallConv { *self }
}Clone, #[automatically_derived]
impl ::core::cmp::PartialEq for CallConv {
    #[inline]
    fn eq(&self, other: &CallConv) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq, #[automatically_derived]
impl ::core::fmt::Debug for CallConv {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                CallConv::CCallConv => "CCallConv",
                CallConv::FastCallConv => "FastCallConv",
                CallConv::ColdCallConv => "ColdCallConv",
                CallConv::PreserveMost => "PreserveMost",
                CallConv::PreserveAll => "PreserveAll",
                CallConv::SwiftCallConv => "SwiftCallConv",
                CallConv::Tail => "Tail",
                CallConv::PreserveNone => "PreserveNone",
                CallConv::X86StdcallCallConv => "X86StdcallCallConv",
                CallConv::X86FastcallCallConv => "X86FastcallCallConv",
                CallConv::ArmAapcsCallConv => "ArmAapcsCallConv",
                CallConv::Msp430Intr => "Msp430Intr",
                CallConv::X86_ThisCall => "X86_ThisCall",
                CallConv::PtxKernel => "PtxKernel",
                CallConv::X86_64_SysV => "X86_64_SysV",
                CallConv::X86_64_Win64 => "X86_64_Win64",
                CallConv::X86_VectorCall => "X86_VectorCall",
                CallConv::X86_Intr => "X86_Intr",
                CallConv::AvrNonBlockingInterrupt =>
                    "AvrNonBlockingInterrupt",
                CallConv::AvrInterrupt => "AvrInterrupt",
                CallConv::AmdgpuKernel => "AmdgpuKernel",
            })
    }
}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)]
161#[repr(C)]
162pub(crate) enum CallConv {
163    CCallConv = 0,
164    FastCallConv = 8,
165    ColdCallConv = 9,
166    PreserveMost = 14,
167    PreserveAll = 15,
168    SwiftCallConv = 16,
169    Tail = 18,
170    PreserveNone = 21,
171    X86StdcallCallConv = 64,
172    X86FastcallCallConv = 65,
173    ArmAapcsCallConv = 67,
174    Msp430Intr = 69,
175    X86_ThisCall = 70,
176    PtxKernel = 71,
177    X86_64_SysV = 78,
178    X86_64_Win64 = 79,
179    X86_VectorCall = 80,
180    X86_Intr = 83,
181    AvrNonBlockingInterrupt = 84,
182    AvrInterrupt = 85,
183    AmdgpuKernel = 91,
184}
185
186/// Must match the layout of `LLVMLinkage`.
187#[derive(#[automatically_derived]
impl ::core::marker::Copy for Linkage { }Copy, #[automatically_derived]
impl ::core::clone::Clone for Linkage {
    #[inline]
    fn clone(&self) -> Linkage { *self }
}Clone, #[automatically_derived]
impl ::core::cmp::PartialEq for Linkage {
    #[inline]
    fn eq(&self, other: &Linkage) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}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)]
188#[repr(C)]
189pub(crate) enum Linkage {
190    ExternalLinkage = 0,
191    AvailableExternallyLinkage = 1,
192    LinkOnceAnyLinkage = 2,
193    LinkOnceODRLinkage = 3,
194    #[deprecated = "marked obsolete by LLVM"]
195    LinkOnceODRAutoHideLinkage = 4,
196    WeakAnyLinkage = 5,
197    WeakODRLinkage = 6,
198    AppendingLinkage = 7,
199    InternalLinkage = 8,
200    PrivateLinkage = 9,
201    #[deprecated = "marked obsolete by LLVM"]
202    DLLImportLinkage = 10,
203    #[deprecated = "marked obsolete by LLVM"]
204    DLLExportLinkage = 11,
205    ExternalWeakLinkage = 12,
206    #[deprecated = "marked obsolete by LLVM"]
207    GhostLinkage = 13,
208    CommonLinkage = 14,
209    LinkerPrivateLinkage = 15,
210    LinkerPrivateWeakLinkage = 16,
211}
212
213/// Must match the layout of `LLVMVisibility`.
214#[repr(C)]
215#[derive(#[automatically_derived]
impl ::core::marker::Copy for Visibility { }Copy, #[automatically_derived]
impl ::core::clone::Clone for Visibility {
    #[inline]
    fn clone(&self) -> Visibility { *self }
}Clone, #[automatically_derived]
impl ::core::cmp::PartialEq for Visibility {
    #[inline]
    fn eq(&self, other: &Visibility) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}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)]
216pub(crate) enum Visibility {
217    Default = 0,
218    Hidden = 1,
219    Protected = 2,
220}
221
222/// LLVMUnnamedAddr
223#[repr(C)]
224pub(crate) enum UnnamedAddr {
225    No,
226    #[expect(dead_code)]
227    Local,
228    Global,
229}
230
231/// LLVMDLLStorageClass
232#[derive(#[automatically_derived]
impl ::core::marker::Copy for DLLStorageClass { }Copy, #[automatically_derived]
impl ::core::clone::Clone for DLLStorageClass {
    #[inline]
    fn clone(&self) -> DLLStorageClass { *self }
}Clone)]
233#[repr(C)]
234pub(crate) enum DLLStorageClass {
235    #[allow(dead_code)]
236    Default = 0,
237    DllImport = 1, // Function to be imported from DLL.
238    #[allow(dead_code)]
239    DllExport = 2, // Function to be accessible from DLL.
240}
241
242/// Must match the layout of `llvm::UWTableKind`.
243#[derive(#[automatically_derived]
impl ::core::marker::Copy for UWTableKind { }Copy, #[automatically_derived]
impl ::core::clone::Clone for UWTableKind {
    #[inline]
    fn clone(&self) -> UWTableKind { *self }
}Clone)]
244#[repr(C)]
245pub(crate) enum UWTableKind {
246    /// No unwind table requested
247    None = 0,
248    /// "Synchronous" unwind tables
249    Sync = 1,
250    /// "Asynchronous" unwind tables (instr precise)
251    Async = 2,
252}
253
254/// Must match the layout of `llvm::FramePointerKind`.
255#[repr(C)]
256#[derive(#[automatically_derived]
impl ::core::marker::Copy for FramePointerKind { }Copy, #[automatically_derived]
impl ::core::clone::Clone for FramePointerKind {
    #[inline]
    fn clone(&self) -> FramePointerKind { *self }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for FramePointerKind {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                FramePointerKind::None => "None",
                FramePointerKind::NonLeaf => "NonLeaf",
                FramePointerKind::All => "All",
                FramePointerKind::Reserved => "Reserved",
                FramePointerKind::NonLeafNoReserve => "NonLeafNoReserve",
            })
    }
}Debug)]
257#[expect(dead_code, reason = "Some variants are unused, but are kept to match LLVM")]
258pub(crate) enum FramePointerKind {
259    None = 0,
260    NonLeaf = 1,
261    All = 2,
262    Reserved = 3,
263    NonLeafNoReserve = 4,
264}
265
266/// Must match the layout of `LLVMRustAttributeKind`.
267/// Semantically a subset of the C++ enum llvm::Attribute::AttrKind,
268/// though it is not ABI compatible (since it's a C++ enum)
269#[repr(C)]
270#[derive(#[automatically_derived]
impl ::core::marker::Copy for AttributeKind { }Copy, #[automatically_derived]
impl ::core::clone::Clone for AttributeKind {
    #[inline]
    fn clone(&self) -> AttributeKind { *self }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for AttributeKind {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                AttributeKind::AlwaysInline => "AlwaysInline",
                AttributeKind::ByVal => "ByVal",
                AttributeKind::Cold => "Cold",
                AttributeKind::InlineHint => "InlineHint",
                AttributeKind::MinSize => "MinSize",
                AttributeKind::Naked => "Naked",
                AttributeKind::NoAlias => "NoAlias",
                AttributeKind::CapturesAddress => "CapturesAddress",
                AttributeKind::NoInline => "NoInline",
                AttributeKind::NonNull => "NonNull",
                AttributeKind::NoRedZone => "NoRedZone",
                AttributeKind::NoReturn => "NoReturn",
                AttributeKind::NoUnwind => "NoUnwind",
                AttributeKind::OptimizeForSize => "OptimizeForSize",
                AttributeKind::ReadOnly => "ReadOnly",
                AttributeKind::SExt => "SExt",
                AttributeKind::StructRet => "StructRet",
                AttributeKind::UWTable => "UWTable",
                AttributeKind::ZExt => "ZExt",
                AttributeKind::InReg => "InReg",
                AttributeKind::SanitizeThread => "SanitizeThread",
                AttributeKind::SanitizeAddress => "SanitizeAddress",
                AttributeKind::SanitizeMemory => "SanitizeMemory",
                AttributeKind::NonLazyBind => "NonLazyBind",
                AttributeKind::OptimizeNone => "OptimizeNone",
                AttributeKind::ReadNone => "ReadNone",
                AttributeKind::SanitizeHWAddress => "SanitizeHWAddress",
                AttributeKind::WillReturn => "WillReturn",
                AttributeKind::StackProtectReq => "StackProtectReq",
                AttributeKind::StackProtectStrong => "StackProtectStrong",
                AttributeKind::StackProtect => "StackProtect",
                AttributeKind::NoUndef => "NoUndef",
                AttributeKind::SanitizeMemTag => "SanitizeMemTag",
                AttributeKind::NoCfCheck => "NoCfCheck",
                AttributeKind::ShadowCallStack => "ShadowCallStack",
                AttributeKind::AllocSize => "AllocSize",
                AttributeKind::AllocatedPointer => "AllocatedPointer",
                AttributeKind::AllocAlign => "AllocAlign",
                AttributeKind::SanitizeSafeStack => "SanitizeSafeStack",
                AttributeKind::FnRetThunkExtern => "FnRetThunkExtern",
                AttributeKind::Writable => "Writable",
                AttributeKind::DeadOnUnwind => "DeadOnUnwind",
                AttributeKind::DeadOnReturn => "DeadOnReturn",
                AttributeKind::CapturesReadOnly => "CapturesReadOnly",
                AttributeKind::CapturesNone => "CapturesNone",
                AttributeKind::SanitizeRealtimeNonblocking =>
                    "SanitizeRealtimeNonblocking",
                AttributeKind::SanitizeRealtimeBlocking =>
                    "SanitizeRealtimeBlocking",
                AttributeKind::Convergent => "Convergent",
            })
    }
}Debug)]
271#[expect(dead_code, reason = "Some variants are unused, but are kept to match the C++")]
272pub(crate) enum AttributeKind {
273    AlwaysInline = 0,
274    ByVal = 1,
275    Cold = 2,
276    InlineHint = 3,
277    MinSize = 4,
278    Naked = 5,
279    NoAlias = 6,
280    CapturesAddress = 7,
281    NoInline = 8,
282    NonNull = 9,
283    NoRedZone = 10,
284    NoReturn = 11,
285    NoUnwind = 12,
286    OptimizeForSize = 13,
287    ReadOnly = 14,
288    SExt = 15,
289    StructRet = 16,
290    UWTable = 17,
291    ZExt = 18,
292    InReg = 19,
293    SanitizeThread = 20,
294    SanitizeAddress = 21,
295    SanitizeMemory = 22,
296    NonLazyBind = 23,
297    OptimizeNone = 24,
298    ReadNone = 26,
299    SanitizeHWAddress = 28,
300    WillReturn = 29,
301    StackProtectReq = 30,
302    StackProtectStrong = 31,
303    StackProtect = 32,
304    NoUndef = 33,
305    SanitizeMemTag = 34,
306    NoCfCheck = 35,
307    ShadowCallStack = 36,
308    AllocSize = 37,
309    AllocatedPointer = 38,
310    AllocAlign = 39,
311    SanitizeSafeStack = 40,
312    FnRetThunkExtern = 41,
313    Writable = 42,
314    DeadOnUnwind = 43,
315    DeadOnReturn = 44,
316    CapturesReadOnly = 45,
317    CapturesNone = 46,
318    SanitizeRealtimeNonblocking = 47,
319    SanitizeRealtimeBlocking = 48,
320    Convergent = 49,
321}
322
323/// LLVMIntPredicate
324#[derive(#[automatically_derived]
impl ::core::marker::Copy for IntPredicate { }Copy, #[automatically_derived]
impl ::core::clone::Clone for IntPredicate {
    #[inline]
    fn clone(&self) -> IntPredicate { *self }
}Clone)]
325#[repr(C)]
326pub(crate) enum IntPredicate {
327    IntEQ = 32,
328    IntNE = 33,
329    IntUGT = 34,
330    IntUGE = 35,
331    IntULT = 36,
332    IntULE = 37,
333    IntSGT = 38,
334    IntSGE = 39,
335    IntSLT = 40,
336    IntSLE = 41,
337}
338
339/// LLVMRealPredicate
340#[derive(#[automatically_derived]
impl ::core::marker::Copy for RealPredicate { }Copy, #[automatically_derived]
impl ::core::clone::Clone for RealPredicate {
    #[inline]
    fn clone(&self) -> RealPredicate { *self }
}Clone)]
341#[repr(C)]
342pub(crate) enum RealPredicate {
343    RealPredicateFalse = 0,
344    RealOEQ = 1,
345    RealOGT = 2,
346    RealOGE = 3,
347    RealOLT = 4,
348    RealOLE = 5,
349    RealONE = 6,
350    RealORD = 7,
351    RealUNO = 8,
352    RealUEQ = 9,
353    RealUGT = 10,
354    RealUGE = 11,
355    RealULT = 12,
356    RealULE = 13,
357    RealUNE = 14,
358    RealPredicateTrue = 15,
359}
360
361/// Must match the layout of `LLVMTypeKind`.
362///
363/// Use [`RawEnum<TypeKind>`] for values of `LLVMTypeKind` returned from LLVM,
364/// to avoid risk of UB if LLVM adds new enum values.
365///
366/// All of LLVM's variants should be declared here, even if no Rust-side code refers
367/// to them, because unknown variants will cause [`RawEnum::to_rust`] to panic.
368#[derive(#[automatically_derived]
impl ::core::marker::Copy for TypeKind { }Copy, #[automatically_derived]
impl ::core::clone::Clone for TypeKind {
    #[inline]
    fn clone(&self) -> TypeKind { *self }
}Clone, #[automatically_derived]
impl ::core::cmp::PartialEq for TypeKind {
    #[inline]
    fn eq(&self, other: &TypeKind) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq, #[automatically_derived]
impl ::core::fmt::Debug for TypeKind {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                TypeKind::Void => "Void",
                TypeKind::Half => "Half",
                TypeKind::Float => "Float",
                TypeKind::Double => "Double",
                TypeKind::X86_FP80 => "X86_FP80",
                TypeKind::FP128 => "FP128",
                TypeKind::PPC_FP128 => "PPC_FP128",
                TypeKind::Label => "Label",
                TypeKind::Integer => "Integer",
                TypeKind::Function => "Function",
                TypeKind::Struct => "Struct",
                TypeKind::Array => "Array",
                TypeKind::Pointer => "Pointer",
                TypeKind::Vector => "Vector",
                TypeKind::Metadata => "Metadata",
                TypeKind::Token => "Token",
                TypeKind::ScalableVector => "ScalableVector",
                TypeKind::BFloat => "BFloat",
                TypeKind::X86_AMX => "X86_AMX",
            })
    }
}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)]
369#[repr(C)]
370pub(crate) enum TypeKind {
371    Void = 0,
372    Half = 1,
373    Float = 2,
374    Double = 3,
375    X86_FP80 = 4,
376    FP128 = 5,
377    PPC_FP128 = 6,
378    Label = 7,
379    Integer = 8,
380    Function = 9,
381    Struct = 10,
382    Array = 11,
383    Pointer = 12,
384    Vector = 13,
385    Metadata = 14,
386    Token = 16,
387    ScalableVector = 17,
388    BFloat = 18,
389    X86_AMX = 19,
390}
391
392/// LLVMAtomicRmwBinOp
393#[derive(#[automatically_derived]
impl ::core::marker::Copy for AtomicRmwBinOp { }Copy, #[automatically_derived]
impl ::core::clone::Clone for AtomicRmwBinOp {
    #[inline]
    fn clone(&self) -> AtomicRmwBinOp { *self }
}Clone)]
394#[repr(C)]
395pub(crate) enum AtomicRmwBinOp {
396    AtomicXchg = 0,
397    AtomicAdd = 1,
398    AtomicSub = 2,
399    AtomicAnd = 3,
400    AtomicNand = 4,
401    AtomicOr = 5,
402    AtomicXor = 6,
403    AtomicMax = 7,
404    AtomicMin = 8,
405    AtomicUMax = 9,
406    AtomicUMin = 10,
407}
408
409/// LLVMAtomicOrdering
410#[derive(#[automatically_derived]
impl ::core::marker::Copy for AtomicOrdering { }Copy, #[automatically_derived]
impl ::core::clone::Clone for AtomicOrdering {
    #[inline]
    fn clone(&self) -> AtomicOrdering { *self }
}Clone)]
411#[repr(C)]
412pub(crate) enum AtomicOrdering {
413    #[allow(dead_code)]
414    NotAtomic = 0,
415    #[allow(dead_code)]
416    Unordered = 1,
417    Monotonic = 2,
418    // Consume = 3,  // Not specified yet.
419    Acquire = 4,
420    Release = 5,
421    AcquireRelease = 6,
422    SequentiallyConsistent = 7,
423}
424
425/// LLVMRustFileType
426#[derive(#[automatically_derived]
impl ::core::marker::Copy for FileType { }Copy, #[automatically_derived]
impl ::core::clone::Clone for FileType {
    #[inline]
    fn clone(&self) -> FileType { *self }
}Clone)]
427#[repr(C)]
428pub(crate) enum FileType {
429    AssemblyFile,
430    ObjectFile,
431}
432
433/// Must match the layout of `LLVMInlineAsmDialect`.
434#[derive(#[automatically_derived]
impl ::core::marker::Copy for AsmDialect { }Copy, #[automatically_derived]
impl ::core::clone::Clone for AsmDialect {
    #[inline]
    fn clone(&self) -> AsmDialect { *self }
}Clone, #[automatically_derived]
impl ::core::cmp::PartialEq for AsmDialect {
    #[inline]
    fn eq(&self, other: &AsmDialect) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq)]
435#[repr(C)]
436pub(crate) enum AsmDialect {
437    Att,
438    Intel,
439}
440
441/// LLVMRustCodeGenOptLevel
442#[derive(#[automatically_derived]
impl ::core::marker::Copy for CodeGenOptLevel { }Copy, #[automatically_derived]
impl ::core::clone::Clone for CodeGenOptLevel {
    #[inline]
    fn clone(&self) -> CodeGenOptLevel { *self }
}Clone, #[automatically_derived]
impl ::core::cmp::PartialEq for CodeGenOptLevel {
    #[inline]
    fn eq(&self, other: &CodeGenOptLevel) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq)]
443#[repr(C)]
444pub(crate) enum CodeGenOptLevel {
445    None,
446    Less,
447    Default,
448    Aggressive,
449}
450
451/// LLVMRustPassBuilderOptLevel
452#[repr(C)]
453pub(crate) enum PassBuilderOptLevel {
454    O0,
455    O1,
456    O2,
457    O3,
458    Os,
459    Oz,
460}
461
462/// LLVMRustOptStage
463#[derive(#[automatically_derived]
impl ::core::cmp::PartialEq for OptStage {
    #[inline]
    fn eq(&self, other: &OptStage) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq)]
464#[repr(C)]
465pub(crate) enum OptStage {
466    PreLinkNoLTO,
467    PreLinkThinLTO,
468    PreLinkFatLTO,
469    ThinLTO,
470    FatLTO,
471}
472
473/// LLVMRustSanitizerOptions
474#[repr(C)]
475pub(crate) struct SanitizerOptions {
476    pub sanitize_address: bool,
477    pub sanitize_address_recover: bool,
478    pub sanitize_cfi: bool,
479    pub sanitize_dataflow: bool,
480    pub sanitize_dataflow_abilist: *const *const c_char,
481    pub sanitize_dataflow_abilist_len: size_t,
482    pub sanitize_kcfi: bool,
483    pub sanitize_memory: bool,
484    pub sanitize_memory_recover: bool,
485    pub sanitize_memory_track_origins: c_int,
486    pub sanitize_realtime: bool,
487    pub sanitize_thread: bool,
488    pub sanitize_hwaddress: bool,
489    pub sanitize_hwaddress_recover: bool,
490    pub sanitize_kernel_address: bool,
491    pub sanitize_kernel_address_recover: bool,
492    pub sanitize_kernel_hwaddress: bool,
493    pub sanitize_kernel_hwaddress_recover: bool,
494}
495
496/// LLVMRustRelocModel
497#[derive(#[automatically_derived]
impl ::core::marker::Copy for RelocModel { }Copy, #[automatically_derived]
impl ::core::clone::Clone for RelocModel {
    #[inline]
    fn clone(&self) -> RelocModel { *self }
}Clone, #[automatically_derived]
impl ::core::cmp::PartialEq for RelocModel {
    #[inline]
    fn eq(&self, other: &RelocModel) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq)]
498#[repr(C)]
499pub(crate) enum RelocModel {
500    Static,
501    PIC,
502    DynamicNoPic,
503    ROPI,
504    RWPI,
505    ROPI_RWPI,
506}
507
508/// LLVMRustFloatABI
509#[derive(#[automatically_derived]
impl ::core::marker::Copy for FloatAbi { }Copy, #[automatically_derived]
impl ::core::clone::Clone for FloatAbi {
    #[inline]
    fn clone(&self) -> FloatAbi { *self }
}Clone, #[automatically_derived]
impl ::core::cmp::PartialEq for FloatAbi {
    #[inline]
    fn eq(&self, other: &FloatAbi) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq)]
510#[repr(C)]
511pub(crate) enum FloatAbi {
512    Default,
513    Soft,
514    Hard,
515}
516
517/// LLVMRustCodeModel
518#[derive(#[automatically_derived]
impl ::core::marker::Copy for CodeModel { }Copy, #[automatically_derived]
impl ::core::clone::Clone for CodeModel {
    #[inline]
    fn clone(&self) -> CodeModel { *self }
}Clone)]
519#[repr(C)]
520pub(crate) enum CodeModel {
521    Tiny,
522    Small,
523    Kernel,
524    Medium,
525    Large,
526    None,
527}
528
529/// LLVMRustDiagnosticKind
530#[derive(#[automatically_derived]
#[allow(dead_code)]
impl ::core::marker::Copy for DiagnosticKind { }Copy, #[automatically_derived]
#[allow(dead_code)]
impl ::core::clone::Clone for DiagnosticKind {
    #[inline]
    fn clone(&self) -> DiagnosticKind { *self }
}Clone)]
531#[repr(C)]
532#[allow(dead_code)] // Variants constructed by C++.
533pub(crate) enum DiagnosticKind {
534    Other,
535    InlineAsm,
536    StackSize,
537    DebugMetadataVersion,
538    SampleProfile,
539    OptimizationRemark,
540    OptimizationRemarkMissed,
541    OptimizationRemarkAnalysis,
542    OptimizationRemarkAnalysisFPCommute,
543    OptimizationRemarkAnalysisAliasing,
544    OptimizationRemarkOther,
545    OptimizationFailure,
546    PGOProfile,
547    Linker,
548    Unsupported,
549    SrcMgr,
550}
551
552/// LLVMRustDiagnosticLevel
553#[derive(#[automatically_derived]
#[allow(dead_code)]
impl ::core::marker::Copy for DiagnosticLevel { }Copy, #[automatically_derived]
#[allow(dead_code)]
impl ::core::clone::Clone for DiagnosticLevel {
    #[inline]
    fn clone(&self) -> DiagnosticLevel { *self }
}Clone)]
554#[repr(C)]
555#[allow(dead_code)] // Variants constructed by C++.
556pub(crate) enum DiagnosticLevel {
557    Error,
558    Warning,
559    Note,
560    Remark,
561}
562
563unsafe extern "C" {
564    // LLVMRustThinLTOData
565    pub(crate) type ThinLTOData;
566}
567
568/// LLVMRustThinLTOModule
569#[repr(C)]
570pub(crate) struct ThinLTOModule {
571    pub identifier: *const c_char,
572    pub data: *const u8,
573    pub len: usize,
574}
575
576/// LLVMThreadLocalMode
577#[derive(#[automatically_derived]
impl ::core::marker::Copy for ThreadLocalMode { }Copy, #[automatically_derived]
impl ::core::clone::Clone for ThreadLocalMode {
    #[inline]
    fn clone(&self) -> ThreadLocalMode { *self }
}Clone)]
578#[repr(C)]
579pub(crate) enum ThreadLocalMode {
580    #[expect(dead_code)]
581    NotThreadLocal,
582    GeneralDynamic,
583    LocalDynamic,
584    InitialExec,
585    LocalExec,
586}
587
588/// LLVMRustChecksumKind
589#[derive(#[automatically_derived]
impl ::core::marker::Copy for ChecksumKind { }Copy, #[automatically_derived]
impl ::core::clone::Clone for ChecksumKind {
    #[inline]
    fn clone(&self) -> ChecksumKind { *self }
}Clone)]
590#[repr(C)]
591pub(crate) enum ChecksumKind {
592    None,
593    MD5,
594    SHA1,
595    SHA256,
596}
597
598/// LLVMRustMemoryEffects
599#[derive(#[automatically_derived]
impl ::core::marker::Copy for MemoryEffects { }Copy, #[automatically_derived]
impl ::core::clone::Clone for MemoryEffects {
    #[inline]
    fn clone(&self) -> MemoryEffects { *self }
}Clone)]
600#[repr(C)]
601pub(crate) enum MemoryEffects {
602    None,
603    ReadOnly,
604    InaccessibleMemOnly,
605    ReadOnlyNotPure,
606}
607
608/// LLVMOpcode
609#[derive(#[automatically_derived]
impl ::core::marker::Copy for Opcode { }Copy, #[automatically_derived]
impl ::core::clone::Clone for Opcode {
    #[inline]
    fn clone(&self) -> Opcode { *self }
}Clone, #[automatically_derived]
impl ::core::cmp::PartialEq for Opcode {
    #[inline]
    fn eq(&self, other: &Opcode) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for Opcode {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}Eq)]
610#[repr(C)]
611#[expect(dead_code, reason = "Some variants are unused, but are kept to match LLVM-C")]
612pub(crate) enum Opcode {
613    Ret = 1,
614    Br = 2,
615    Switch = 3,
616    IndirectBr = 4,
617    Invoke = 5,
618    Unreachable = 7,
619    CallBr = 67,
620    FNeg = 66,
621    Add = 8,
622    FAdd = 9,
623    Sub = 10,
624    FSub = 11,
625    Mul = 12,
626    FMul = 13,
627    UDiv = 14,
628    SDiv = 15,
629    FDiv = 16,
630    URem = 17,
631    SRem = 18,
632    FRem = 19,
633    Shl = 20,
634    LShr = 21,
635    AShr = 22,
636    And = 23,
637    Or = 24,
638    Xor = 25,
639    Alloca = 26,
640    Load = 27,
641    Store = 28,
642    GetElementPtr = 29,
643    Trunc = 30,
644    ZExt = 31,
645    SExt = 32,
646    FPToUI = 33,
647    FPToSI = 34,
648    UIToFP = 35,
649    SIToFP = 36,
650    FPTrunc = 37,
651    FPExt = 38,
652    PtrToInt = 39,
653    IntToPtr = 40,
654    BitCast = 41,
655    AddrSpaceCast = 60,
656    ICmp = 42,
657    FCmp = 43,
658    PHI = 44,
659    Call = 45,
660    Select = 46,
661    UserOp1 = 47,
662    UserOp2 = 48,
663    VAArg = 49,
664    ExtractElement = 50,
665    InsertElement = 51,
666    ShuffleVector = 52,
667    ExtractValue = 53,
668    InsertValue = 54,
669    Freeze = 68,
670    Fence = 55,
671    AtomicCmpXchg = 56,
672    AtomicRMW = 57,
673    Resume = 58,
674    LandingPad = 59,
675    CleanupRet = 61,
676    CatchRet = 62,
677    CatchPad = 63,
678    CleanupPad = 64,
679    CatchSwitch = 65,
680}
681
682/// Must match the layout of `LLVMRustCompressionKind`.
683#[derive(#[automatically_derived]
impl ::core::marker::Copy for CompressionKind { }Copy, #[automatically_derived]
impl ::core::clone::Clone for CompressionKind {
    #[inline]
    fn clone(&self) -> CompressionKind { *self }
}Clone)]
684#[repr(C)]
685pub(crate) enum CompressionKind {
686    None = 0,
687    Zlib = 1,
688    Zstd = 2,
689}
690
691unsafe extern "C" {
692    type Opaque;
693}
694#[repr(C)]
695struct InvariantOpaque<'a> {
696    _marker: PhantomData<&'a mut &'a ()>,
697    _opaque: Opaque,
698}
699
700// Opaque pointer types
701unsafe extern "C" {
702    pub(crate) type Module;
703    pub(crate) type Context;
704    pub(crate) type Type;
705    pub(crate) type Value;
706    pub(crate) type ConstantInt;
707    pub(crate) type Attribute;
708    pub(crate) type Metadata;
709    pub(crate) type BasicBlock;
710    pub(crate) type Comdat;
711    /// `&'ll DbgRecord` represents `LLVMDbgRecordRef`.
712    pub(crate) type DbgRecord;
713}
714#[repr(C)]
715pub(crate) struct Builder<'a>(InvariantOpaque<'a>);
716#[repr(C)]
717pub(crate) struct PassManager<'a>(InvariantOpaque<'a>);
718unsafe extern "C" {
719    pub type TargetMachine;
720}
721unsafe extern "C" {
722    pub(crate) type Twine;
723    pub(crate) type DiagnosticInfo;
724    pub(crate) type SMDiagnostic;
725}
726/// Opaque pointee of `LLVMOperandBundleRef`.
727#[repr(C)]
728pub(crate) struct OperandBundle<'a>(InvariantOpaque<'a>);
729#[repr(C)]
730pub(crate) struct Linker<'a>(InvariantOpaque<'a>);
731
732unsafe extern "C" {
733    pub(crate) type DiagnosticHandler;
734}
735
736pub(crate) type DiagnosticHandlerTy = unsafe extern "C" fn(&DiagnosticInfo, *mut c_void);
737
738pub(crate) mod debuginfo {
739    use bitflags::bitflags;
740
741    use super::{InvariantOpaque, Metadata};
742
743    /// Opaque target type for references to an LLVM debuginfo builder.
744    ///
745    /// `&'_ DIBuilder<'ll>` corresponds to `LLVMDIBuilderRef`, which is the
746    /// LLVM-C wrapper for `DIBuilder *`.
747    ///
748    /// Debuginfo builders are created and destroyed during codegen, so the
749    /// builder reference typically has a shorter lifetime than the LLVM
750    /// session (`'ll`) that it participates in.
751    #[repr(C)]
752    pub(crate) struct DIBuilder<'ll>(InvariantOpaque<'ll>);
753
754    pub(crate) type DIDescriptor = Metadata;
755    pub(crate) type DILocation = Metadata;
756    pub(crate) type DIScope = DIDescriptor;
757    pub(crate) type DIFile = DIScope;
758    pub(crate) type DILexicalBlock = DIScope;
759    pub(crate) type DISubprogram = DIScope;
760    pub(crate) type DIType = DIDescriptor;
761    pub(crate) type DIBasicType = DIType;
762    pub(crate) type DIDerivedType = DIType;
763    pub(crate) type DICompositeType = DIDerivedType;
764    pub(crate) type DIVariable = DIDescriptor;
765    pub(crate) type DIArray = DIDescriptor;
766    pub(crate) type DITemplateTypeParameter = DIDescriptor;
767
768    bitflags! {
769        /// Must match the layout of `LLVMDIFlags` in the LLVM-C API.
770        ///
771        /// Each value declared here must also be covered by the static
772        /// assertions in `RustWrapper.cpp` used by `fromRust(LLVMDIFlags)`.
773        #[repr(transparent)]
774        #[derive(#[automatically_derived]
impl ::core::clone::Clone for DIFlags {
    #[inline]
    fn clone(&self) -> DIFlags {
        let _:
                ::core::clone::AssertParamIsClone<<DIFlags as
                ::bitflags::__private::PublicFlags>::Internal>;
        *self
    }
}
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]
            fn clone(&self) -> InternalBitFlags {
                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: &InternalBitFlags) -> 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: &InternalBitFlags)
                -> ::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: &InternalBitFlags) -> ::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() }
        }
    };Clone, #[automatically_derived]
impl ::core::marker::Copy for DIFlags { }Copy, #[automatically_derived]
impl ::core::default::Default for DIFlags {
    #[inline]
    fn default() -> DIFlags { DIFlags(::core::default::Default::default()) }
}Default)]
775        pub(crate) struct DIFlags: u32 {
776            const FlagZero                = 0;
777            const FlagPrivate             = 1;
778            const FlagProtected           = 2;
779            const FlagPublic              = 3;
780            const FlagFwdDecl             = (1 << 2);
781            const FlagAppleBlock          = (1 << 3);
782            const FlagReservedBit4        = (1 << 4);
783            const FlagVirtual             = (1 << 5);
784            const FlagArtificial          = (1 << 6);
785            const FlagExplicit            = (1 << 7);
786            const FlagPrototyped          = (1 << 8);
787            const FlagObjcClassComplete   = (1 << 9);
788            const FlagObjectPointer       = (1 << 10);
789            const FlagVector              = (1 << 11);
790            const FlagStaticMember        = (1 << 12);
791            const FlagLValueReference     = (1 << 13);
792            const FlagRValueReference     = (1 << 14);
793            const FlagReserved            = (1 << 15);
794            const FlagSingleInheritance   = (1 << 16);
795            const FlagMultipleInheritance = (2 << 16);
796            const FlagVirtualInheritance  = (3 << 16);
797            const FlagIntroducedVirtual   = (1 << 18);
798            const FlagBitField            = (1 << 19);
799            const FlagNoReturn            = (1 << 20);
800            // The bit at (1 << 21) is unused, but was `LLVMDIFlagMainSubprogram`.
801            const FlagTypePassByValue     = (1 << 22);
802            const FlagTypePassByReference = (1 << 23);
803            const FlagEnumClass           = (1 << 24);
804            const FlagThunk               = (1 << 25);
805            const FlagNonTrivial          = (1 << 26);
806            const FlagBigEndian           = (1 << 27);
807            const FlagLittleEndian        = (1 << 28);
808        }
809    }
810
811    // These values **must** match with LLVMRustDISPFlags!!
812    bitflags! {
813        #[repr(transparent)]
814        #[derive(#[automatically_derived]
impl ::core::clone::Clone for DISPFlags {
    #[inline]
    fn clone(&self) -> DISPFlags {
        let _:
                ::core::clone::AssertParamIsClone<<DISPFlags as
                ::bitflags::__private::PublicFlags>::Internal>;
        *self
    }
}
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]
            fn clone(&self) -> InternalBitFlags {
                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: &InternalBitFlags) -> 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: &InternalBitFlags)
                -> ::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: &InternalBitFlags) -> ::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() }
        }
    };Clone, #[automatically_derived]
impl ::core::marker::Copy for DISPFlags { }Copy, #[automatically_derived]
impl ::core::default::Default for DISPFlags {
    #[inline]
    fn default() -> DISPFlags {
        DISPFlags(::core::default::Default::default())
    }
}Default)]
815        pub(crate) struct DISPFlags: u32 {
816            const SPFlagZero              = 0;
817            const SPFlagVirtual           = 1;
818            const SPFlagPureVirtual       = 2;
819            const SPFlagLocalToUnit       = (1 << 2);
820            const SPFlagDefinition        = (1 << 3);
821            const SPFlagOptimized         = (1 << 4);
822            const SPFlagMainSubprogram    = (1 << 5);
823        }
824    }
825
826    /// LLVMRustDebugEmissionKind
827    #[derive(#[automatically_derived]
impl ::core::marker::Copy for DebugEmissionKind { }Copy, #[automatically_derived]
impl ::core::clone::Clone for DebugEmissionKind {
    #[inline]
    fn clone(&self) -> DebugEmissionKind { *self }
}Clone)]
828    #[repr(C)]
829    pub(crate) enum DebugEmissionKind {
830        NoDebug,
831        FullDebug,
832        LineTablesOnly,
833        DebugDirectivesOnly,
834    }
835
836    /// LLVMRustDebugNameTableKind
837    #[derive(#[automatically_derived]
impl ::core::clone::Clone for DebugNameTableKind {
    #[inline]
    fn clone(&self) -> DebugNameTableKind { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for DebugNameTableKind { }Copy)]
838    #[repr(C)]
839    pub(crate) enum DebugNameTableKind {
840        Default,
841        #[expect(dead_code)]
842        Gnu,
843        None,
844    }
845}
846
847// These values **must** match with LLVMRustAllocKindFlags
848#[repr(transparent)]
pub(crate) struct AllocKindFlags(<AllocKindFlags as
    ::bitflags::__private::PublicFlags>::Internal);
#[automatically_derived]
impl ::core::default::Default for AllocKindFlags {
    #[inline]
    fn default() -> AllocKindFlags {
        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]
            fn clone(&self) -> InternalBitFlags {
                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: &InternalBitFlags) -> 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: &InternalBitFlags)
                -> ::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: &InternalBitFlags) -> ::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! {
849    #[repr(transparent)]
850    #[derive(Default)]
851    pub(crate) struct AllocKindFlags : u64 {
852        const Unknown = 0;
853        const Alloc = 1;
854        const Realloc = 1 << 1;
855        const Free = 1 << 2;
856        const Uninitialized = 1 << 3;
857        const Zeroed = 1 << 4;
858        const Aligned = 1 << 5;
859    }
860}
861
862// These values **must** match with LLVMGEPNoWrapFlags
863#[repr(transparent)]
pub struct GEPNoWrapFlags(<GEPNoWrapFlags as
    ::bitflags::__private::PublicFlags>::Internal);
#[automatically_derived]
impl ::core::default::Default for GEPNoWrapFlags {
    #[inline]
    fn default() -> GEPNoWrapFlags {
        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]
            fn clone(&self) -> InternalBitFlags {
                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: &InternalBitFlags) -> 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: &InternalBitFlags)
                -> ::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: &InternalBitFlags) -> ::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! {
864    #[repr(transparent)]
865    #[derive(Default)]
866    pub struct GEPNoWrapFlags : c_uint {
867        const InBounds = 1 << 0;
868        const NUSW = 1 << 1;
869        const NUW = 1 << 2;
870    }
871}
872
873unsafe extern "C" {
874    pub(crate) type Buffer;
875}
876
877pub(crate) type SelfProfileBeforePassCallback =
878    unsafe extern "C" fn(*mut c_void, *const c_char, *const c_char);
879pub(crate) type SelfProfileAfterPassCallback = unsafe extern "C" fn(*mut c_void);
880
881pub(crate) type GetSymbolsCallback =
882    unsafe extern "C" fn(*mut c_void, *const c_char) -> *mut c_void;
883pub(crate) type GetSymbolsErrorCallback = unsafe extern "C" fn(*const c_char) -> *mut c_void;
884
885unsafe extern "C" {
886    // Create and destroy contexts.
887    pub(crate) fn LLVMContextCreate() -> &'static mut Context;
888    pub(crate) fn LLVMContextDispose(C: &'static mut Context);
889    pub(crate) fn LLVMContextSetDiscardValueNames(C: &Context, Discard: Bool);
890    pub(crate) fn LLVMGetMDKindIDInContext(
891        C: &Context,
892        Name: *const c_char,
893        SLen: c_uint,
894    ) -> MetadataKindId;
895
896    pub(crate) fn LLVMDisposeTargetMachine(T: ptr::NonNull<TargetMachine>);
897
898    // Create modules.
899    pub(crate) fn LLVMModuleCreateWithNameInContext(
900        ModuleID: *const c_char,
901        C: &Context,
902    ) -> &Module;
903    pub(crate) safe fn LLVMCloneModule(M: &Module) -> &Module;
904
905    /// Data layout. See Module::getDataLayout.
906    pub(crate) fn LLVMGetDataLayoutStr(M: &Module) -> *const c_char;
907    pub(crate) fn LLVMSetDataLayout(M: &Module, Triple: *const c_char);
908
909    /// Append inline assembly to a module. See `Module::appendModuleInlineAsm`.
910    pub(crate) fn LLVMAppendModuleInlineAsm(
911        M: &Module,
912        Asm: *const c_uchar, // See "PTR_LEN_STR".
913        Len: size_t,
914    );
915
916    /// Create the specified uniqued inline asm string. See `InlineAsm::get()`.
917    pub(crate) fn LLVMGetInlineAsm<'ll>(
918        Ty: &'ll Type,
919        AsmString: *const c_uchar, // See "PTR_LEN_STR".
920        AsmStringSize: size_t,
921        Constraints: *const c_uchar, // See "PTR_LEN_STR".
922        ConstraintsSize: size_t,
923        HasSideEffects: llvm::Bool,
924        IsAlignStack: llvm::Bool,
925        Dialect: AsmDialect,
926        CanThrow: llvm::Bool,
927    ) -> &'ll Value;
928
929    pub(crate) safe fn LLVMGetTypeKind(Ty: &Type) -> RawEnum<TypeKind>;
930
931    // Operations on integer types
932    pub(crate) fn LLVMInt1TypeInContext(C: &Context) -> &Type;
933    pub(crate) fn LLVMInt8TypeInContext(C: &Context) -> &Type;
934    pub(crate) fn LLVMInt16TypeInContext(C: &Context) -> &Type;
935    pub(crate) fn LLVMInt32TypeInContext(C: &Context) -> &Type;
936    pub(crate) fn LLVMInt64TypeInContext(C: &Context) -> &Type;
937    pub(crate) safe fn LLVMIntTypeInContext(C: &Context, NumBits: c_uint) -> &Type;
938
939    pub(crate) fn LLVMGetIntTypeWidth(IntegerTy: &Type) -> c_uint;
940
941    // Operations on real types
942    pub(crate) fn LLVMHalfTypeInContext(C: &Context) -> &Type;
943    pub(crate) fn LLVMFloatTypeInContext(C: &Context) -> &Type;
944    pub(crate) fn LLVMDoubleTypeInContext(C: &Context) -> &Type;
945    pub(crate) fn LLVMFP128TypeInContext(C: &Context) -> &Type;
946
947    // Operations on non-IEEE real types
948    pub(crate) fn LLVMBFloatTypeInContext(C: &Context) -> &Type;
949
950    // Operations on function types
951    pub(crate) fn LLVMFunctionType<'a>(
952        ReturnType: &'a Type,
953        ParamTypes: *const &'a Type,
954        ParamCount: c_uint,
955        IsVarArg: Bool,
956    ) -> &'a Type;
957    pub(crate) fn LLVMCountParamTypes(FunctionTy: &Type) -> c_uint;
958    pub(crate) fn LLVMGetParamTypes<'a>(FunctionTy: &'a Type, Dest: *mut &'a Type);
959    pub(crate) fn LLVMGetReturnType(FunctionTy: &Type) -> &Type;
960    pub(crate) fn LLVMIsFunctionVarArg(FunctionTy: &Type) -> Bool;
961
962    // Operations on struct types
963    pub(crate) fn LLVMStructTypeInContext<'a>(
964        C: &'a Context,
965        ElementTypes: *const &'a Type,
966        ElementCount: c_uint,
967        Packed: Bool,
968    ) -> &'a Type;
969
970    // Operations on array, pointer, and vector types (sequence types)
971    pub(crate) safe fn LLVMPointerTypeInContext(C: &Context, AddressSpace: c_uint) -> &Type;
972    pub(crate) fn LLVMVectorType(ElementType: &Type, ElementCount: c_uint) -> &Type;
973    pub(crate) fn LLVMScalableVectorType(ElementType: &Type, ElementCount: c_uint) -> &Type;
974
975    pub(crate) fn LLVMGetElementType(Ty: &Type) -> &Type;
976    pub(crate) fn LLVMGetVectorSize(VectorTy: &Type) -> c_uint;
977
978    // Operations on other types
979    pub(crate) fn LLVMVoidTypeInContext(C: &Context) -> &Type;
980
981    // Operations on all values
982    pub(crate) fn LLVMTypeOf(Val: &Value) -> &Type;
983    pub(crate) fn LLVMGetValueName2(Val: &Value, Length: *mut size_t) -> *const c_char;
984    pub(crate) fn LLVMSetValueName2(Val: &Value, Name: *const c_char, NameLen: size_t);
985    pub(crate) fn LLVMReplaceAllUsesWith<'a>(OldVal: &'a Value, NewVal: &'a Value);
986    pub(crate) safe fn LLVMSetMetadata<'a>(Val: &'a Value, KindID: MetadataKindId, Node: &'a Value);
987    pub(crate) fn LLVMGlobalSetMetadata<'a>(
988        Val: &'a Value,
989        KindID: MetadataKindId,
990        Metadata: &'a Metadata,
991    );
992    pub(crate) safe fn LLVMValueAsMetadata(Node: &Value) -> &Metadata;
993
994    // Operations on constants of any type
995    pub(crate) fn LLVMConstNull(Ty: &Type) -> &Value;
996    pub(crate) fn LLVMGetUndef(Ty: &Type) -> &Value;
997    pub(crate) fn LLVMGetPoison(Ty: &Type) -> &Value;
998
999    // Operations on metadata
1000    pub(crate) fn LLVMMDStringInContext2(
1001        C: &Context,
1002        Str: *const c_char,
1003        SLen: size_t,
1004    ) -> &Metadata;
1005    pub(crate) fn LLVMMDNodeInContext2<'a>(
1006        C: &'a Context,
1007        Vals: *const &'a Metadata,
1008        Count: size_t,
1009    ) -> &'a Metadata;
1010    pub(crate) fn LLVMAddNamedMetadataOperand<'a>(
1011        M: &'a Module,
1012        Name: *const c_char,
1013        Val: &'a Value,
1014    );
1015
1016    // Operations on scalar constants
1017    pub(crate) fn LLVMConstInt(IntTy: &Type, N: c_ulonglong, SignExtend: Bool) -> &Value;
1018    pub(crate) fn LLVMConstIntOfArbitraryPrecision(
1019        IntTy: &Type,
1020        Wn: c_uint,
1021        Ws: *const u64,
1022    ) -> &Value;
1023    pub(crate) fn LLVMConstReal(RealTy: &Type, N: f64) -> &Value;
1024
1025    // Operations on composite constants
1026    pub(crate) fn LLVMConstArray2<'a>(
1027        ElementTy: &'a Type,
1028        ConstantVals: *const &'a Value,
1029        Length: u64,
1030    ) -> &'a Value;
1031    pub(crate) fn LLVMArrayType2(ElementType: &Type, ElementCount: u64) -> &Type;
1032    pub(crate) fn LLVMConstStringInContext2(
1033        C: &Context,
1034        Str: *const c_char,
1035        Length: size_t,
1036        DontNullTerminate: Bool,
1037    ) -> &Value;
1038    pub(crate) fn LLVMConstStructInContext<'a>(
1039        C: &'a Context,
1040        ConstantVals: *const &'a Value,
1041        Count: c_uint,
1042        Packed: Bool,
1043    ) -> &'a Value;
1044    pub(crate) fn LLVMConstNamedStruct<'a>(
1045        StructTy: &'a Type,
1046        ConstantVals: *const &'a Value,
1047        Count: c_uint,
1048    ) -> &'a Value;
1049    pub(crate) fn LLVMConstVector(ScalarConstantVals: *const &Value, Size: c_uint) -> &Value;
1050
1051    // Constant expressions
1052    pub(crate) fn LLVMConstInBoundsGEP2<'a>(
1053        ty: &'a Type,
1054        ConstantVal: &'a Value,
1055        ConstantIndices: *const &'a Value,
1056        NumIndices: c_uint,
1057    ) -> &'a Value;
1058    pub(crate) fn LLVMConstPtrToInt<'a>(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
1059    pub(crate) fn LLVMConstIntToPtr<'a>(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
1060    pub(crate) fn LLVMConstBitCast<'a>(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
1061    pub(crate) fn LLVMConstPointerCast<'a>(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
1062    pub(crate) fn LLVMGetAggregateElement(ConstantVal: &Value, Idx: c_uint) -> Option<&Value>;
1063    pub(crate) fn LLVMGetConstOpcode(ConstantVal: &Value) -> Opcode;
1064    pub(crate) fn LLVMIsAConstantExpr(Val: &Value) -> Option<&Value>;
1065
1066    // Operations on global variables, functions, and aliases (globals)
1067    pub(crate) fn LLVMIsDeclaration(Global: &Value) -> Bool;
1068    pub(crate) fn LLVMGetLinkage(Global: &Value) -> RawEnum<Linkage>;
1069    pub(crate) fn LLVMSetLinkage(Global: &Value, RustLinkage: Linkage);
1070    pub(crate) fn LLVMSetSection(Global: &Value, Section: *const c_char);
1071    pub(crate) fn LLVMGetVisibility(Global: &Value) -> RawEnum<Visibility>;
1072    pub(crate) fn LLVMSetVisibility(Global: &Value, Viz: Visibility);
1073    pub(crate) fn LLVMGetAlignment(Global: &Value) -> c_uint;
1074    pub(crate) fn LLVMSetAlignment(Global: &Value, Bytes: c_uint);
1075    pub(crate) fn LLVMSetDLLStorageClass(V: &Value, C: DLLStorageClass);
1076    pub(crate) fn LLVMGlobalGetValueType(Global: &Value) -> &Type;
1077
1078    // Operations on global variables
1079    pub(crate) safe fn LLVMIsAGlobalVariable(GlobalVar: &Value) -> Option<&Value>;
1080    pub(crate) fn LLVMAddGlobal<'a>(M: &'a Module, Ty: &'a Type, Name: *const c_char) -> &'a Value;
1081    pub(crate) fn LLVMGetNamedGlobal(M: &Module, Name: *const c_char) -> Option<&Value>;
1082    pub(crate) fn LLVMGetFirstGlobal(M: &Module) -> Option<&Value>;
1083    pub(crate) fn LLVMGetNextGlobal(GlobalVar: &Value) -> Option<&Value>;
1084    pub(crate) fn LLVMDeleteGlobal(GlobalVar: &Value);
1085    pub(crate) safe fn LLVMGetInitializer(GlobalVar: &Value) -> Option<&Value>;
1086    pub(crate) fn LLVMSetInitializer<'a>(GlobalVar: &'a Value, ConstantVal: &'a Value);
1087    pub(crate) safe fn LLVMIsThreadLocal(GlobalVar: &Value) -> Bool;
1088    pub(crate) fn LLVMSetThreadLocalMode(GlobalVar: &Value, Mode: ThreadLocalMode);
1089    pub(crate) safe fn LLVMIsGlobalConstant(GlobalVar: &Value) -> Bool;
1090    pub(crate) safe fn LLVMSetGlobalConstant(GlobalVar: &Value, IsConstant: Bool);
1091    pub(crate) safe fn LLVMSetTailCall(CallInst: &Value, IsTailCall: Bool);
1092    pub(crate) safe fn LLVMSetTailCallKind(CallInst: &Value, kind: TailCallKind);
1093    pub(crate) safe fn LLVMSetExternallyInitialized(GlobalVar: &Value, IsExtInit: Bool);
1094
1095    // Operations on attributes
1096    pub(crate) fn LLVMCreateStringAttribute(
1097        C: &Context,
1098        Name: *const c_char,
1099        NameLen: c_uint,
1100        Value: *const c_char,
1101        ValueLen: c_uint,
1102    ) -> &Attribute;
1103
1104    // Operations on functions
1105    pub(crate) fn LLVMSetFunctionCallConv(Fn: &Value, CC: c_uint);
1106    pub(crate) fn LLVMAddFunction<'a>(
1107        Mod: &'a Module,
1108        Name: *const c_char,
1109        FunctionTy: &'a Type,
1110    ) -> &'a Value;
1111    pub(crate) fn LLVMDeleteFunction(Fn: &Value);
1112
1113    // Operations about llvm intrinsics
1114    pub(crate) fn LLVMLookupIntrinsicID(Name: *const c_char, NameLen: size_t) -> c_uint;
1115    pub(crate) fn LLVMIntrinsicIsOverloaded(ID: NonZero<c_uint>) -> Bool;
1116    pub(crate) fn LLVMGetIntrinsicDeclaration<'a>(
1117        Mod: &'a Module,
1118        ID: NonZero<c_uint>,
1119        ParamTypes: *const &'a Type,
1120        ParamCount: size_t,
1121    ) -> &'a Value;
1122    pub(crate) fn LLVMRustUpgradeIntrinsicFunction<'a>(
1123        Fn: &'a Value,
1124        NewFn: &mut Option<&'a Value>,
1125    ) -> bool;
1126    pub(crate) fn LLVMRustIsTargetIntrinsic(ID: NonZero<c_uint>) -> bool;
1127
1128    // Operations on parameters
1129    pub(crate) fn LLVMIsAArgument(Val: &Value) -> Option<&Value>;
1130    pub(crate) safe fn LLVMCountParams(Fn: &Value) -> c_uint;
1131    pub(crate) fn LLVMGetParam(Fn: &Value, Index: c_uint) -> &Value;
1132
1133    // Operations on basic blocks
1134    pub(crate) fn LLVMGetBasicBlockParent(BB: &BasicBlock) -> &Value;
1135    pub(crate) fn LLVMAppendBasicBlockInContext<'a>(
1136        C: &'a Context,
1137        Fn: &'a Value,
1138        Name: *const c_char,
1139    ) -> &'a BasicBlock;
1140
1141    // Operations on instructions
1142    pub(crate) fn LLVMIsAInstruction(Val: &Value) -> Option<&Value>;
1143    pub(crate) fn LLVMGetFirstBasicBlock(Fn: &Value) -> &BasicBlock;
1144    pub(crate) fn LLVMGetOperand(Val: &Value, Index: c_uint) -> Option<&Value>;
1145
1146    // Operations on call sites
1147    pub(crate) fn LLVMSetInstructionCallConv(Instr: &Value, CC: c_uint);
1148
1149    // Operations on load/store instructions (only)
1150    pub(crate) fn LLVMSetVolatile(MemoryAccessInst: &Value, volatile: Bool);
1151    pub(crate) fn LLVMSetOrdering(MemoryAccessInst: &Value, Ordering: AtomicOrdering);
1152
1153    // Operations on phi nodes
1154    pub(crate) fn LLVMAddIncoming<'a>(
1155        PhiNode: &'a Value,
1156        IncomingValues: *const &'a Value,
1157        IncomingBlocks: *const &'a BasicBlock,
1158        Count: c_uint,
1159    );
1160
1161    // Instruction builders
1162    pub(crate) fn LLVMCreateBuilderInContext(C: &Context) -> &mut Builder<'_>;
1163    pub(crate) fn LLVMPositionBuilderAtEnd<'a>(Builder: &Builder<'a>, Block: &'a BasicBlock);
1164    pub(crate) fn LLVMGetInsertBlock<'a>(Builder: &Builder<'a>) -> &'a BasicBlock;
1165    pub(crate) fn LLVMDisposeBuilder<'a>(Builder: &'a mut Builder<'a>);
1166
1167    // Metadata
1168    pub(crate) fn LLVMSetCurrentDebugLocation2<'a>(Builder: &Builder<'a>, Loc: *const Metadata);
1169    pub(crate) fn LLVMGetCurrentDebugLocation2<'a>(Builder: &Builder<'a>) -> Option<&'a Metadata>;
1170
1171    // Terminators
1172    pub(crate) safe fn LLVMBuildRetVoid<'a>(B: &Builder<'a>) -> &'a Value;
1173    pub(crate) fn LLVMBuildRet<'a>(B: &Builder<'a>, V: &'a Value) -> &'a Value;
1174    pub(crate) fn LLVMBuildBr<'a>(B: &Builder<'a>, Dest: &'a BasicBlock) -> &'a Value;
1175    pub(crate) fn LLVMBuildCondBr<'a>(
1176        B: &Builder<'a>,
1177        If: &'a Value,
1178        Then: &'a BasicBlock,
1179        Else: &'a BasicBlock,
1180    ) -> &'a Value;
1181    pub(crate) fn LLVMBuildSwitch<'a>(
1182        B: &Builder<'a>,
1183        V: &'a Value,
1184        Else: &'a BasicBlock,
1185        NumCases: c_uint,
1186    ) -> &'a Value;
1187    pub(crate) fn LLVMBuildLandingPad<'a>(
1188        B: &Builder<'a>,
1189        Ty: &'a Type,
1190        PersFn: Option<&'a Value>,
1191        NumClauses: c_uint,
1192        Name: *const c_char,
1193    ) -> &'a Value;
1194    pub(crate) fn LLVMBuildResume<'a>(B: &Builder<'a>, Exn: &'a Value) -> &'a Value;
1195    pub(crate) fn LLVMBuildUnreachable<'a>(B: &Builder<'a>) -> &'a Value;
1196
1197    pub(crate) fn LLVMBuildCleanupPad<'a>(
1198        B: &Builder<'a>,
1199        ParentPad: Option<&'a Value>,
1200        Args: *const &'a Value,
1201        NumArgs: c_uint,
1202        Name: *const c_char,
1203    ) -> Option<&'a Value>;
1204    pub(crate) fn LLVMBuildCleanupRet<'a>(
1205        B: &Builder<'a>,
1206        CleanupPad: &'a Value,
1207        BB: Option<&'a BasicBlock>,
1208    ) -> Option<&'a Value>;
1209    pub(crate) fn LLVMBuildCatchPad<'a>(
1210        B: &Builder<'a>,
1211        ParentPad: &'a Value,
1212        Args: *const &'a Value,
1213        NumArgs: c_uint,
1214        Name: *const c_char,
1215    ) -> Option<&'a Value>;
1216    pub(crate) fn LLVMBuildCatchRet<'a>(
1217        B: &Builder<'a>,
1218        CatchPad: &'a Value,
1219        BB: &'a BasicBlock,
1220    ) -> Option<&'a Value>;
1221    pub(crate) fn LLVMBuildCatchSwitch<'a>(
1222        Builder: &Builder<'a>,
1223        ParentPad: Option<&'a Value>,
1224        UnwindBB: Option<&'a BasicBlock>,
1225        NumHandlers: c_uint,
1226        Name: *const c_char,
1227    ) -> Option<&'a Value>;
1228    pub(crate) fn LLVMAddHandler<'a>(CatchSwitch: &'a Value, Dest: &'a BasicBlock);
1229    pub(crate) fn LLVMSetPersonalityFn<'a>(Func: &'a Value, Pers: &'a Value);
1230
1231    // Add a case to the switch instruction
1232    pub(crate) fn LLVMAddCase<'a>(Switch: &'a Value, OnVal: &'a Value, Dest: &'a BasicBlock);
1233
1234    // Add a clause to the landing pad instruction
1235    pub(crate) fn LLVMAddClause<'a>(LandingPad: &'a Value, ClauseVal: &'a Value);
1236
1237    // Set the cleanup on a landing pad instruction
1238    pub(crate) fn LLVMSetCleanup(LandingPad: &Value, Val: Bool);
1239
1240    // Arithmetic
1241    pub(crate) fn LLVMBuildAdd<'a>(
1242        B: &Builder<'a>,
1243        LHS: &'a Value,
1244        RHS: &'a Value,
1245        Name: *const c_char,
1246    ) -> &'a Value;
1247    pub(crate) fn LLVMBuildFAdd<'a>(
1248        B: &Builder<'a>,
1249        LHS: &'a Value,
1250        RHS: &'a Value,
1251        Name: *const c_char,
1252    ) -> &'a Value;
1253    pub(crate) fn LLVMBuildSub<'a>(
1254        B: &Builder<'a>,
1255        LHS: &'a Value,
1256        RHS: &'a Value,
1257        Name: *const c_char,
1258    ) -> &'a Value;
1259    pub(crate) fn LLVMBuildFSub<'a>(
1260        B: &Builder<'a>,
1261        LHS: &'a Value,
1262        RHS: &'a Value,
1263        Name: *const c_char,
1264    ) -> &'a Value;
1265    pub(crate) fn LLVMBuildMul<'a>(
1266        B: &Builder<'a>,
1267        LHS: &'a Value,
1268        RHS: &'a Value,
1269        Name: *const c_char,
1270    ) -> &'a Value;
1271    pub(crate) fn LLVMBuildFMul<'a>(
1272        B: &Builder<'a>,
1273        LHS: &'a Value,
1274        RHS: &'a Value,
1275        Name: *const c_char,
1276    ) -> &'a Value;
1277    pub(crate) fn LLVMBuildUDiv<'a>(
1278        B: &Builder<'a>,
1279        LHS: &'a Value,
1280        RHS: &'a Value,
1281        Name: *const c_char,
1282    ) -> &'a Value;
1283    pub(crate) fn LLVMBuildExactUDiv<'a>(
1284        B: &Builder<'a>,
1285        LHS: &'a Value,
1286        RHS: &'a Value,
1287        Name: *const c_char,
1288    ) -> &'a Value;
1289    pub(crate) fn LLVMBuildSDiv<'a>(
1290        B: &Builder<'a>,
1291        LHS: &'a Value,
1292        RHS: &'a Value,
1293        Name: *const c_char,
1294    ) -> &'a Value;
1295    pub(crate) fn LLVMBuildExactSDiv<'a>(
1296        B: &Builder<'a>,
1297        LHS: &'a Value,
1298        RHS: &'a Value,
1299        Name: *const c_char,
1300    ) -> &'a Value;
1301    pub(crate) fn LLVMBuildFDiv<'a>(
1302        B: &Builder<'a>,
1303        LHS: &'a Value,
1304        RHS: &'a Value,
1305        Name: *const c_char,
1306    ) -> &'a Value;
1307    pub(crate) fn LLVMBuildURem<'a>(
1308        B: &Builder<'a>,
1309        LHS: &'a Value,
1310        RHS: &'a Value,
1311        Name: *const c_char,
1312    ) -> &'a Value;
1313    pub(crate) fn LLVMBuildSRem<'a>(
1314        B: &Builder<'a>,
1315        LHS: &'a Value,
1316        RHS: &'a Value,
1317        Name: *const c_char,
1318    ) -> &'a Value;
1319    pub(crate) fn LLVMBuildFRem<'a>(
1320        B: &Builder<'a>,
1321        LHS: &'a Value,
1322        RHS: &'a Value,
1323        Name: *const c_char,
1324    ) -> &'a Value;
1325    pub(crate) fn LLVMBuildShl<'a>(
1326        B: &Builder<'a>,
1327        LHS: &'a Value,
1328        RHS: &'a Value,
1329        Name: *const c_char,
1330    ) -> &'a Value;
1331    pub(crate) fn LLVMBuildLShr<'a>(
1332        B: &Builder<'a>,
1333        LHS: &'a Value,
1334        RHS: &'a Value,
1335        Name: *const c_char,
1336    ) -> &'a Value;
1337    pub(crate) fn LLVMBuildAShr<'a>(
1338        B: &Builder<'a>,
1339        LHS: &'a Value,
1340        RHS: &'a Value,
1341        Name: *const c_char,
1342    ) -> &'a Value;
1343    pub(crate) fn LLVMBuildNSWAdd<'a>(
1344        B: &Builder<'a>,
1345        LHS: &'a Value,
1346        RHS: &'a Value,
1347        Name: *const c_char,
1348    ) -> &'a Value;
1349    pub(crate) fn LLVMBuildNUWAdd<'a>(
1350        B: &Builder<'a>,
1351        LHS: &'a Value,
1352        RHS: &'a Value,
1353        Name: *const c_char,
1354    ) -> &'a Value;
1355    pub(crate) fn LLVMBuildNSWSub<'a>(
1356        B: &Builder<'a>,
1357        LHS: &'a Value,
1358        RHS: &'a Value,
1359        Name: *const c_char,
1360    ) -> &'a Value;
1361    pub(crate) fn LLVMBuildNUWSub<'a>(
1362        B: &Builder<'a>,
1363        LHS: &'a Value,
1364        RHS: &'a Value,
1365        Name: *const c_char,
1366    ) -> &'a Value;
1367    pub(crate) fn LLVMBuildNSWMul<'a>(
1368        B: &Builder<'a>,
1369        LHS: &'a Value,
1370        RHS: &'a Value,
1371        Name: *const c_char,
1372    ) -> &'a Value;
1373    pub(crate) fn LLVMBuildNUWMul<'a>(
1374        B: &Builder<'a>,
1375        LHS: &'a Value,
1376        RHS: &'a Value,
1377        Name: *const c_char,
1378    ) -> &'a Value;
1379    pub(crate) fn LLVMBuildAnd<'a>(
1380        B: &Builder<'a>,
1381        LHS: &'a Value,
1382        RHS: &'a Value,
1383        Name: *const c_char,
1384    ) -> &'a Value;
1385    pub(crate) fn LLVMBuildOr<'a>(
1386        B: &Builder<'a>,
1387        LHS: &'a Value,
1388        RHS: &'a Value,
1389        Name: *const c_char,
1390    ) -> &'a Value;
1391    pub(crate) fn LLVMBuildXor<'a>(
1392        B: &Builder<'a>,
1393        LHS: &'a Value,
1394        RHS: &'a Value,
1395        Name: *const c_char,
1396    ) -> &'a Value;
1397    pub(crate) fn LLVMBuildNeg<'a>(B: &Builder<'a>, V: &'a Value, Name: *const c_char)
1398    -> &'a Value;
1399    pub(crate) fn LLVMBuildFNeg<'a>(
1400        B: &Builder<'a>,
1401        V: &'a Value,
1402        Name: *const c_char,
1403    ) -> &'a Value;
1404    pub(crate) fn LLVMBuildNot<'a>(B: &Builder<'a>, V: &'a Value, Name: *const c_char)
1405    -> &'a Value;
1406
1407    // Extra flags on arithmetic
1408    pub(crate) fn LLVMSetIsDisjoint(Instr: &Value, IsDisjoint: Bool);
1409    pub(crate) fn LLVMSetNUW(ArithInst: &Value, HasNUW: Bool);
1410    pub(crate) fn LLVMSetNSW(ArithInst: &Value, HasNSW: Bool);
1411
1412    // Memory
1413    pub(crate) fn LLVMBuildAlloca<'a>(
1414        B: &Builder<'a>,
1415        Ty: &'a Type,
1416        Name: *const c_char,
1417    ) -> &'a Value;
1418    pub(crate) fn LLVMBuildLoad2<'a>(
1419        B: &Builder<'a>,
1420        Ty: &'a Type,
1421        PointerVal: &'a Value,
1422        Name: *const c_char,
1423    ) -> &'a Value;
1424
1425    pub(crate) fn LLVMBuildStore<'a>(B: &Builder<'a>, Val: &'a Value, Ptr: &'a Value) -> &'a Value;
1426
1427    pub(crate) fn LLVMBuildGEPWithNoWrapFlags<'a>(
1428        B: &Builder<'a>,
1429        Ty: &'a Type,
1430        Pointer: &'a Value,
1431        Indices: *const &'a Value,
1432        NumIndices: c_uint,
1433        Name: *const c_char,
1434        Flags: GEPNoWrapFlags,
1435    ) -> &'a Value;
1436
1437    // Casts
1438    pub(crate) fn LLVMBuildTrunc<'a>(
1439        B: &Builder<'a>,
1440        Val: &'a Value,
1441        DestTy: &'a Type,
1442        Name: *const c_char,
1443    ) -> &'a Value;
1444    pub(crate) fn LLVMBuildZExt<'a>(
1445        B: &Builder<'a>,
1446        Val: &'a Value,
1447        DestTy: &'a Type,
1448        Name: *const c_char,
1449    ) -> &'a Value;
1450    pub(crate) fn LLVMBuildSExt<'a>(
1451        B: &Builder<'a>,
1452        Val: &'a Value,
1453        DestTy: &'a Type,
1454        Name: *const c_char,
1455    ) -> &'a Value;
1456    pub(crate) fn LLVMBuildFPToUI<'a>(
1457        B: &Builder<'a>,
1458        Val: &'a Value,
1459        DestTy: &'a Type,
1460        Name: *const c_char,
1461    ) -> &'a Value;
1462    pub(crate) fn LLVMBuildFPToSI<'a>(
1463        B: &Builder<'a>,
1464        Val: &'a Value,
1465        DestTy: &'a Type,
1466        Name: *const c_char,
1467    ) -> &'a Value;
1468    pub(crate) fn LLVMBuildUIToFP<'a>(
1469        B: &Builder<'a>,
1470        Val: &'a Value,
1471        DestTy: &'a Type,
1472        Name: *const c_char,
1473    ) -> &'a Value;
1474    pub(crate) fn LLVMBuildSIToFP<'a>(
1475        B: &Builder<'a>,
1476        Val: &'a Value,
1477        DestTy: &'a Type,
1478        Name: *const c_char,
1479    ) -> &'a Value;
1480    pub(crate) fn LLVMBuildFPTrunc<'a>(
1481        B: &Builder<'a>,
1482        Val: &'a Value,
1483        DestTy: &'a Type,
1484        Name: *const c_char,
1485    ) -> &'a Value;
1486    pub(crate) fn LLVMBuildFPExt<'a>(
1487        B: &Builder<'a>,
1488        Val: &'a Value,
1489        DestTy: &'a Type,
1490        Name: *const c_char,
1491    ) -> &'a Value;
1492    pub(crate) fn LLVMBuildPtrToInt<'a>(
1493        B: &Builder<'a>,
1494        Val: &'a Value,
1495        DestTy: &'a Type,
1496        Name: *const c_char,
1497    ) -> &'a Value;
1498    pub(crate) fn LLVMBuildIntToPtr<'a>(
1499        B: &Builder<'a>,
1500        Val: &'a Value,
1501        DestTy: &'a Type,
1502        Name: *const c_char,
1503    ) -> &'a Value;
1504    pub(crate) fn LLVMBuildBitCast<'a>(
1505        B: &Builder<'a>,
1506        Val: &'a Value,
1507        DestTy: &'a Type,
1508        Name: *const c_char,
1509    ) -> &'a Value;
1510    pub(crate) fn LLVMBuildPointerCast<'a>(
1511        B: &Builder<'a>,
1512        Val: &'a Value,
1513        DestTy: &'a Type,
1514        Name: *const c_char,
1515    ) -> &'a Value;
1516    pub(crate) fn LLVMBuildIntCast2<'a>(
1517        B: &Builder<'a>,
1518        Val: &'a Value,
1519        DestTy: &'a Type,
1520        IsSigned: Bool,
1521        Name: *const c_char,
1522    ) -> &'a Value;
1523
1524    // Comparisons
1525    pub(crate) fn LLVMBuildICmp<'a>(
1526        B: &Builder<'a>,
1527        Op: c_uint,
1528        LHS: &'a Value,
1529        RHS: &'a Value,
1530        Name: *const c_char,
1531    ) -> &'a Value;
1532    pub(crate) fn LLVMBuildFCmp<'a>(
1533        B: &Builder<'a>,
1534        Op: c_uint,
1535        LHS: &'a Value,
1536        RHS: &'a Value,
1537        Name: *const c_char,
1538    ) -> &'a Value;
1539
1540    // Miscellaneous instructions
1541    pub(crate) fn LLVMBuildPhi<'a>(B: &Builder<'a>, Ty: &'a Type, Name: *const c_char)
1542    -> &'a Value;
1543    pub(crate) fn LLVMBuildSelect<'a>(
1544        B: &Builder<'a>,
1545        If: &'a Value,
1546        Then: &'a Value,
1547        Else: &'a Value,
1548        Name: *const c_char,
1549    ) -> &'a Value;
1550    pub(crate) fn LLVMBuildVAArg<'a>(
1551        B: &Builder<'a>,
1552        list: &'a Value,
1553        Ty: &'a Type,
1554        Name: *const c_char,
1555    ) -> &'a Value;
1556    pub(crate) fn LLVMBuildExtractElement<'a>(
1557        B: &Builder<'a>,
1558        VecVal: &'a Value,
1559        Index: &'a Value,
1560        Name: *const c_char,
1561    ) -> &'a Value;
1562    pub(crate) fn LLVMBuildInsertElement<'a>(
1563        B: &Builder<'a>,
1564        VecVal: &'a Value,
1565        EltVal: &'a Value,
1566        Index: &'a Value,
1567        Name: *const c_char,
1568    ) -> &'a Value;
1569    pub(crate) fn LLVMBuildShuffleVector<'a>(
1570        B: &Builder<'a>,
1571        V1: &'a Value,
1572        V2: &'a Value,
1573        Mask: &'a Value,
1574        Name: *const c_char,
1575    ) -> &'a Value;
1576    pub(crate) fn LLVMBuildExtractValue<'a>(
1577        B: &Builder<'a>,
1578        AggVal: &'a Value,
1579        Index: c_uint,
1580        Name: *const c_char,
1581    ) -> &'a Value;
1582    pub(crate) fn LLVMBuildInsertValue<'a>(
1583        B: &Builder<'a>,
1584        AggVal: &'a Value,
1585        EltVal: &'a Value,
1586        Index: c_uint,
1587        Name: *const c_char,
1588    ) -> &'a Value;
1589
1590    // Atomic Operations
1591    pub(crate) fn LLVMBuildAtomicCmpXchg<'a>(
1592        B: &Builder<'a>,
1593        LHS: &'a Value,
1594        CMP: &'a Value,
1595        RHS: &'a Value,
1596        Order: AtomicOrdering,
1597        FailureOrder: AtomicOrdering,
1598        SingleThreaded: Bool,
1599    ) -> &'a Value;
1600
1601    pub(crate) fn LLVMSetWeak(CmpXchgInst: &Value, IsWeak: Bool);
1602
1603    pub(crate) fn LLVMBuildAtomicRMW<'a>(
1604        B: &Builder<'a>,
1605        Op: AtomicRmwBinOp,
1606        LHS: &'a Value,
1607        RHS: &'a Value,
1608        Order: AtomicOrdering,
1609        SingleThreaded: Bool,
1610    ) -> &'a Value;
1611
1612    pub(crate) fn LLVMBuildFence<'a>(
1613        B: &Builder<'a>,
1614        Order: AtomicOrdering,
1615        SingleThreaded: Bool,
1616        Name: *const c_char,
1617    ) -> &'a Value;
1618
1619    /// Writes a module to the specified path. Returns 0 on success.
1620    pub(crate) fn LLVMWriteBitcodeToFile(M: &Module, Path: *const c_char) -> c_int;
1621
1622    /// Creates a legacy pass manager -- only used for final codegen.
1623    pub(crate) fn LLVMCreatePassManager<'a>() -> &'a mut PassManager<'a>;
1624
1625    pub(crate) fn LLVMAddAnalysisPasses<'a>(T: &'a TargetMachine, PM: &PassManager<'a>);
1626
1627    pub(crate) fn LLVMGetHostCPUFeatures() -> *mut c_char;
1628
1629    pub(crate) fn LLVMDisposeMessage(message: *mut c_char);
1630
1631    pub(crate) fn LLVMIsMultithreaded() -> Bool;
1632
1633    pub(crate) fn LLVMStructCreateNamed(C: &Context, Name: *const c_char) -> &Type;
1634
1635    pub(crate) fn LLVMStructSetBody<'a>(
1636        StructTy: &'a Type,
1637        ElementTypes: *const &'a Type,
1638        ElementCount: c_uint,
1639        Packed: Bool,
1640    );
1641
1642    pub(crate) fn LLVMCountStructElementTypes(StructTy: &Type) -> c_uint;
1643    pub(crate) fn LLVMGetStructElementTypes<'a>(StructTy: &'a Type, Dest: *mut &'a Type);
1644
1645    pub(crate) safe fn LLVMMetadataAsValue<'a>(C: &'a Context, MD: &'a Metadata) -> &'a Value;
1646
1647    pub(crate) safe fn LLVMSetUnnamedAddress(Global: &Value, UnnamedAddr: UnnamedAddr);
1648
1649    pub(crate) fn LLVMIsAConstantInt(value_ref: &Value) -> Option<&ConstantInt>;
1650
1651    pub(crate) fn LLVMGetOrInsertComdat(M: &Module, Name: *const c_char) -> &Comdat;
1652    pub(crate) fn LLVMSetComdat(V: &Value, C: &Comdat);
1653
1654    pub(crate) fn LLVMCreateOperandBundle(
1655        Tag: *const c_char,
1656        TagLen: size_t,
1657        Args: *const &'_ Value,
1658        NumArgs: c_uint,
1659    ) -> *mut OperandBundle<'_>;
1660    pub(crate) fn LLVMDisposeOperandBundle(Bundle: ptr::NonNull<OperandBundle<'_>>);
1661
1662    pub(crate) fn LLVMBuildCallWithOperandBundles<'a>(
1663        B: &Builder<'a>,
1664        Ty: &'a Type,
1665        Fn: &'a Value,
1666        Args: *const &'a Value,
1667        NumArgs: c_uint,
1668        Bundles: *const &OperandBundle<'a>,
1669        NumBundles: c_uint,
1670        Name: *const c_char,
1671    ) -> &'a Value;
1672    pub(crate) fn LLVMBuildInvokeWithOperandBundles<'a>(
1673        B: &Builder<'a>,
1674        Ty: &'a Type,
1675        Fn: &'a Value,
1676        Args: *const &'a Value,
1677        NumArgs: c_uint,
1678        Then: &'a BasicBlock,
1679        Catch: &'a BasicBlock,
1680        Bundles: *const &OperandBundle<'a>,
1681        NumBundles: c_uint,
1682        Name: *const c_char,
1683    ) -> &'a Value;
1684    pub(crate) fn LLVMBuildCallBr<'a>(
1685        B: &Builder<'a>,
1686        Ty: &'a Type,
1687        Fn: &'a Value,
1688        DefaultDest: &'a BasicBlock,
1689        IndirectDests: *const &'a BasicBlock,
1690        NumIndirectDests: c_uint,
1691        Args: *const &'a Value,
1692        NumArgs: c_uint,
1693        Bundles: *const &OperandBundle<'a>,
1694        NumBundles: c_uint,
1695        Name: *const c_char,
1696    ) -> &'a Value;
1697}
1698
1699#[cfg(feature = "llvm_offload")]
1700pub(crate) use self::Offload::*;
1701
1702#[cfg(feature = "llvm_offload")]
1703mod Offload {
1704    use super::*;
1705    unsafe extern "C" {
1706        /// Processes the module and writes it in an offload compatible way into a "device.bin" file.
1707        pub(crate) fn LLVMRustBundleImages<'a>(
1708            M: &'a Module,
1709            TM: &'a TargetMachine,
1710            device_bin: *const c_char,
1711        ) -> bool;
1712        pub(crate) unsafe fn LLVMRustOffloadEmbedBufferInModule<'a>(
1713            _M: &'a Module,
1714            _device_bin: *const c_char,
1715        ) -> bool;
1716        pub(crate) fn LLVMRustOffloadMapper<'a>(
1717            OldFn: &'a Value,
1718            NewFn: &'a Value,
1719            RebuiltArgs: *const &Value,
1720        );
1721    }
1722}
1723
1724#[cfg(not(feature = "llvm_offload"))]
1725pub(crate) use self::Offload_fallback::*;
1726
1727#[cfg(not(feature = "llvm_offload"))]
1728mod Offload_fallback {
1729    use super::*;
1730    /// Processes the module and writes it in an offload compatible way into a "device.bin" file.
1731    /// Marked as unsafe to match the real offload wrapper which is unsafe due to FFI.
1732    #[allow(unused_unsafe)]
1733    pub(crate) unsafe fn LLVMRustBundleImages<'a>(
1734        _M: &'a Module,
1735        _TM: &'a TargetMachine,
1736        _device_bin: *const c_char,
1737    ) -> bool {
1738        {
    ::core::panicking::panic_fmt(format_args!("not implemented: {0}",
            format_args!("This rustc version was not built with LLVM Offload support!")));
};unimplemented!("This rustc version was not built with LLVM Offload support!");
1739    }
1740    pub(crate) unsafe fn LLVMRustOffloadEmbedBufferInModule<'a>(
1741        _M: &'a Module,
1742        _device_bin: *const c_char,
1743    ) -> bool {
1744        {
    ::core::panicking::panic_fmt(format_args!("not implemented: {0}",
            format_args!("This rustc version was not built with LLVM Offload support!")));
};unimplemented!("This rustc version was not built with LLVM Offload support!");
1745    }
1746    #[allow(unused_unsafe)]
1747    pub(crate) unsafe fn LLVMRustOffloadMapper<'a>(
1748        _OldFn: &'a Value,
1749        _NewFn: &'a Value,
1750        _RebuiltArgs: *const &Value,
1751    ) {
1752        {
    ::core::panicking::panic_fmt(format_args!("not implemented: {0}",
            format_args!("This rustc version was not built with LLVM Offload support!")));
};unimplemented!("This rustc version was not built with LLVM Offload support!");
1753    }
1754}
1755
1756// FFI bindings for `DIBuilder` functions in the LLVM-C API.
1757// Try to keep these in the same order as in `llvm/include/llvm-c/DebugInfo.h`.
1758//
1759// FIXME(#134001): Audit all `Option` parameters, especially in lists, to check
1760// that they really are nullable on the C/C++ side. LLVM doesn't appear to
1761// actually document which ones are nullable.
1762unsafe extern "C" {
1763    pub(crate) fn LLVMCreateDIBuilder<'ll>(M: &'ll Module) -> *mut DIBuilder<'ll>;
1764    pub(crate) fn LLVMDisposeDIBuilder<'ll>(Builder: ptr::NonNull<DIBuilder<'ll>>);
1765
1766    pub(crate) fn LLVMDIBuilderFinalize<'ll>(Builder: &DIBuilder<'ll>);
1767
1768    pub(crate) fn LLVMDIBuilderCreateNameSpace<'ll>(
1769        Builder: &DIBuilder<'ll>,
1770        ParentScope: Option<&'ll Metadata>,
1771        Name: *const c_uchar, // See "PTR_LEN_STR".
1772        NameLen: size_t,
1773        ExportSymbols: llvm::Bool,
1774    ) -> &'ll Metadata;
1775
1776    pub(crate) fn LLVMDIBuilderCreateLexicalBlock<'ll>(
1777        Builder: &DIBuilder<'ll>,
1778        Scope: &'ll Metadata,
1779        File: &'ll Metadata,
1780        Line: c_uint,
1781        Column: c_uint,
1782    ) -> &'ll Metadata;
1783
1784    pub(crate) fn LLVMDIBuilderCreateLexicalBlockFile<'ll>(
1785        Builder: &DIBuilder<'ll>,
1786        Scope: &'ll Metadata,
1787        File: &'ll Metadata,
1788        Discriminator: c_uint, // (optional "DWARF path discriminator"; default is 0)
1789    ) -> &'ll Metadata;
1790
1791    pub(crate) fn LLVMDIBuilderCreateDebugLocation<'ll>(
1792        Ctx: &'ll Context,
1793        Line: c_uint,
1794        Column: c_uint,
1795        Scope: &'ll Metadata,
1796        InlinedAt: Option<&'ll Metadata>,
1797    ) -> &'ll Metadata;
1798
1799    pub(crate) fn LLVMDIBuilderCreateSubroutineType<'ll>(
1800        Builder: &DIBuilder<'ll>,
1801        File: Option<&'ll Metadata>, // (ignored and has no effect)
1802        ParameterTypes: *const Option<&'ll Metadata>,
1803        NumParameterTypes: c_uint,
1804        Flags: DIFlags, // (default is `DIFlags::DIFlagZero`)
1805    ) -> &'ll Metadata;
1806
1807    pub(crate) fn LLVMDIBuilderCreateEnumeratorOfArbitraryPrecision<'ll>(
1808        Builder: &DIBuilder<'ll>,
1809        Name: *const c_uchar, // See "PTR_LEN_STR".
1810        NameLen: size_t,
1811        SizeInBits: u64,
1812        Words: *const u64, // LLVM computes `NumWords = (SizeInBits + 63) / 64`.
1813        IsUnsigned: llvm::Bool,
1814    ) -> &'ll Metadata;
1815
1816    pub(crate) fn LLVMDIBuilderCreateUnionType<'ll>(
1817        Builder: &DIBuilder<'ll>,
1818        Scope: Option<&'ll Metadata>,
1819        Name: *const c_uchar, // See "PTR_LEN_STR".
1820        NameLen: size_t,
1821        File: &'ll Metadata,
1822        LineNumber: c_uint,
1823        SizeInBits: u64,
1824        AlignInBits: u32,
1825        Flags: DIFlags,
1826        Elements: *const Option<&'ll Metadata>,
1827        NumElements: c_uint,
1828        RunTimeLang: c_uint, // (optional Objective-C runtime version; default is 0)
1829        UniqueId: *const c_uchar, // See "PTR_LEN_STR".
1830        UniqueIdLen: size_t,
1831    ) -> &'ll Metadata;
1832
1833    pub(crate) fn LLVMDIBuilderCreateArrayType<'ll>(
1834        Builder: &DIBuilder<'ll>,
1835        Size: u64,
1836        Align: u32,
1837        Ty: &'ll Metadata,
1838        Subscripts: *const &'ll Metadata,
1839        NumSubscripts: c_uint,
1840    ) -> &'ll Metadata;
1841
1842    pub(crate) fn LLVMDIBuilderCreateBasicType<'ll>(
1843        Builder: &DIBuilder<'ll>,
1844        Name: *const c_uchar, // See "PTR_LEN_STR".
1845        NameLen: size_t,
1846        SizeInBits: u64,
1847        Encoding: c_uint, // (`LLVMDWARFTypeEncoding`)
1848        Flags: DIFlags,   // (default is `DIFlags::DIFlagZero`)
1849    ) -> &'ll Metadata;
1850
1851    pub(crate) fn LLVMDIBuilderCreatePointerType<'ll>(
1852        Builder: &DIBuilder<'ll>,
1853        PointeeTy: &'ll Metadata,
1854        SizeInBits: u64,
1855        AlignInBits: u32,
1856        AddressSpace: c_uint, // (optional DWARF address space; default is 0)
1857        Name: *const c_uchar, // See "PTR_LEN_STR".
1858        NameLen: size_t,
1859    ) -> &'ll Metadata;
1860
1861    pub(crate) fn LLVMDIBuilderCreateStructType<'ll>(
1862        Builder: &DIBuilder<'ll>,
1863        Scope: Option<&'ll Metadata>,
1864        Name: *const c_uchar, // See "PTR_LEN_STR".
1865        NameLen: size_t,
1866        File: &'ll Metadata,
1867        LineNumber: c_uint,
1868        SizeInBits: u64,
1869        AlignInBits: u32,
1870        Flags: DIFlags,
1871        DerivedFrom: Option<&'ll Metadata>,
1872        Elements: *const Option<&'ll Metadata>,
1873        NumElements: c_uint,
1874        RunTimeLang: c_uint, // (optional Objective-C runtime version; default is 0)
1875        VTableHolder: Option<&'ll Metadata>,
1876        UniqueId: *const c_uchar, // See "PTR_LEN_STR".
1877        UniqueIdLen: size_t,
1878    ) -> &'ll Metadata;
1879
1880    pub(crate) fn LLVMDIBuilderCreateMemberType<'ll>(
1881        Builder: &DIBuilder<'ll>,
1882        Scope: &'ll Metadata,
1883        Name: *const c_uchar, // See "PTR_LEN_STR".
1884        NameLen: size_t,
1885        File: &'ll Metadata,
1886        LineNo: c_uint,
1887        SizeInBits: u64,
1888        AlignInBits: u32,
1889        OffsetInBits: u64,
1890        Flags: DIFlags,
1891        Ty: &'ll Metadata,
1892    ) -> &'ll Metadata;
1893
1894    pub(crate) fn LLVMDIBuilderCreateStaticMemberType<'ll>(
1895        Builder: &DIBuilder<'ll>,
1896        Scope: &'ll Metadata,
1897        Name: *const c_uchar, // See "PTR_LEN_STR".
1898        NameLen: size_t,
1899        File: &'ll Metadata,
1900        LineNumber: c_uint,
1901        Type: &'ll Metadata,
1902        Flags: DIFlags,
1903        ConstantVal: Option<&'ll Value>,
1904        AlignInBits: u32,
1905    ) -> &'ll Metadata;
1906
1907    /// Creates a "qualified type" in the C/C++ sense, by adding modifiers
1908    /// like `const` or `volatile`.
1909    pub(crate) fn LLVMDIBuilderCreateQualifiedType<'ll>(
1910        Builder: &DIBuilder<'ll>,
1911        Tag: c_uint, // (DWARF tag, e.g. `DW_TAG_const_type`)
1912        Type: &'ll Metadata,
1913    ) -> &'ll Metadata;
1914
1915    pub(crate) fn LLVMDIBuilderCreateTypedef<'ll>(
1916        Builder: &DIBuilder<'ll>,
1917        Type: &'ll Metadata,
1918        Name: *const c_uchar, // See "PTR_LEN_STR".
1919        NameLen: size_t,
1920        File: &'ll Metadata,
1921        LineNo: c_uint,
1922        Scope: Option<&'ll Metadata>,
1923        AlignInBits: u32, // (optional; default is 0)
1924    ) -> &'ll Metadata;
1925
1926    pub(crate) fn LLVMDIBuilderGetOrCreateSubrange<'ll>(
1927        Builder: &DIBuilder<'ll>,
1928        LowerBound: i64,
1929        Count: i64,
1930    ) -> &'ll Metadata;
1931
1932    pub(crate) fn LLVMDIBuilderGetOrCreateArray<'ll>(
1933        Builder: &DIBuilder<'ll>,
1934        Data: *const Option<&'ll Metadata>,
1935        NumElements: size_t,
1936    ) -> &'ll Metadata;
1937
1938    pub(crate) fn LLVMDIBuilderCreateExpression<'ll>(
1939        Builder: &DIBuilder<'ll>,
1940        Addr: *const u64,
1941        Length: size_t,
1942    ) -> &'ll Metadata;
1943
1944    pub(crate) fn LLVMDIBuilderCreateGlobalVariableExpression<'ll>(
1945        Builder: &DIBuilder<'ll>,
1946        Scope: Option<&'ll Metadata>,
1947        Name: *const c_uchar, // See "PTR_LEN_STR".
1948        NameLen: size_t,
1949        Linkage: *const c_uchar, // See "PTR_LEN_STR".
1950        LinkLen: size_t,
1951        File: &'ll Metadata,
1952        LineNo: c_uint,
1953        Ty: &'ll Metadata,
1954        LocalToUnit: llvm::Bool,
1955        Expr: &'ll Metadata,
1956        Decl: Option<&'ll Metadata>,
1957        AlignInBits: u32,
1958    ) -> &'ll Metadata;
1959
1960    pub(crate) fn LLVMDIBuilderInsertDeclareRecordAtEnd<'ll>(
1961        Builder: &DIBuilder<'ll>,
1962        Storage: &'ll Value,
1963        VarInfo: &'ll Metadata,
1964        Expr: &'ll Metadata,
1965        DebugLoc: &'ll Metadata,
1966        Block: &'ll BasicBlock,
1967    ) -> &'ll DbgRecord;
1968
1969    pub(crate) fn LLVMDIBuilderInsertDbgValueRecordAtEnd<'ll>(
1970        Builder: &DIBuilder<'ll>,
1971        Val: &'ll Value,
1972        VarInfo: &'ll Metadata,
1973        Expr: &'ll Metadata,
1974        DebugLoc: &'ll Metadata,
1975        Block: &'ll BasicBlock,
1976    ) -> &'ll DbgRecord;
1977
1978    pub(crate) fn LLVMDIBuilderCreateAutoVariable<'ll>(
1979        Builder: &DIBuilder<'ll>,
1980        Scope: &'ll Metadata,
1981        Name: *const c_uchar, // See "PTR_LEN_STR".
1982        NameLen: size_t,
1983        File: &'ll Metadata,
1984        LineNo: c_uint,
1985        Ty: &'ll Metadata,
1986        AlwaysPreserve: llvm::Bool, // "If true, this descriptor will survive optimizations."
1987        Flags: DIFlags,
1988        AlignInBits: u32,
1989    ) -> &'ll Metadata;
1990
1991    pub(crate) fn LLVMDIBuilderCreateParameterVariable<'ll>(
1992        Builder: &DIBuilder<'ll>,
1993        Scope: &'ll Metadata,
1994        Name: *const c_uchar, // See "PTR_LEN_STR".
1995        NameLen: size_t,
1996        ArgNo: c_uint,
1997        File: &'ll Metadata,
1998        LineNo: c_uint,
1999        Ty: &'ll Metadata,
2000        AlwaysPreserve: llvm::Bool, // "If true, this descriptor will survive optimizations."
2001        Flags: DIFlags,
2002    ) -> &'ll Metadata;
2003}
2004
2005#[link(name = "llvm-wrapper", kind = "static")]
2006unsafe extern "C" {
2007    pub(crate) fn LLVMRustInstallErrorHandlers();
2008    pub(crate) fn LLVMRustDisableSystemDialogsOnCrash();
2009
2010    // Operations on all values
2011    /// FIXME: After dropping LLVM 21, migrate to LLVM-C's `LLVMGlobalAddMetadata`.
2012    pub(crate) fn LLVMRustGlobalAddMetadata<'a>(
2013        Val: &'a Value,
2014        KindID: MetadataKindId,
2015        Metadata: &'a Metadata,
2016    );
2017    pub(crate) fn LLVMRustIsNonGVFunctionPointerTy(Val: &Value) -> bool;
2018    pub(crate) fn LLVMRustStripPointerCasts<'a>(Val: &'a Value) -> &'a Value;
2019
2020    // Operations on scalar constants
2021    pub(crate) fn LLVMRustConstIntGetZExtValue(ConstantVal: &ConstantInt, Value: &mut u64) -> bool;
2022    pub(crate) fn LLVMRustConstInt128Get(
2023        ConstantVal: &ConstantInt,
2024        SExt: bool,
2025        high: &mut u64,
2026        low: &mut u64,
2027    ) -> bool;
2028
2029    // Operations on global variables, functions, and aliases (globals)
2030    pub(crate) fn LLVMRustSetDSOLocal(Global: &Value, is_dso_local: bool);
2031
2032    // Operations on global variables
2033    pub(crate) fn LLVMRustGetOrInsertGlobal<'a>(
2034        M: &'a Module,
2035        Name: *const c_char,
2036        NameLen: size_t,
2037        T: &'a Type,
2038    ) -> &'a Value;
2039    pub(crate) fn LLVMRustGetOrInsertGlobalInAddrspace<'a>(
2040        M: &'a Module,
2041        Name: *const c_char,
2042        NameLen: size_t,
2043        T: &'a Type,
2044        AddressSpace: c_uint,
2045    ) -> &'a Value;
2046    pub(crate) fn LLVMRustGetNamedValue(
2047        M: &Module,
2048        Name: *const c_char,
2049        NameLen: size_t,
2050    ) -> Option<&Value>;
2051
2052    // Operations on attributes
2053    pub(crate) fn LLVMRustCreateAttrNoValue(C: &Context, attr: AttributeKind) -> &Attribute;
2054    pub(crate) fn LLVMRustCreateAlignmentAttr(C: &Context, bytes: u64) -> &Attribute;
2055    pub(crate) fn LLVMRustCreateDereferenceableAttr(C: &Context, bytes: u64) -> &Attribute;
2056    pub(crate) fn LLVMRustCreateDereferenceableOrNullAttr(C: &Context, bytes: u64) -> &Attribute;
2057    pub(crate) fn LLVMRustCreateByValAttr<'a>(C: &'a Context, ty: &'a Type) -> &'a Attribute;
2058    pub(crate) fn LLVMRustCreateStructRetAttr<'a>(C: &'a Context, ty: &'a Type) -> &'a Attribute;
2059    pub(crate) fn LLVMRustCreateElementTypeAttr<'a>(C: &'a Context, ty: &'a Type) -> &'a Attribute;
2060    pub(crate) fn LLVMRustCreateUWTableAttr(C: &Context, async_: bool) -> &Attribute;
2061    pub(crate) fn LLVMRustCreateAllocSizeAttr(C: &Context, size_arg: u32) -> &Attribute;
2062    pub(crate) fn LLVMRustCreateAllocKindAttr(C: &Context, size_arg: u64) -> &Attribute;
2063    pub(crate) fn LLVMRustCreateMemoryEffectsAttr(
2064        C: &Context,
2065        effects: MemoryEffects,
2066    ) -> &Attribute;
2067    /// ## Safety
2068    /// - Each of `LowerWords` and `UpperWords` must point to an array that is
2069    ///   long enough to fully define an integer of size `NumBits`, i.e. each
2070    ///   pointer must point to `NumBits.div_ceil(64)` elements or more.
2071    /// - The implementation will make its own copy of the pointed-to `u64`
2072    ///   values, so the pointers only need to outlive this function call.
2073    pub(crate) fn LLVMRustCreateRangeAttribute(
2074        C: &Context,
2075        NumBits: c_uint,
2076        LowerWords: *const u64,
2077        UpperWords: *const u64,
2078    ) -> &Attribute;
2079
2080    // Operations on functions
2081    /// FIXME: After dropping LLVM 21, migrate to LLVM-C's `LLVMGetOrInsertFunction`.
2082    pub(crate) fn LLVMRustGetOrInsertFunction<'a>(
2083        M: &'a Module,
2084        Name: *const c_char,
2085        NameLen: size_t,
2086        FunctionTy: &'a Type,
2087    ) -> &'a Value;
2088    pub(crate) fn LLVMRustAddFunctionAttributes<'a>(
2089        Fn: &'a Value,
2090        index: c_uint,
2091        Attrs: *const &'a Attribute,
2092        AttrsLen: size_t,
2093    );
2094
2095    // Operations on call sites
2096    pub(crate) fn LLVMRustAddCallSiteAttributes<'a>(
2097        Instr: &'a Value,
2098        index: c_uint,
2099        Attrs: *const &'a Attribute,
2100        AttrsLen: size_t,
2101    );
2102
2103    pub(crate) fn LLVMRustSetFastMath(Instr: &Value);
2104    pub(crate) fn LLVMRustSetAlgebraicMath(Instr: &Value);
2105    pub(crate) fn LLVMRustSetAllowReassoc(Instr: &Value);
2106    pub(crate) fn LLVMRustSetNoSignedZeros(Instr: &Value);
2107
2108    // Miscellaneous instructions
2109    pub(crate) fn LLVMRustBuildMemCpy<'a>(
2110        B: &Builder<'a>,
2111        Dst: &'a Value,
2112        DstAlign: c_uint,
2113        Src: &'a Value,
2114        SrcAlign: c_uint,
2115        Size: &'a Value,
2116        IsVolatile: bool,
2117    ) -> &'a Value;
2118    pub(crate) fn LLVMRustBuildMemMove<'a>(
2119        B: &Builder<'a>,
2120        Dst: &'a Value,
2121        DstAlign: c_uint,
2122        Src: &'a Value,
2123        SrcAlign: c_uint,
2124        Size: &'a Value,
2125        IsVolatile: bool,
2126    ) -> &'a Value;
2127    pub(crate) fn LLVMRustBuildMemSet<'a>(
2128        B: &Builder<'a>,
2129        Dst: &'a Value,
2130        DstAlign: c_uint,
2131        Val: &'a Value,
2132        Size: &'a Value,
2133        IsVolatile: bool,
2134    ) -> &'a Value;
2135
2136    pub(crate) fn LLVMRustTimeTraceProfilerInitialize();
2137
2138    pub(crate) fn LLVMRustTimeTraceProfilerFinishThread();
2139
2140    pub(crate) fn LLVMRustTimeTraceProfilerFinish(FileName: *const c_char);
2141
2142    /// Returns a string describing the last error caused by an LLVMRust* call.
2143    pub(crate) fn LLVMRustGetLastError() -> *const c_char;
2144
2145    /// Prints the timing information collected by `-Ztime-llvm-passes`.
2146    pub(crate) fn LLVMRustPrintPassTimings(OutStr: &RustString);
2147
2148    /// Prints the statistics collected by `-Zprint-codegen-stats`.
2149    pub(crate) fn LLVMRustPrintStatistics(OutStr: &RustString);
2150
2151    /// Save the statistics collected by `-Zprint-codegen-stats-json`
2152    pub(crate) fn LLVMRustPrintStatisticsJSON(OutStr: &RustString);
2153
2154    pub(crate) fn LLVMRustInlineAsmVerify(
2155        Ty: &Type,
2156        Constraints: *const c_uchar, // See "PTR_LEN_STR".
2157        ConstraintsLen: size_t,
2158    ) -> bool;
2159
2160    /// A list of pointer-length strings is passed as two pointer-length slices,
2161    /// one slice containing pointers and one slice containing their corresponding
2162    /// lengths. The implementation will check that both slices have the same length.
2163    pub(crate) fn LLVMRustCoverageWriteFilenamesToBuffer(
2164        Filenames: *const *const c_uchar, // See "PTR_LEN_STR".
2165        FilenamesLen: size_t,
2166        Lengths: *const size_t,
2167        LengthsLen: size_t,
2168        BufferOut: &RustString,
2169    );
2170
2171    pub(crate) fn LLVMRustCoverageWriteFunctionMappingsToBuffer(
2172        VirtualFileMappingIDs: *const c_uint,
2173        NumVirtualFileMappingIDs: size_t,
2174        Expressions: *const crate::coverageinfo::ffi::CounterExpression,
2175        NumExpressions: size_t,
2176        CodeRegions: *const crate::coverageinfo::ffi::CodeRegion,
2177        NumCodeRegions: size_t,
2178        ExpansionRegions: *const crate::coverageinfo::ffi::ExpansionRegion,
2179        NumExpansionRegions: size_t,
2180        BranchRegions: *const crate::coverageinfo::ffi::BranchRegion,
2181        NumBranchRegions: size_t,
2182        BufferOut: &RustString,
2183    );
2184
2185    pub(crate) fn LLVMRustCoverageCreatePGOFuncNameVar(
2186        F: &Value,
2187        FuncName: *const c_uchar, // See "PTR_LEN_STR".
2188        FuncNameLen: size_t,
2189    ) -> &Value;
2190    pub(crate) fn LLVMRustCoverageHashBytes(
2191        Bytes: *const c_uchar, // See "PTR_LEN_STR".
2192        NumBytes: size_t,
2193    ) -> u64;
2194
2195    pub(crate) safe fn LLVMRustCoverageWriteCovmapSectionNameToString(
2196        M: &Module,
2197        OutStr: &RustString,
2198    );
2199    pub(crate) safe fn LLVMRustCoverageWriteCovfunSectionNameToString(
2200        M: &Module,
2201        OutStr: &RustString,
2202    );
2203    pub(crate) safe fn LLVMRustCoverageWriteCovmapVarNameToString(OutStr: &RustString);
2204
2205    pub(crate) safe fn LLVMRustCoverageMappingVersion() -> u32;
2206    pub(crate) fn LLVMRustDebugMetadataVersion() -> u32;
2207    pub(crate) fn LLVMRustVersionMajor() -> u32;
2208    pub(crate) fn LLVMRustVersionMinor() -> u32;
2209    pub(crate) fn LLVMRustVersionPatch() -> u32;
2210
2211    /// Add LLVM module flags.
2212    ///
2213    /// In order for Rust-C LTO to work, module flags must be compatible with Clang. What
2214    /// "compatible" means depends on the merge behaviors involved.
2215    pub(crate) fn LLVMRustAddModuleFlagU32(
2216        M: &Module,
2217        MergeBehavior: ModuleFlagMergeBehavior,
2218        Name: *const c_char,
2219        NameLen: size_t,
2220        Value: u32,
2221    );
2222
2223    pub(crate) fn LLVMRustAddModuleFlagString(
2224        M: &Module,
2225        MergeBehavior: ModuleFlagMergeBehavior,
2226        Name: *const c_char,
2227        NameLen: size_t,
2228        Value: *const c_char,
2229        ValueLen: size_t,
2230    );
2231
2232    /// We can't use LLVM-C's `LLVMDIBuilderCreateCompileUnit` because it hardcodes
2233    /// `DICompileUnit::DebugNameTableKind::Default`, but we want to be able to
2234    /// pass other values.
2235    pub(crate) fn LLVMRustDIBuilderCreateCompileUnit<'a>(
2236        Builder: &DIBuilder<'a>,
2237        Lang: c_uint,
2238        File: &'a DIFile,
2239        Producer: *const c_char,
2240        ProducerLen: size_t,
2241        isOptimized: bool,
2242        Flags: *const c_char,
2243        RuntimeVer: c_uint,
2244        SplitName: *const c_char,
2245        SplitNameLen: size_t,
2246        kind: DebugEmissionKind,
2247        DWOId: u64,
2248        SplitDebugInlining: bool,
2249        DebugNameTableKind: DebugNameTableKind,
2250    ) -> &'a DIDescriptor;
2251
2252    /// We can't use LLVM-C's `LLVMDIBuilderCreateFileWithChecksum` because it
2253    /// _requires_ a checksum, but we sometimes don't provide one.
2254    pub(crate) fn LLVMRustDIBuilderCreateFile<'a>(
2255        Builder: &DIBuilder<'a>,
2256        Filename: *const c_char,
2257        FilenameLen: size_t,
2258        Directory: *const c_char,
2259        DirectoryLen: size_t,
2260        CSKind: ChecksumKind,
2261        Checksum: *const c_char,
2262        ChecksumLen: size_t,
2263        Source: *const c_char,
2264        SourceLen: size_t,
2265    ) -> &'a DIFile;
2266
2267    /// We can't use LLVM-C's `LLVMDIBuilderCreateFunction` because it only
2268    /// supports a subset of `DISubprogram::DISPFlags`.
2269    pub(crate) fn LLVMRustDIBuilderCreateFunction<'a>(
2270        Builder: &DIBuilder<'a>,
2271        Scope: &'a DIDescriptor,
2272        Name: *const c_char,
2273        NameLen: size_t,
2274        LinkageName: *const c_char,
2275        LinkageNameLen: size_t,
2276        File: &'a DIFile,
2277        LineNo: c_uint,
2278        Ty: &'a DIType,
2279        ScopeLine: c_uint,
2280        Flags: DIFlags,
2281        SPFlags: DISPFlags,
2282        MaybeFn: Option<&'a Value>,
2283        TParam: &'a DIArray,
2284        Decl: Option<&'a DIDescriptor>,
2285    ) -> &'a DISubprogram;
2286
2287    /// As of LLVM 22 there is no corresponding LLVM-C function.
2288    pub(crate) fn LLVMRustDIBuilderCreateMethod<'a>(
2289        Builder: &DIBuilder<'a>,
2290        Scope: &'a DIDescriptor,
2291        Name: *const c_char,
2292        NameLen: size_t,
2293        LinkageName: *const c_char,
2294        LinkageNameLen: size_t,
2295        File: &'a DIFile,
2296        LineNo: c_uint,
2297        Ty: &'a DIType,
2298        Flags: DIFlags,
2299        SPFlags: DISPFlags,
2300        TParam: &'a DIArray,
2301    ) -> &'a DISubprogram;
2302
2303    /// As of LLVM 22 there is no corresponding LLVM-C function.
2304    pub(crate) fn LLVMRustDIBuilderCreateVariantMemberType<'a>(
2305        Builder: &DIBuilder<'a>,
2306        Scope: &'a DIScope,
2307        Name: *const c_char,
2308        NameLen: size_t,
2309        File: &'a DIFile,
2310        LineNumber: c_uint,
2311        SizeInBits: u64,
2312        AlignInBits: u32,
2313        OffsetInBits: u64,
2314        Discriminant: Option<&'a Value>,
2315        Flags: DIFlags,
2316        Ty: &'a DIType,
2317    ) -> &'a DIType;
2318
2319    /// As of LLVM 22 there is no corresponding LLVM-C function.
2320    pub(crate) fn LLVMRustDIBuilderCreateEnumerationType<'a>(
2321        Builder: &DIBuilder<'a>,
2322        Scope: &'a DIScope,
2323        Name: *const c_char,
2324        NameLen: size_t,
2325        File: &'a DIFile,
2326        LineNumber: c_uint,
2327        SizeInBits: u64,
2328        AlignInBits: u32,
2329        Elements: &'a DIArray,
2330        ClassType: &'a DIType,
2331        IsScoped: bool,
2332    ) -> &'a DIType;
2333
2334    /// As of LLVM 22 there is no corresponding LLVM-C function.
2335    pub(crate) fn LLVMRustDIBuilderCreateVariantPart<'a>(
2336        Builder: &DIBuilder<'a>,
2337        Scope: &'a DIScope,
2338        Name: *const c_char,
2339        NameLen: size_t,
2340        File: &'a DIFile,
2341        LineNo: c_uint,
2342        SizeInBits: u64,
2343        AlignInBits: u32,
2344        Flags: DIFlags,
2345        Discriminator: Option<&'a DIDerivedType>,
2346        Elements: &'a DIArray,
2347        UniqueId: *const c_char,
2348        UniqueIdLen: size_t,
2349    ) -> &'a DIDerivedType;
2350
2351    /// As of LLVM 22 there is no corresponding LLVM-C function.
2352    pub(crate) fn LLVMRustDIBuilderCreateTemplateTypeParameter<'a>(
2353        Builder: &DIBuilder<'a>,
2354        Scope: Option<&'a DIScope>,
2355        Name: *const c_char,
2356        NameLen: size_t,
2357        Ty: &'a DIType,
2358    ) -> &'a DITemplateTypeParameter;
2359
2360    /// We can't use LLVM-C's `LLVMReplaceArrays` because it doesn't take a
2361    /// `Params` argument.
2362    pub(crate) fn LLVMRustDICompositeTypeReplaceArrays<'a>(
2363        Builder: &DIBuilder<'a>,
2364        CompositeType: &'a DIType,
2365        Elements: Option<&'a DIArray>,
2366        Params: Option<&'a DIArray>,
2367    );
2368
2369    /// We can't use LLVM-C's `LLVMDIBuilderGetOrCreateSubrange` because it doesn't
2370    /// call the overload that takes a `Metadata` upper bound.
2371    pub(crate) fn LLVMRustDIGetOrCreateSubrange<'a>(
2372        Builder: &DIBuilder<'a>,
2373        CountNode: Option<&'a Metadata>,
2374        LB: &'a Metadata,
2375        UB: &'a Metadata,
2376        Stride: Option<&'a Metadata>,
2377    ) -> &'a Metadata;
2378
2379    /// We can't use LLVM-C's `LLVMDIBuilderCreateVectorType` because it doesn't
2380    /// take a `BitStride` argument.
2381    pub(crate) fn LLVMRustDICreateVectorType<'a>(
2382        Builder: &DIBuilder<'a>,
2383        Size: u64,
2384        AlignInBits: u32,
2385        Type: &'a DIType,
2386        Subscripts: &'a DIArray,
2387        BitStride: Option<&'a Metadata>,
2388    ) -> &'a Metadata;
2389
2390    /// As of LLVM 22 there is no corresponding LLVM-C function.
2391    pub(crate) fn LLVMRustDILocationCloneWithBaseDiscriminator<'a>(
2392        Location: &'a DILocation,
2393        BD: c_uint,
2394    ) -> Option<&'a DILocation>;
2395
2396    pub(crate) fn LLVMRustWriteTypeToString(Type: &Type, s: &RustString);
2397    pub(crate) fn LLVMRustWriteValueToString(value_ref: &Value, s: &RustString);
2398
2399    pub(crate) fn LLVMRustHasFeature(T: &TargetMachine, s: *const c_char) -> bool;
2400    pub(crate) fn LLVMRustTargetHasMnemonic(T: &TargetMachine, s: *const c_char) -> bool;
2401
2402    pub(crate) fn LLVMRustPrintTargetCPUs(TM: &TargetMachine, OutStr: &RustString);
2403    pub(crate) fn LLVMRustGetTargetFeaturesCount(T: &TargetMachine) -> size_t;
2404    pub(crate) fn LLVMRustGetTargetFeature(
2405        T: &TargetMachine,
2406        Index: size_t,
2407        Feature: &mut *const c_char,
2408        Desc: &mut *const c_char,
2409    );
2410
2411    pub(crate) fn LLVMRustGetHostCPUName(LenOut: &mut size_t) -> *const u8;
2412
2413    // This function makes copies of pointed to data, so the data's lifetime may end after this
2414    // function returns.
2415    pub(crate) fn LLVMRustCreateTargetMachine(
2416        Triple: *const c_char,
2417        CPU: *const c_char,
2418        Features: *const c_char,
2419        Abi: *const c_char,
2420        Model: CodeModel,
2421        Reloc: RelocModel,
2422        Level: CodeGenOptLevel,
2423        FloatABIType: FloatAbi,
2424        FunctionSections: bool,
2425        DataSections: bool,
2426        UniqueSectionNames: bool,
2427        TrapUnreachable: bool,
2428        Singlethread: bool,
2429        VerboseAsm: bool,
2430        EmitStackSizeSection: bool,
2431        RelaxELFRelocations: bool,
2432        UseInitArray: bool,
2433        SplitDwarfFile: *const c_char,
2434        OutputObjFile: *const c_char,
2435        DebugInfoCompression: CompressionKind,
2436        UseEmulatedTls: bool,
2437        UseWasmEH: bool,
2438        LargeDataThreshold: u64,
2439    ) -> *mut TargetMachine;
2440
2441    pub(crate) fn LLVMRustAddLibraryInfo<'a>(
2442        T: &TargetMachine,
2443        PM: &PassManager<'a>,
2444        M: &'a Module,
2445        DisableSimplifyLibCalls: bool,
2446    );
2447    pub(crate) fn LLVMRustWriteOutputFile<'a>(
2448        T: &'a TargetMachine,
2449        PM: *mut PassManager<'a>,
2450        M: &'a Module,
2451        Output: *const c_char,
2452        DwoOutput: *const c_char,
2453        FileType: FileType,
2454        VerifyIR: bool,
2455    ) -> LLVMRustResult;
2456    pub(crate) fn LLVMRustOptimize<'a>(
2457        M: &'a Module,
2458        TM: &'a TargetMachine,
2459        OptLevel: PassBuilderOptLevel,
2460        OptStage: OptStage,
2461        IsLinkerPluginLTO: bool,
2462        NoPrepopulatePasses: bool,
2463        VerifyIR: bool,
2464        LintIR: bool,
2465        ThinLTOBuffer: Option<&mut Option<crate::back::lto::Buffer>>,
2466        ThinLTOSummaryBuffer: Option<&mut Option<crate::back::lto::Buffer>>,
2467        MergeFunctions: bool,
2468        UnrollLoops: bool,
2469        SLPVectorize: bool,
2470        LoopVectorize: bool,
2471        DisableSimplifyLibCalls: bool,
2472        EmitLifetimeMarkers: bool,
2473        RunEnzyme: *const c_void,
2474        PrintBeforeEnzyme: bool,
2475        PrintAfterEnzyme: bool,
2476        PrintPasses: bool,
2477        SanitizerOptions: Option<&SanitizerOptions>,
2478        PGOGenPath: *const c_char,
2479        PGOUsePath: *const c_char,
2480        InstrumentCoverage: bool,
2481        InstrProfileOutput: *const c_char,
2482        PGOSampleUsePath: *const c_char,
2483        DebugInfoForProfiling: bool,
2484        llvm_selfprofiler: *mut c_void,
2485        begin_callback: SelfProfileBeforePassCallback,
2486        end_callback: SelfProfileAfterPassCallback,
2487        ExtraPasses: *const c_char,
2488        ExtraPassesLen: size_t,
2489        LLVMPlugins: *const c_char,
2490        LLVMPluginsLen: size_t,
2491    ) -> LLVMRustResult;
2492    pub(crate) fn LLVMRustPrintModule(
2493        M: &Module,
2494        Output: *const c_char,
2495        Demangle: extern "C" fn(*const c_char, size_t, *mut c_char, size_t) -> size_t,
2496    ) -> LLVMRustResult;
2497    pub(crate) fn LLVMRustSetLLVMOptions(Argc: c_int, Argv: *const *const c_char);
2498    pub(crate) fn LLVMRustPrintPasses();
2499    pub(crate) fn LLVMRustSetNormalizedTarget(M: &Module, triple: *const c_char);
2500    pub(crate) fn LLVMRustRunRestrictionPass(M: &Module, syms: *const *const c_char, len: size_t);
2501
2502    pub(crate) fn LLVMRustWriteTwineToString(T: &Twine, s: &RustString);
2503
2504    pub(crate) fn LLVMRustUnpackOptimizationDiagnostic<'a>(
2505        DI: &'a DiagnosticInfo,
2506        pass_name_out: &RustString,
2507        function_out: &mut Option<&'a Value>,
2508        loc_line_out: &mut c_uint,
2509        loc_column_out: &mut c_uint,
2510        loc_filename_out: &RustString,
2511        message_out: &RustString,
2512    );
2513
2514    pub(crate) fn LLVMRustUnpackInlineAsmDiagnostic<'a>(
2515        DI: &'a DiagnosticInfo,
2516        level_out: &mut DiagnosticLevel,
2517        cookie_out: &mut u64,
2518        message_out: &mut Option<&'a Twine>,
2519    );
2520
2521    pub(crate) fn LLVMRustWriteDiagnosticInfoToString(DI: &DiagnosticInfo, s: &RustString);
2522    pub(crate) fn LLVMRustGetDiagInfoKind(DI: &DiagnosticInfo) -> DiagnosticKind;
2523
2524    pub(crate) fn LLVMRustGetSMDiagnostic<'a>(
2525        DI: &'a DiagnosticInfo,
2526        cookie_out: &mut u64,
2527    ) -> &'a SMDiagnostic;
2528
2529    pub(crate) fn LLVMRustUnpackSMDiagnostic(
2530        d: &SMDiagnostic,
2531        message_out: &RustString,
2532        buffer_out: &RustString,
2533        level_out: &mut DiagnosticLevel,
2534        loc_out: &mut c_uint,
2535        ranges_out: *mut c_uint,
2536        num_ranges: &mut usize,
2537    ) -> bool;
2538
2539    pub(crate) fn LLVMRustSetDataLayoutFromTargetMachine<'a>(M: &'a Module, TM: &'a TargetMachine);
2540
2541    pub(crate) fn LLVMRustPositionBuilderPastAllocas<'a>(B: &Builder<'a>, Fn: &'a Value);
2542    pub(crate) fn LLVMRustPositionBuilderAtStart<'a>(B: &Builder<'a>, BB: &'a BasicBlock);
2543
2544    pub(crate) fn LLVMRustSetModulePICLevel(M: &Module);
2545    pub(crate) fn LLVMRustSetModulePIELevel(M: &Module);
2546    pub(crate) fn LLVMRustSetModuleCodeModel(M: &Module, Model: CodeModel);
2547    pub(crate) fn LLVMRustBufferPtr(p: &Buffer) -> *const u8;
2548    pub(crate) fn LLVMRustBufferLen(p: &Buffer) -> usize;
2549    pub(crate) fn LLVMRustBufferFree(p: &'static mut Buffer);
2550    pub(crate) fn LLVMRustModuleCost(M: &Module) -> u64;
2551    pub(crate) fn LLVMRustModuleInstructionStats(M: &Module) -> u64;
2552
2553    pub(crate) fn LLVMRustModuleSerialize(M: &Module, is_thin: bool) -> &'static mut Buffer;
2554    pub(crate) fn LLVMRustCreateThinLTOData(
2555        Modules: *const ThinLTOModule,
2556        NumModules: size_t,
2557        PreservedSymbols: *const *const c_char,
2558        PreservedSymbolsLen: size_t,
2559    ) -> Option<&'static mut ThinLTOData>;
2560    pub(crate) fn LLVMRustPrepareThinLTORename(
2561        Data: &ThinLTOData,
2562        Module: &Module,
2563        Target: &TargetMachine,
2564    );
2565    pub(crate) fn LLVMRustPrepareThinLTOResolveWeak(Data: &ThinLTOData, Module: &Module) -> bool;
2566    pub(crate) fn LLVMRustPrepareThinLTOInternalize(Data: &ThinLTOData, Module: &Module) -> bool;
2567    pub(crate) fn LLVMRustPrepareThinLTOImport(
2568        Data: &ThinLTOData,
2569        Module: &Module,
2570        Target: &TargetMachine,
2571    ) -> bool;
2572    pub(crate) fn LLVMRustFreeThinLTOData(Data: &'static mut ThinLTOData);
2573    pub(crate) fn LLVMRustParseBitcodeForLTO(
2574        Context: &Context,
2575        Data: *const u8,
2576        len: usize,
2577        Identifier: *const c_char,
2578    ) -> Option<&Module>;
2579
2580    pub(crate) fn LLVMRustLinkerNew(M: &Module) -> &mut Linker<'_>;
2581    pub(crate) fn LLVMRustLinkerAdd(
2582        linker: &Linker<'_>,
2583        bytecode: *const c_char,
2584        bytecode_len: usize,
2585    ) -> bool;
2586    pub(crate) fn LLVMRustLinkerFree<'a>(linker: &'a mut Linker<'a>);
2587    pub(crate) fn LLVMRustComputeLTOCacheKey(
2588        key_out: &RustString,
2589        mod_id: *const c_char,
2590        data: &ThinLTOData,
2591    );
2592
2593    pub(crate) fn LLVMRustContextGetDiagnosticHandler(
2594        Context: &Context,
2595    ) -> Option<&DiagnosticHandler>;
2596    pub(crate) fn LLVMRustContextSetDiagnosticHandler(
2597        context: &Context,
2598        diagnostic_handler: Option<&DiagnosticHandler>,
2599    );
2600    pub(crate) fn LLVMRustContextConfigureDiagnosticHandler(
2601        context: &Context,
2602        diagnostic_handler_callback: DiagnosticHandlerTy,
2603        diagnostic_handler_context: *mut c_void,
2604        remark_all_passes: bool,
2605        remark_passes: *const *const c_char,
2606        remark_passes_len: usize,
2607        remark_file: *const c_char,
2608        pgo_available: bool,
2609    );
2610
2611    pub(crate) fn LLVMRustGetMangledName(V: &Value, out: &RustString);
2612
2613    pub(crate) fn LLVMRustGetElementTypeArgIndex(CallSite: &Value) -> i32;
2614
2615    pub(crate) safe fn LLVMRustLLVMHasZlibCompression() -> bool;
2616    pub(crate) safe fn LLVMRustLLVMHasZstdCompression() -> bool;
2617
2618    pub(crate) fn LLVMRustGetSymbols(
2619        buf_ptr: *const u8,
2620        buf_len: usize,
2621        state: *mut c_void,
2622        callback: GetSymbolsCallback,
2623        error_callback: GetSymbolsErrorCallback,
2624    ) -> *mut c_void;
2625
2626    pub(crate) fn LLVMRustIs64BitSymbolicFile(buf_ptr: *const u8, buf_len: usize) -> bool;
2627
2628    pub(crate) fn LLVMRustIsECObject(buf_ptr: *const u8, buf_len: usize) -> bool;
2629
2630    pub(crate) fn LLVMRustIsAnyArm64Coff(buf_ptr: *const u8, buf_len: usize) -> bool;
2631
2632    pub(crate) fn LLVMRustSetNoSanitizeAddress(Global: &Value);
2633    pub(crate) fn LLVMRustSetNoSanitizeHWAddress(Global: &Value);
2634
2635    pub(crate) fn LLVMAddAlias2<'ll>(
2636        M: &'ll Module,
2637        ValueTy: &Type,
2638        AddressSpace: c_uint,
2639        Aliasee: &Value,
2640        Name: *const c_char,
2641    ) -> &'ll Value;
2642}