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