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