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",
                AttributeKind::Convergent => "Convergent",
            })
    }
}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    Convergent = 49,
297}
298
299/// LLVMIntPredicate
300#[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)]
301#[repr(C)]
302pub(crate) enum IntPredicate {
303    IntEQ = 32,
304    IntNE = 33,
305    IntUGT = 34,
306    IntUGE = 35,
307    IntULT = 36,
308    IntULE = 37,
309    IntSGT = 38,
310    IntSGE = 39,
311    IntSLT = 40,
312    IntSLE = 41,
313}
314
315/// LLVMRealPredicate
316#[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)]
317#[repr(C)]
318pub(crate) enum RealPredicate {
319    RealPredicateFalse = 0,
320    RealOEQ = 1,
321    RealOGT = 2,
322    RealOGE = 3,
323    RealOLT = 4,
324    RealOLE = 5,
325    RealONE = 6,
326    RealORD = 7,
327    RealUNO = 8,
328    RealUEQ = 9,
329    RealUGT = 10,
330    RealUGE = 11,
331    RealULT = 12,
332    RealULE = 13,
333    RealUNE = 14,
334    RealPredicateTrue = 15,
335}
336
337/// Must match the layout of `LLVMTypeKind`.
338///
339/// Use [`RawEnum<TypeKind>`] for values of `LLVMTypeKind` returned from LLVM,
340/// to avoid risk of UB if LLVM adds new enum values.
341///
342/// All of LLVM's variants should be declared here, even if no Rust-side code refers
343/// to them, because unknown variants will cause [`RawEnum::to_rust`] to panic.
344#[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)]
345#[repr(C)]
346pub(crate) enum TypeKind {
347    Void = 0,
348    Half = 1,
349    Float = 2,
350    Double = 3,
351    X86_FP80 = 4,
352    FP128 = 5,
353    PPC_FP128 = 6,
354    Label = 7,
355    Integer = 8,
356    Function = 9,
357    Struct = 10,
358    Array = 11,
359    Pointer = 12,
360    Vector = 13,
361    Metadata = 14,
362    Token = 16,
363    ScalableVector = 17,
364    BFloat = 18,
365    X86_AMX = 19,
366}
367
368/// LLVMAtomicRmwBinOp
369#[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)]
370#[repr(C)]
371pub(crate) enum AtomicRmwBinOp {
372    AtomicXchg = 0,
373    AtomicAdd = 1,
374    AtomicSub = 2,
375    AtomicAnd = 3,
376    AtomicNand = 4,
377    AtomicOr = 5,
378    AtomicXor = 6,
379    AtomicMax = 7,
380    AtomicMin = 8,
381    AtomicUMax = 9,
382    AtomicUMin = 10,
383}
384
385/// LLVMAtomicOrdering
386#[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)]
387#[repr(C)]
388pub(crate) enum AtomicOrdering {
389    #[allow(dead_code)]
390    NotAtomic = 0,
391    #[allow(dead_code)]
392    Unordered = 1,
393    Monotonic = 2,
394    // Consume = 3,  // Not specified yet.
395    Acquire = 4,
396    Release = 5,
397    AcquireRelease = 6,
398    SequentiallyConsistent = 7,
399}
400
401/// LLVMRustFileType
402#[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)]
403#[repr(C)]
404pub(crate) enum FileType {
405    AssemblyFile,
406    ObjectFile,
407}
408
409/// Must match the layout of `LLVMInlineAsmDialect`.
410#[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)]
411#[repr(C)]
412pub(crate) enum AsmDialect {
413    Att,
414    Intel,
415}
416
417/// LLVMRustCodeGenOptLevel
418#[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)]
419#[repr(C)]
420pub(crate) enum CodeGenOptLevel {
421    None,
422    Less,
423    Default,
424    Aggressive,
425}
426
427/// LLVMRustPassBuilderOptLevel
428#[repr(C)]
429pub(crate) enum PassBuilderOptLevel {
430    O0,
431    O1,
432    O2,
433    O3,
434    Os,
435    Oz,
436}
437
438/// LLVMRustOptStage
439#[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)]
440#[repr(C)]
441pub(crate) enum OptStage {
442    PreLinkNoLTO,
443    PreLinkThinLTO,
444    PreLinkFatLTO,
445    ThinLTO,
446    FatLTO,
447}
448
449/// LLVMRustSanitizerOptions
450#[repr(C)]
451pub(crate) struct SanitizerOptions {
452    pub sanitize_address: bool,
453    pub sanitize_address_recover: bool,
454    pub sanitize_cfi: bool,
455    pub sanitize_dataflow: bool,
456    pub sanitize_dataflow_abilist: *const *const c_char,
457    pub sanitize_dataflow_abilist_len: size_t,
458    pub sanitize_kcfi: bool,
459    pub sanitize_memory: bool,
460    pub sanitize_memory_recover: bool,
461    pub sanitize_memory_track_origins: c_int,
462    pub sanitize_realtime: bool,
463    pub sanitize_thread: bool,
464    pub sanitize_hwaddress: bool,
465    pub sanitize_hwaddress_recover: bool,
466    pub sanitize_kernel_address: bool,
467    pub sanitize_kernel_address_recover: bool,
468    pub sanitize_kernel_hwaddress: bool,
469    pub sanitize_kernel_hwaddress_recover: bool,
470}
471
472/// LLVMRustRelocModel
473#[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)]
474#[repr(C)]
475pub(crate) enum RelocModel {
476    Static,
477    PIC,
478    DynamicNoPic,
479    ROPI,
480    RWPI,
481    ROPI_RWPI,
482}
483
484/// LLVMRustFloatABI
485#[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)]
486#[repr(C)]
487pub(crate) enum FloatAbi {
488    Default,
489    Soft,
490    Hard,
491}
492
493/// LLVMRustCodeModel
494#[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)]
495#[repr(C)]
496pub(crate) enum CodeModel {
497    Tiny,
498    Small,
499    Kernel,
500    Medium,
501    Large,
502    None,
503}
504
505/// LLVMRustDiagnosticKind
506#[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)]
507#[repr(C)]
508#[allow(dead_code)] // Variants constructed by C++.
509pub(crate) enum DiagnosticKind {
510    Other,
511    InlineAsm,
512    StackSize,
513    DebugMetadataVersion,
514    SampleProfile,
515    OptimizationRemark,
516    OptimizationRemarkMissed,
517    OptimizationRemarkAnalysis,
518    OptimizationRemarkAnalysisFPCommute,
519    OptimizationRemarkAnalysisAliasing,
520    OptimizationRemarkOther,
521    OptimizationFailure,
522    PGOProfile,
523    Linker,
524    Unsupported,
525    SrcMgr,
526}
527
528/// LLVMRustDiagnosticLevel
529#[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)]
530#[repr(C)]
531#[allow(dead_code)] // Variants constructed by C++.
532pub(crate) enum DiagnosticLevel {
533    Error,
534    Warning,
535    Note,
536    Remark,
537}
538
539unsafe extern "C" {
540    // LLVMRustThinLTOData
541    pub(crate) type ThinLTOData;
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_fields_are_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_fields_are_eq(&self) {
                let _: ::core::cmp::AssertParamIsEq<u32>;
            }
        }
        #[automatically_derived]
        impl ::core::cmp::PartialOrd for InternalBitFlags {
            #[inline]
            fn partial_cmp(&self, other: &InternalBitFlags)
                -> ::core::option::Option<::core::cmp::Ordering> {
                ::core::cmp::PartialOrd::partial_cmp(&self.0, &other.0)
            }
        }
        #[automatically_derived]
        impl ::core::cmp::Ord for InternalBitFlags {
            #[inline]
            fn cmp(&self, other: &InternalBitFlags) -> ::core::cmp::Ordering {
                ::core::cmp::Ord::cmp(&self.0, &other.0)
            }
        }
        #[automatically_derived]
        impl ::core::hash::Hash for InternalBitFlags {
            #[inline]
            fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
                ::core::hash::Hash::hash(&self.0, state)
            }
        }
        impl ::bitflags::__private::PublicFlags for DIFlags {
            type Primitive = u32;
            type Internal = InternalBitFlags;
        }
        impl ::bitflags::__private::core::default::Default for
            InternalBitFlags {
            #[inline]
            fn default() -> Self { InternalBitFlags::empty() }
        }
        impl ::bitflags::__private::core::fmt::Debug for InternalBitFlags {
            fn fmt(&self,
                f: &mut ::bitflags::__private::core::fmt::Formatter<'_>)
                -> ::bitflags::__private::core::fmt::Result {
                if self.is_empty() {
                    f.write_fmt(format_args!("{0:#x}",
                            <u32 as ::bitflags::Bits>::EMPTY))
                } else {
                    ::bitflags::__private::core::fmt::Display::fmt(self, f)
                }
            }
        }
        impl ::bitflags::__private::core::fmt::Display for InternalBitFlags {
            fn fmt(&self,
                f: &mut ::bitflags::__private::core::fmt::Formatter<'_>)
                -> ::bitflags::__private::core::fmt::Result {
                ::bitflags::parser::to_writer(&DIFlags(*self), f)
            }
        }
        impl ::bitflags::__private::core::str::FromStr for InternalBitFlags {
            type Err = ::bitflags::parser::ParseError;
            fn from_str(s: &str)
                ->
                    ::bitflags::__private::core::result::Result<Self,
                    Self::Err> {
                ::bitflags::parser::from_str::<DIFlags>(s).map(|flags|
                        flags.0)
            }
        }
        impl ::bitflags::__private::core::convert::AsRef<u32> for
            InternalBitFlags {
            fn as_ref(&self) -> &u32 { &self.0 }
        }
        impl ::bitflags::__private::core::convert::From<u32> for
            InternalBitFlags {
            fn from(bits: u32) -> Self { Self::from_bits_retain(bits) }
        }
        #[allow(dead_code, deprecated, unused_attributes)]
        impl InternalBitFlags {
            /// Get a flags value with all bits unset.
            #[inline]
            pub const fn empty() -> Self {
                Self(<u32 as ::bitflags::Bits>::EMPTY)
            }
            /// Get a flags value with all known bits set.
            #[inline]
            pub const fn all() -> Self {
                let mut truncated = <u32 as ::bitflags::Bits>::EMPTY;
                let mut i = 0;
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DIFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                let _ = i;
                Self(truncated)
            }
            /// Get the underlying bits value.
            ///
            /// The returned value is exactly the bits set in this flags value.
            #[inline]
            pub const fn bits(&self) -> u32 { self.0 }
            /// Convert from a bits value.
            ///
            /// This method will return `None` if any unknown bits are set.
            #[inline]
            pub const fn from_bits(bits: u32)
                -> ::bitflags::__private::core::option::Option<Self> {
                let truncated = Self::from_bits_truncate(bits).0;
                if truncated == bits {
                    ::bitflags::__private::core::option::Option::Some(Self(bits))
                } else { ::bitflags::__private::core::option::Option::None }
            }
            /// Convert from a bits value, unsetting any unknown bits.
            #[inline]
            pub const fn from_bits_truncate(bits: u32) -> Self {
                Self(bits & Self::all().0)
            }
            /// Convert from a bits value exactly.
            #[inline]
            pub const fn from_bits_retain(bits: u32) -> Self { Self(bits) }
            /// Get a flags value with the bits of a flag with the given name set.
            ///
            /// This method will return `None` if `name` is empty or doesn't
            /// correspond to any named flag.
            #[inline]
            pub fn from_name(name: &str)
                -> ::bitflags::__private::core::option::Option<Self> {
                {
                    if name == "FlagZero" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagZero.bits()));
                    }
                };
                ;
                {
                    if name == "FlagPrivate" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagPrivate.bits()));
                    }
                };
                ;
                {
                    if name == "FlagProtected" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagProtected.bits()));
                    }
                };
                ;
                {
                    if name == "FlagPublic" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagPublic.bits()));
                    }
                };
                ;
                {
                    if name == "FlagFwdDecl" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagFwdDecl.bits()));
                    }
                };
                ;
                {
                    if name == "FlagAppleBlock" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagAppleBlock.bits()));
                    }
                };
                ;
                {
                    if name == "FlagReservedBit4" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagReservedBit4.bits()));
                    }
                };
                ;
                {
                    if name == "FlagVirtual" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagVirtual.bits()));
                    }
                };
                ;
                {
                    if name == "FlagArtificial" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagArtificial.bits()));
                    }
                };
                ;
                {
                    if name == "FlagExplicit" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagExplicit.bits()));
                    }
                };
                ;
                {
                    if name == "FlagPrototyped" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagPrototyped.bits()));
                    }
                };
                ;
                {
                    if name == "FlagObjcClassComplete" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagObjcClassComplete.bits()));
                    }
                };
                ;
                {
                    if name == "FlagObjectPointer" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagObjectPointer.bits()));
                    }
                };
                ;
                {
                    if name == "FlagVector" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagVector.bits()));
                    }
                };
                ;
                {
                    if name == "FlagStaticMember" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagStaticMember.bits()));
                    }
                };
                ;
                {
                    if name == "FlagLValueReference" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagLValueReference.bits()));
                    }
                };
                ;
                {
                    if name == "FlagRValueReference" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagRValueReference.bits()));
                    }
                };
                ;
                {
                    if name == "FlagReserved" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagReserved.bits()));
                    }
                };
                ;
                {
                    if name == "FlagSingleInheritance" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagSingleInheritance.bits()));
                    }
                };
                ;
                {
                    if name == "FlagMultipleInheritance" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagMultipleInheritance.bits()));
                    }
                };
                ;
                {
                    if name == "FlagVirtualInheritance" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagVirtualInheritance.bits()));
                    }
                };
                ;
                {
                    if name == "FlagIntroducedVirtual" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagIntroducedVirtual.bits()));
                    }
                };
                ;
                {
                    if name == "FlagBitField" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagBitField.bits()));
                    }
                };
                ;
                {
                    if name == "FlagNoReturn" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagNoReturn.bits()));
                    }
                };
                ;
                {
                    if name == "FlagTypePassByValue" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagTypePassByValue.bits()));
                    }
                };
                ;
                {
                    if name == "FlagTypePassByReference" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagTypePassByReference.bits()));
                    }
                };
                ;
                {
                    if name == "FlagEnumClass" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagEnumClass.bits()));
                    }
                };
                ;
                {
                    if name == "FlagThunk" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagThunk.bits()));
                    }
                };
                ;
                {
                    if name == "FlagNonTrivial" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagNonTrivial.bits()));
                    }
                };
                ;
                {
                    if name == "FlagBigEndian" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagBigEndian.bits()));
                    }
                };
                ;
                {
                    if name == "FlagLittleEndian" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DIFlags::FlagLittleEndian.bits()));
                    }
                };
                ;
                let _ = name;
                ::bitflags::__private::core::option::Option::None
            }
            /// Whether all bits in this flags value are unset.
            #[inline]
            pub const fn is_empty(&self) -> bool {
                self.0 == <u32 as ::bitflags::Bits>::EMPTY
            }
            /// Whether all known bits in this flags value are set.
            #[inline]
            pub const fn is_all(&self) -> bool {
                Self::all().0 | self.0 == self.0
            }
            /// Whether any set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn intersects(&self, other: Self) -> bool {
                self.0 & other.0 != <u32 as ::bitflags::Bits>::EMPTY
            }
            /// Whether all set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn contains(&self, other: Self) -> bool {
                self.0 & other.0 == other.0
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            pub fn insert(&mut self, other: Self) {
                *self = Self(self.0).union(other);
            }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `remove` won't truncate `other`, but the `!` operator will.
            #[inline]
            pub fn remove(&mut self, other: Self) {
                *self = Self(self.0).difference(other);
            }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            pub fn toggle(&mut self, other: Self) {
                *self = Self(self.0).symmetric_difference(other);
            }
            /// Call `insert` when `value` is `true` or `remove` when `value` is `false`.
            #[inline]
            pub fn set(&mut self, other: Self, value: bool) {
                if value { self.insert(other); } else { self.remove(other); }
            }
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn intersection(self, other: Self) -> Self {
                Self(self.0 & other.0)
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn union(self, other: Self) -> Self {
                Self(self.0 | other.0)
            }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            #[must_use]
            pub const fn difference(self, other: Self) -> Self {
                Self(self.0 & !other.0)
            }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn symmetric_difference(self, other: Self) -> Self {
                Self(self.0 ^ other.0)
            }
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            #[must_use]
            pub const fn complement(self) -> Self {
                Self::from_bits_truncate(!self.0)
            }
        }
        impl ::bitflags::__private::core::fmt::Binary for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Binary::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::Octal for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Octal::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::LowerHex for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::LowerHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::UpperHex for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::UpperHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::ops::BitOr for InternalBitFlags {
            type Output = Self;
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor(self, other: InternalBitFlags) -> Self {
                self.union(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitOrAssign for
            InternalBitFlags {
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor_assign(&mut self, other: Self) { self.insert(other); }
        }
        impl ::bitflags::__private::core::ops::BitXor for InternalBitFlags {
            type Output = Self;
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor(self, other: Self) -> Self {
                self.symmetric_difference(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitXorAssign for
            InternalBitFlags {
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor_assign(&mut self, other: Self) { self.toggle(other); }
        }
        impl ::bitflags::__private::core::ops::BitAnd for InternalBitFlags {
            type Output = Self;
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand(self, other: Self) -> Self { self.intersection(other) }
        }
        impl ::bitflags::__private::core::ops::BitAndAssign for
            InternalBitFlags {
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand_assign(&mut self, other: Self) {
                *self =
                    Self::from_bits_retain(self.bits()).intersection(other);
            }
        }
        impl ::bitflags::__private::core::ops::Sub for InternalBitFlags {
            type Output = Self;
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub(self, other: Self) -> Self { self.difference(other) }
        }
        impl ::bitflags::__private::core::ops::SubAssign for InternalBitFlags
            {
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub_assign(&mut self, other: Self) { self.remove(other); }
        }
        impl ::bitflags::__private::core::ops::Not for InternalBitFlags {
            type Output = Self;
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            fn not(self) -> Self { self.complement() }
        }
        impl ::bitflags::__private::core::iter::Extend<InternalBitFlags> for
            InternalBitFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn extend<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(&mut self, iterator: T) {
                for item in iterator { self.insert(item) }
            }
        }
        impl ::bitflags::__private::core::iter::FromIterator<InternalBitFlags>
            for InternalBitFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn from_iter<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(iterator: T) -> Self {
                use ::bitflags::__private::core::iter::Extend;
                let mut result = Self::empty();
                result.extend(iterator);
                result
            }
        }
        impl InternalBitFlags {
            /// Yield a set of contained flags values.
            ///
            /// Each yielded flags value will correspond to a defined named flag. Any unknown bits
            /// will be yielded together as a final flags value.
            #[inline]
            pub const fn iter(&self) -> ::bitflags::iter::Iter<DIFlags> {
                ::bitflags::iter::Iter::__private_const_new(<DIFlags as
                        ::bitflags::Flags>::FLAGS,
                    DIFlags::from_bits_retain(self.bits()),
                    DIFlags::from_bits_retain(self.bits()))
            }
            /// Yield a set of contained named flags values.
            ///
            /// This method is like [`iter`](#method.iter), except only yields bits in contained named flags.
            /// Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
            #[inline]
            pub const fn iter_names(&self)
                -> ::bitflags::iter::IterNames<DIFlags> {
                ::bitflags::iter::IterNames::__private_const_new(<DIFlags as
                        ::bitflags::Flags>::FLAGS,
                    DIFlags::from_bits_retain(self.bits()),
                    DIFlags::from_bits_retain(self.bits()))
            }
        }
        impl ::bitflags::__private::core::iter::IntoIterator for
            InternalBitFlags {
            type Item = DIFlags;
            type IntoIter = ::bitflags::iter::Iter<DIFlags>;
            fn into_iter(self) -> Self::IntoIter { self.iter() }
        }
        impl InternalBitFlags {
            /// Returns a mutable reference to the raw value of the flags currently stored.
            #[inline]
            pub fn bits_mut(&mut self) -> &mut u32 { &mut self.0 }
        }
        #[allow(dead_code, deprecated, unused_attributes)]
        impl DIFlags {
            /// Get a flags value with all bits unset.
            #[inline]
            pub const fn empty() -> Self { Self(InternalBitFlags::empty()) }
            /// Get a flags value with all known bits set.
            #[inline]
            pub const fn all() -> Self { Self(InternalBitFlags::all()) }
            /// Get the underlying bits value.
            ///
            /// The returned value is exactly the bits set in this flags value.
            #[inline]
            pub const fn bits(&self) -> u32 { self.0.bits() }
            /// Convert from a bits value.
            ///
            /// This method will return `None` if any unknown bits are set.
            #[inline]
            pub const fn from_bits(bits: u32)
                -> ::bitflags::__private::core::option::Option<Self> {
                match InternalBitFlags::from_bits(bits) {
                    ::bitflags::__private::core::option::Option::Some(bits) =>
                        ::bitflags::__private::core::option::Option::Some(Self(bits)),
                    ::bitflags::__private::core::option::Option::None =>
                        ::bitflags::__private::core::option::Option::None,
                }
            }
            /// Convert from a bits value, unsetting any unknown bits.
            #[inline]
            pub const fn from_bits_truncate(bits: u32) -> Self {
                Self(InternalBitFlags::from_bits_truncate(bits))
            }
            /// Convert from a bits value exactly.
            #[inline]
            pub const fn from_bits_retain(bits: u32) -> Self {
                Self(InternalBitFlags::from_bits_retain(bits))
            }
            /// Get a flags value with the bits of a flag with the given name set.
            ///
            /// This method will return `None` if `name` is empty or doesn't
            /// correspond to any named flag.
            #[inline]
            pub fn from_name(name: &str)
                -> ::bitflags::__private::core::option::Option<Self> {
                match InternalBitFlags::from_name(name) {
                    ::bitflags::__private::core::option::Option::Some(bits) =>
                        ::bitflags::__private::core::option::Option::Some(Self(bits)),
                    ::bitflags::__private::core::option::Option::None =>
                        ::bitflags::__private::core::option::Option::None,
                }
            }
            /// Whether all bits in this flags value are unset.
            #[inline]
            pub const fn is_empty(&self) -> bool { self.0.is_empty() }
            /// Whether all known bits in this flags value are set.
            #[inline]
            pub const fn is_all(&self) -> bool { self.0.is_all() }
            /// Whether any set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn intersects(&self, other: Self) -> bool {
                self.0.intersects(other.0)
            }
            /// Whether all set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn contains(&self, other: Self) -> bool {
                self.0.contains(other.0)
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            pub fn insert(&mut self, other: Self) { self.0.insert(other.0) }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `remove` won't truncate `other`, but the `!` operator will.
            #[inline]
            pub fn remove(&mut self, other: Self) { self.0.remove(other.0) }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            pub fn toggle(&mut self, other: Self) { self.0.toggle(other.0) }
            /// Call `insert` when `value` is `true` or `remove` when `value` is `false`.
            #[inline]
            pub fn set(&mut self, other: Self, value: bool) {
                self.0.set(other.0, value)
            }
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn intersection(self, other: Self) -> Self {
                Self(self.0.intersection(other.0))
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn union(self, other: Self) -> Self {
                Self(self.0.union(other.0))
            }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            #[must_use]
            pub const fn difference(self, other: Self) -> Self {
                Self(self.0.difference(other.0))
            }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn symmetric_difference(self, other: Self) -> Self {
                Self(self.0.symmetric_difference(other.0))
            }
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            #[must_use]
            pub const fn complement(self) -> Self {
                Self(self.0.complement())
            }
        }
        impl ::bitflags::__private::core::fmt::Binary for DIFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Binary::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::Octal for DIFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Octal::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::LowerHex for DIFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::LowerHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::UpperHex for DIFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::UpperHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::ops::BitOr for DIFlags {
            type Output = Self;
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor(self, other: DIFlags) -> Self { self.union(other) }
        }
        impl ::bitflags::__private::core::ops::BitOrAssign for DIFlags {
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor_assign(&mut self, other: Self) { self.insert(other); }
        }
        impl ::bitflags::__private::core::ops::BitXor for DIFlags {
            type Output = Self;
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor(self, other: Self) -> Self {
                self.symmetric_difference(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitXorAssign for DIFlags {
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor_assign(&mut self, other: Self) { self.toggle(other); }
        }
        impl ::bitflags::__private::core::ops::BitAnd for DIFlags {
            type Output = Self;
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand(self, other: Self) -> Self { self.intersection(other) }
        }
        impl ::bitflags::__private::core::ops::BitAndAssign for DIFlags {
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand_assign(&mut self, other: Self) {
                *self =
                    Self::from_bits_retain(self.bits()).intersection(other);
            }
        }
        impl ::bitflags::__private::core::ops::Sub for DIFlags {
            type Output = Self;
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub(self, other: Self) -> Self { self.difference(other) }
        }
        impl ::bitflags::__private::core::ops::SubAssign for DIFlags {
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub_assign(&mut self, other: Self) { self.remove(other); }
        }
        impl ::bitflags::__private::core::ops::Not for DIFlags {
            type Output = Self;
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            fn not(self) -> Self { self.complement() }
        }
        impl ::bitflags::__private::core::iter::Extend<DIFlags> for DIFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn extend<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(&mut self, iterator: T) {
                for item in iterator { self.insert(item) }
            }
        }
        impl ::bitflags::__private::core::iter::FromIterator<DIFlags> for
            DIFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn from_iter<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(iterator: T) -> Self {
                use ::bitflags::__private::core::iter::Extend;
                let mut result = Self::empty();
                result.extend(iterator);
                result
            }
        }
        impl DIFlags {
            /// Yield a set of contained flags values.
            ///
            /// Each yielded flags value will correspond to a defined named flag. Any unknown bits
            /// will be yielded together as a final flags value.
            #[inline]
            pub const fn iter(&self) -> ::bitflags::iter::Iter<DIFlags> {
                ::bitflags::iter::Iter::__private_const_new(<DIFlags as
                        ::bitflags::Flags>::FLAGS,
                    DIFlags::from_bits_retain(self.bits()),
                    DIFlags::from_bits_retain(self.bits()))
            }
            /// Yield a set of contained named flags values.
            ///
            /// This method is like [`iter`](#method.iter), except only yields bits in contained named flags.
            /// Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
            #[inline]
            pub const fn iter_names(&self)
                -> ::bitflags::iter::IterNames<DIFlags> {
                ::bitflags::iter::IterNames::__private_const_new(<DIFlags as
                        ::bitflags::Flags>::FLAGS,
                    DIFlags::from_bits_retain(self.bits()),
                    DIFlags::from_bits_retain(self.bits()))
            }
        }
        impl ::bitflags::__private::core::iter::IntoIterator for DIFlags {
            type Item = DIFlags;
            type IntoIter = ::bitflags::iter::Iter<DIFlags>;
            fn into_iter(self) -> Self::IntoIter { self.iter() }
        }
    };Clone, #[automatically_derived]
impl ::core::marker::Copy for DIFlags { }Copy, #[automatically_derived]
impl ::core::default::Default for DIFlags {
    #[inline]
    fn default() -> DIFlags { DIFlags(::core::default::Default::default()) }
}Default)]
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_fields_are_eq(&self) {
                let _: ::core::cmp::AssertParamIsEq<u32>;
            }
        }
        #[automatically_derived]
        impl ::core::cmp::PartialOrd for InternalBitFlags {
            #[inline]
            fn partial_cmp(&self, other: &InternalBitFlags)
                -> ::core::option::Option<::core::cmp::Ordering> {
                ::core::cmp::PartialOrd::partial_cmp(&self.0, &other.0)
            }
        }
        #[automatically_derived]
        impl ::core::cmp::Ord for InternalBitFlags {
            #[inline]
            fn cmp(&self, other: &InternalBitFlags) -> ::core::cmp::Ordering {
                ::core::cmp::Ord::cmp(&self.0, &other.0)
            }
        }
        #[automatically_derived]
        impl ::core::hash::Hash for InternalBitFlags {
            #[inline]
            fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
                ::core::hash::Hash::hash(&self.0, state)
            }
        }
        impl ::bitflags::__private::PublicFlags for DISPFlags {
            type Primitive = u32;
            type Internal = InternalBitFlags;
        }
        impl ::bitflags::__private::core::default::Default for
            InternalBitFlags {
            #[inline]
            fn default() -> Self { InternalBitFlags::empty() }
        }
        impl ::bitflags::__private::core::fmt::Debug for InternalBitFlags {
            fn fmt(&self,
                f: &mut ::bitflags::__private::core::fmt::Formatter<'_>)
                -> ::bitflags::__private::core::fmt::Result {
                if self.is_empty() {
                    f.write_fmt(format_args!("{0:#x}",
                            <u32 as ::bitflags::Bits>::EMPTY))
                } else {
                    ::bitflags::__private::core::fmt::Display::fmt(self, f)
                }
            }
        }
        impl ::bitflags::__private::core::fmt::Display for InternalBitFlags {
            fn fmt(&self,
                f: &mut ::bitflags::__private::core::fmt::Formatter<'_>)
                -> ::bitflags::__private::core::fmt::Result {
                ::bitflags::parser::to_writer(&DISPFlags(*self), f)
            }
        }
        impl ::bitflags::__private::core::str::FromStr for InternalBitFlags {
            type Err = ::bitflags::parser::ParseError;
            fn from_str(s: &str)
                ->
                    ::bitflags::__private::core::result::Result<Self,
                    Self::Err> {
                ::bitflags::parser::from_str::<DISPFlags>(s).map(|flags|
                        flags.0)
            }
        }
        impl ::bitflags::__private::core::convert::AsRef<u32> for
            InternalBitFlags {
            fn as_ref(&self) -> &u32 { &self.0 }
        }
        impl ::bitflags::__private::core::convert::From<u32> for
            InternalBitFlags {
            fn from(bits: u32) -> Self { Self::from_bits_retain(bits) }
        }
        #[allow(dead_code, deprecated, unused_attributes)]
        impl InternalBitFlags {
            /// Get a flags value with all bits unset.
            #[inline]
            pub const fn empty() -> Self {
                Self(<u32 as ::bitflags::Bits>::EMPTY)
            }
            /// Get a flags value with all known bits set.
            #[inline]
            pub const fn all() -> Self {
                let mut truncated = <u32 as ::bitflags::Bits>::EMPTY;
                let mut i = 0;
                {
                    {
                        let flag =
                            <DISPFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DISPFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DISPFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DISPFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DISPFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DISPFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <DISPFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                let _ = i;
                Self(truncated)
            }
            /// Get the underlying bits value.
            ///
            /// The returned value is exactly the bits set in this flags value.
            #[inline]
            pub const fn bits(&self) -> u32 { self.0 }
            /// Convert from a bits value.
            ///
            /// This method will return `None` if any unknown bits are set.
            #[inline]
            pub const fn from_bits(bits: u32)
                -> ::bitflags::__private::core::option::Option<Self> {
                let truncated = Self::from_bits_truncate(bits).0;
                if truncated == bits {
                    ::bitflags::__private::core::option::Option::Some(Self(bits))
                } else { ::bitflags::__private::core::option::Option::None }
            }
            /// Convert from a bits value, unsetting any unknown bits.
            #[inline]
            pub const fn from_bits_truncate(bits: u32) -> Self {
                Self(bits & Self::all().0)
            }
            /// Convert from a bits value exactly.
            #[inline]
            pub const fn from_bits_retain(bits: u32) -> Self { Self(bits) }
            /// Get a flags value with the bits of a flag with the given name set.
            ///
            /// This method will return `None` if `name` is empty or doesn't
            /// correspond to any named flag.
            #[inline]
            pub fn from_name(name: &str)
                -> ::bitflags::__private::core::option::Option<Self> {
                {
                    if name == "SPFlagZero" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DISPFlags::SPFlagZero.bits()));
                    }
                };
                ;
                {
                    if name == "SPFlagVirtual" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DISPFlags::SPFlagVirtual.bits()));
                    }
                };
                ;
                {
                    if name == "SPFlagPureVirtual" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DISPFlags::SPFlagPureVirtual.bits()));
                    }
                };
                ;
                {
                    if name == "SPFlagLocalToUnit" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DISPFlags::SPFlagLocalToUnit.bits()));
                    }
                };
                ;
                {
                    if name == "SPFlagDefinition" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DISPFlags::SPFlagDefinition.bits()));
                    }
                };
                ;
                {
                    if name == "SPFlagOptimized" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DISPFlags::SPFlagOptimized.bits()));
                    }
                };
                ;
                {
                    if name == "SPFlagMainSubprogram" {
                        return ::bitflags::__private::core::option::Option::Some(Self(DISPFlags::SPFlagMainSubprogram.bits()));
                    }
                };
                ;
                let _ = name;
                ::bitflags::__private::core::option::Option::None
            }
            /// Whether all bits in this flags value are unset.
            #[inline]
            pub const fn is_empty(&self) -> bool {
                self.0 == <u32 as ::bitflags::Bits>::EMPTY
            }
            /// Whether all known bits in this flags value are set.
            #[inline]
            pub const fn is_all(&self) -> bool {
                Self::all().0 | self.0 == self.0
            }
            /// Whether any set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn intersects(&self, other: Self) -> bool {
                self.0 & other.0 != <u32 as ::bitflags::Bits>::EMPTY
            }
            /// Whether all set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn contains(&self, other: Self) -> bool {
                self.0 & other.0 == other.0
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            pub fn insert(&mut self, other: Self) {
                *self = Self(self.0).union(other);
            }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `remove` won't truncate `other`, but the `!` operator will.
            #[inline]
            pub fn remove(&mut self, other: Self) {
                *self = Self(self.0).difference(other);
            }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            pub fn toggle(&mut self, other: Self) {
                *self = Self(self.0).symmetric_difference(other);
            }
            /// Call `insert` when `value` is `true` or `remove` when `value` is `false`.
            #[inline]
            pub fn set(&mut self, other: Self, value: bool) {
                if value { self.insert(other); } else { self.remove(other); }
            }
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn intersection(self, other: Self) -> Self {
                Self(self.0 & other.0)
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn union(self, other: Self) -> Self {
                Self(self.0 | other.0)
            }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            #[must_use]
            pub const fn difference(self, other: Self) -> Self {
                Self(self.0 & !other.0)
            }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn symmetric_difference(self, other: Self) -> Self {
                Self(self.0 ^ other.0)
            }
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            #[must_use]
            pub const fn complement(self) -> Self {
                Self::from_bits_truncate(!self.0)
            }
        }
        impl ::bitflags::__private::core::fmt::Binary for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Binary::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::Octal for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Octal::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::LowerHex for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::LowerHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::UpperHex for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::UpperHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::ops::BitOr for InternalBitFlags {
            type Output = Self;
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor(self, other: InternalBitFlags) -> Self {
                self.union(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitOrAssign for
            InternalBitFlags {
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor_assign(&mut self, other: Self) { self.insert(other); }
        }
        impl ::bitflags::__private::core::ops::BitXor for InternalBitFlags {
            type Output = Self;
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor(self, other: Self) -> Self {
                self.symmetric_difference(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitXorAssign for
            InternalBitFlags {
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor_assign(&mut self, other: Self) { self.toggle(other); }
        }
        impl ::bitflags::__private::core::ops::BitAnd for InternalBitFlags {
            type Output = Self;
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand(self, other: Self) -> Self { self.intersection(other) }
        }
        impl ::bitflags::__private::core::ops::BitAndAssign for
            InternalBitFlags {
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand_assign(&mut self, other: Self) {
                *self =
                    Self::from_bits_retain(self.bits()).intersection(other);
            }
        }
        impl ::bitflags::__private::core::ops::Sub for InternalBitFlags {
            type Output = Self;
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub(self, other: Self) -> Self { self.difference(other) }
        }
        impl ::bitflags::__private::core::ops::SubAssign for InternalBitFlags
            {
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub_assign(&mut self, other: Self) { self.remove(other); }
        }
        impl ::bitflags::__private::core::ops::Not for InternalBitFlags {
            type Output = Self;
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            fn not(self) -> Self { self.complement() }
        }
        impl ::bitflags::__private::core::iter::Extend<InternalBitFlags> for
            InternalBitFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn extend<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(&mut self, iterator: T) {
                for item in iterator { self.insert(item) }
            }
        }
        impl ::bitflags::__private::core::iter::FromIterator<InternalBitFlags>
            for InternalBitFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn from_iter<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(iterator: T) -> Self {
                use ::bitflags::__private::core::iter::Extend;
                let mut result = Self::empty();
                result.extend(iterator);
                result
            }
        }
        impl InternalBitFlags {
            /// Yield a set of contained flags values.
            ///
            /// Each yielded flags value will correspond to a defined named flag. Any unknown bits
            /// will be yielded together as a final flags value.
            #[inline]
            pub const fn iter(&self) -> ::bitflags::iter::Iter<DISPFlags> {
                ::bitflags::iter::Iter::__private_const_new(<DISPFlags as
                        ::bitflags::Flags>::FLAGS,
                    DISPFlags::from_bits_retain(self.bits()),
                    DISPFlags::from_bits_retain(self.bits()))
            }
            /// Yield a set of contained named flags values.
            ///
            /// This method is like [`iter`](#method.iter), except only yields bits in contained named flags.
            /// Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
            #[inline]
            pub const fn iter_names(&self)
                -> ::bitflags::iter::IterNames<DISPFlags> {
                ::bitflags::iter::IterNames::__private_const_new(<DISPFlags as
                        ::bitflags::Flags>::FLAGS,
                    DISPFlags::from_bits_retain(self.bits()),
                    DISPFlags::from_bits_retain(self.bits()))
            }
        }
        impl ::bitflags::__private::core::iter::IntoIterator for
            InternalBitFlags {
            type Item = DISPFlags;
            type IntoIter = ::bitflags::iter::Iter<DISPFlags>;
            fn into_iter(self) -> Self::IntoIter { self.iter() }
        }
        impl InternalBitFlags {
            /// Returns a mutable reference to the raw value of the flags currently stored.
            #[inline]
            pub fn bits_mut(&mut self) -> &mut u32 { &mut self.0 }
        }
        #[allow(dead_code, deprecated, unused_attributes)]
        impl DISPFlags {
            /// Get a flags value with all bits unset.
            #[inline]
            pub const fn empty() -> Self { Self(InternalBitFlags::empty()) }
            /// Get a flags value with all known bits set.
            #[inline]
            pub const fn all() -> Self { Self(InternalBitFlags::all()) }
            /// Get the underlying bits value.
            ///
            /// The returned value is exactly the bits set in this flags value.
            #[inline]
            pub const fn bits(&self) -> u32 { self.0.bits() }
            /// Convert from a bits value.
            ///
            /// This method will return `None` if any unknown bits are set.
            #[inline]
            pub const fn from_bits(bits: u32)
                -> ::bitflags::__private::core::option::Option<Self> {
                match InternalBitFlags::from_bits(bits) {
                    ::bitflags::__private::core::option::Option::Some(bits) =>
                        ::bitflags::__private::core::option::Option::Some(Self(bits)),
                    ::bitflags::__private::core::option::Option::None =>
                        ::bitflags::__private::core::option::Option::None,
                }
            }
            /// Convert from a bits value, unsetting any unknown bits.
            #[inline]
            pub const fn from_bits_truncate(bits: u32) -> Self {
                Self(InternalBitFlags::from_bits_truncate(bits))
            }
            /// Convert from a bits value exactly.
            #[inline]
            pub const fn from_bits_retain(bits: u32) -> Self {
                Self(InternalBitFlags::from_bits_retain(bits))
            }
            /// Get a flags value with the bits of a flag with the given name set.
            ///
            /// This method will return `None` if `name` is empty or doesn't
            /// correspond to any named flag.
            #[inline]
            pub fn from_name(name: &str)
                -> ::bitflags::__private::core::option::Option<Self> {
                match InternalBitFlags::from_name(name) {
                    ::bitflags::__private::core::option::Option::Some(bits) =>
                        ::bitflags::__private::core::option::Option::Some(Self(bits)),
                    ::bitflags::__private::core::option::Option::None =>
                        ::bitflags::__private::core::option::Option::None,
                }
            }
            /// Whether all bits in this flags value are unset.
            #[inline]
            pub const fn is_empty(&self) -> bool { self.0.is_empty() }
            /// Whether all known bits in this flags value are set.
            #[inline]
            pub const fn is_all(&self) -> bool { self.0.is_all() }
            /// Whether any set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn intersects(&self, other: Self) -> bool {
                self.0.intersects(other.0)
            }
            /// Whether all set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn contains(&self, other: Self) -> bool {
                self.0.contains(other.0)
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            pub fn insert(&mut self, other: Self) { self.0.insert(other.0) }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `remove` won't truncate `other`, but the `!` operator will.
            #[inline]
            pub fn remove(&mut self, other: Self) { self.0.remove(other.0) }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            pub fn toggle(&mut self, other: Self) { self.0.toggle(other.0) }
            /// Call `insert` when `value` is `true` or `remove` when `value` is `false`.
            #[inline]
            pub fn set(&mut self, other: Self, value: bool) {
                self.0.set(other.0, value)
            }
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn intersection(self, other: Self) -> Self {
                Self(self.0.intersection(other.0))
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn union(self, other: Self) -> Self {
                Self(self.0.union(other.0))
            }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            #[must_use]
            pub const fn difference(self, other: Self) -> Self {
                Self(self.0.difference(other.0))
            }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn symmetric_difference(self, other: Self) -> Self {
                Self(self.0.symmetric_difference(other.0))
            }
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            #[must_use]
            pub const fn complement(self) -> Self {
                Self(self.0.complement())
            }
        }
        impl ::bitflags::__private::core::fmt::Binary for DISPFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Binary::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::Octal for DISPFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Octal::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::LowerHex for DISPFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::LowerHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::UpperHex for DISPFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::UpperHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::ops::BitOr for DISPFlags {
            type Output = Self;
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor(self, other: DISPFlags) -> Self { self.union(other) }
        }
        impl ::bitflags::__private::core::ops::BitOrAssign for DISPFlags {
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor_assign(&mut self, other: Self) { self.insert(other); }
        }
        impl ::bitflags::__private::core::ops::BitXor for DISPFlags {
            type Output = Self;
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor(self, other: Self) -> Self {
                self.symmetric_difference(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitXorAssign for DISPFlags {
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor_assign(&mut self, other: Self) { self.toggle(other); }
        }
        impl ::bitflags::__private::core::ops::BitAnd for DISPFlags {
            type Output = Self;
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand(self, other: Self) -> Self { self.intersection(other) }
        }
        impl ::bitflags::__private::core::ops::BitAndAssign for DISPFlags {
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand_assign(&mut self, other: Self) {
                *self =
                    Self::from_bits_retain(self.bits()).intersection(other);
            }
        }
        impl ::bitflags::__private::core::ops::Sub for DISPFlags {
            type Output = Self;
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub(self, other: Self) -> Self { self.difference(other) }
        }
        impl ::bitflags::__private::core::ops::SubAssign for DISPFlags {
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub_assign(&mut self, other: Self) { self.remove(other); }
        }
        impl ::bitflags::__private::core::ops::Not for DISPFlags {
            type Output = Self;
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            fn not(self) -> Self { self.complement() }
        }
        impl ::bitflags::__private::core::iter::Extend<DISPFlags> for
            DISPFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn extend<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(&mut self, iterator: T) {
                for item in iterator { self.insert(item) }
            }
        }
        impl ::bitflags::__private::core::iter::FromIterator<DISPFlags> for
            DISPFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn from_iter<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(iterator: T) -> Self {
                use ::bitflags::__private::core::iter::Extend;
                let mut result = Self::empty();
                result.extend(iterator);
                result
            }
        }
        impl DISPFlags {
            /// Yield a set of contained flags values.
            ///
            /// Each yielded flags value will correspond to a defined named flag. Any unknown bits
            /// will be yielded together as a final flags value.
            #[inline]
            pub const fn iter(&self) -> ::bitflags::iter::Iter<DISPFlags> {
                ::bitflags::iter::Iter::__private_const_new(<DISPFlags as
                        ::bitflags::Flags>::FLAGS,
                    DISPFlags::from_bits_retain(self.bits()),
                    DISPFlags::from_bits_retain(self.bits()))
            }
            /// Yield a set of contained named flags values.
            ///
            /// This method is like [`iter`](#method.iter), except only yields bits in contained named flags.
            /// Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
            #[inline]
            pub const fn iter_names(&self)
                -> ::bitflags::iter::IterNames<DISPFlags> {
                ::bitflags::iter::IterNames::__private_const_new(<DISPFlags as
                        ::bitflags::Flags>::FLAGS,
                    DISPFlags::from_bits_retain(self.bits()),
                    DISPFlags::from_bits_retain(self.bits()))
            }
        }
        impl ::bitflags::__private::core::iter::IntoIterator for DISPFlags {
            type Item = DISPFlags;
            type IntoIter = ::bitflags::iter::Iter<DISPFlags>;
            fn into_iter(self) -> Self::IntoIter { self.iter() }
        }
    };Clone, #[automatically_derived]
impl ::core::marker::Copy for DISPFlags { }Copy, #[automatically_derived]
impl ::core::default::Default for DISPFlags {
    #[inline]
    fn default() -> DISPFlags {
        DISPFlags(::core::default::Default::default())
    }
}Default)]
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_fields_are_eq(&self) {
                let _: ::core::cmp::AssertParamIsEq<u64>;
            }
        }
        #[automatically_derived]
        impl ::core::cmp::PartialOrd for InternalBitFlags {
            #[inline]
            fn partial_cmp(&self, other: &InternalBitFlags)
                -> ::core::option::Option<::core::cmp::Ordering> {
                ::core::cmp::PartialOrd::partial_cmp(&self.0, &other.0)
            }
        }
        #[automatically_derived]
        impl ::core::cmp::Ord for InternalBitFlags {
            #[inline]
            fn cmp(&self, other: &InternalBitFlags) -> ::core::cmp::Ordering {
                ::core::cmp::Ord::cmp(&self.0, &other.0)
            }
        }
        #[automatically_derived]
        impl ::core::hash::Hash for InternalBitFlags {
            #[inline]
            fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
                ::core::hash::Hash::hash(&self.0, state)
            }
        }
        impl ::bitflags::__private::PublicFlags for AllocKindFlags {
            type Primitive = u64;
            type Internal = InternalBitFlags;
        }
        impl ::bitflags::__private::core::default::Default for
            InternalBitFlags {
            #[inline]
            fn default() -> Self { InternalBitFlags::empty() }
        }
        impl ::bitflags::__private::core::fmt::Debug for InternalBitFlags {
            fn fmt(&self,
                f: &mut ::bitflags::__private::core::fmt::Formatter<'_>)
                -> ::bitflags::__private::core::fmt::Result {
                if self.is_empty() {
                    f.write_fmt(format_args!("{0:#x}",
                            <u64 as ::bitflags::Bits>::EMPTY))
                } else {
                    ::bitflags::__private::core::fmt::Display::fmt(self, f)
                }
            }
        }
        impl ::bitflags::__private::core::fmt::Display for InternalBitFlags {
            fn fmt(&self,
                f: &mut ::bitflags::__private::core::fmt::Formatter<'_>)
                -> ::bitflags::__private::core::fmt::Result {
                ::bitflags::parser::to_writer(&AllocKindFlags(*self), f)
            }
        }
        impl ::bitflags::__private::core::str::FromStr for InternalBitFlags {
            type Err = ::bitflags::parser::ParseError;
            fn from_str(s: &str)
                ->
                    ::bitflags::__private::core::result::Result<Self,
                    Self::Err> {
                ::bitflags::parser::from_str::<AllocKindFlags>(s).map(|flags|
                        flags.0)
            }
        }
        impl ::bitflags::__private::core::convert::AsRef<u64> for
            InternalBitFlags {
            fn as_ref(&self) -> &u64 { &self.0 }
        }
        impl ::bitflags::__private::core::convert::From<u64> for
            InternalBitFlags {
            fn from(bits: u64) -> Self { Self::from_bits_retain(bits) }
        }
        #[allow(dead_code, deprecated, unused_attributes)]
        impl InternalBitFlags {
            /// Get a flags value with all bits unset.
            #[inline]
            pub const fn empty() -> Self {
                Self(<u64 as ::bitflags::Bits>::EMPTY)
            }
            /// Get a flags value with all known bits set.
            #[inline]
            pub const fn all() -> Self {
                let mut truncated = <u64 as ::bitflags::Bits>::EMPTY;
                let mut i = 0;
                {
                    {
                        let flag =
                            <AllocKindFlags as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <AllocKindFlags as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <AllocKindFlags as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <AllocKindFlags as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <AllocKindFlags as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <AllocKindFlags as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <AllocKindFlags as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                let _ = i;
                Self(truncated)
            }
            /// Get the underlying bits value.
            ///
            /// The returned value is exactly the bits set in this flags value.
            #[inline]
            pub const fn bits(&self) -> u64 { self.0 }
            /// Convert from a bits value.
            ///
            /// This method will return `None` if any unknown bits are set.
            #[inline]
            pub const fn from_bits(bits: u64)
                -> ::bitflags::__private::core::option::Option<Self> {
                let truncated = Self::from_bits_truncate(bits).0;
                if truncated == bits {
                    ::bitflags::__private::core::option::Option::Some(Self(bits))
                } else { ::bitflags::__private::core::option::Option::None }
            }
            /// Convert from a bits value, unsetting any unknown bits.
            #[inline]
            pub const fn from_bits_truncate(bits: u64) -> Self {
                Self(bits & Self::all().0)
            }
            /// Convert from a bits value exactly.
            #[inline]
            pub const fn from_bits_retain(bits: u64) -> Self { Self(bits) }
            /// Get a flags value with the bits of a flag with the given name set.
            ///
            /// This method will return `None` if `name` is empty or doesn't
            /// correspond to any named flag.
            #[inline]
            pub fn from_name(name: &str)
                -> ::bitflags::__private::core::option::Option<Self> {
                {
                    if name == "Unknown" {
                        return ::bitflags::__private::core::option::Option::Some(Self(AllocKindFlags::Unknown.bits()));
                    }
                };
                ;
                {
                    if name == "Alloc" {
                        return ::bitflags::__private::core::option::Option::Some(Self(AllocKindFlags::Alloc.bits()));
                    }
                };
                ;
                {
                    if name == "Realloc" {
                        return ::bitflags::__private::core::option::Option::Some(Self(AllocKindFlags::Realloc.bits()));
                    }
                };
                ;
                {
                    if name == "Free" {
                        return ::bitflags::__private::core::option::Option::Some(Self(AllocKindFlags::Free.bits()));
                    }
                };
                ;
                {
                    if name == "Uninitialized" {
                        return ::bitflags::__private::core::option::Option::Some(Self(AllocKindFlags::Uninitialized.bits()));
                    }
                };
                ;
                {
                    if name == "Zeroed" {
                        return ::bitflags::__private::core::option::Option::Some(Self(AllocKindFlags::Zeroed.bits()));
                    }
                };
                ;
                {
                    if name == "Aligned" {
                        return ::bitflags::__private::core::option::Option::Some(Self(AllocKindFlags::Aligned.bits()));
                    }
                };
                ;
                let _ = name;
                ::bitflags::__private::core::option::Option::None
            }
            /// Whether all bits in this flags value are unset.
            #[inline]
            pub const fn is_empty(&self) -> bool {
                self.0 == <u64 as ::bitflags::Bits>::EMPTY
            }
            /// Whether all known bits in this flags value are set.
            #[inline]
            pub const fn is_all(&self) -> bool {
                Self::all().0 | self.0 == self.0
            }
            /// Whether any set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn intersects(&self, other: Self) -> bool {
                self.0 & other.0 != <u64 as ::bitflags::Bits>::EMPTY
            }
            /// Whether all set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn contains(&self, other: Self) -> bool {
                self.0 & other.0 == other.0
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            pub fn insert(&mut self, other: Self) {
                *self = Self(self.0).union(other);
            }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `remove` won't truncate `other`, but the `!` operator will.
            #[inline]
            pub fn remove(&mut self, other: Self) {
                *self = Self(self.0).difference(other);
            }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            pub fn toggle(&mut self, other: Self) {
                *self = Self(self.0).symmetric_difference(other);
            }
            /// Call `insert` when `value` is `true` or `remove` when `value` is `false`.
            #[inline]
            pub fn set(&mut self, other: Self, value: bool) {
                if value { self.insert(other); } else { self.remove(other); }
            }
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn intersection(self, other: Self) -> Self {
                Self(self.0 & other.0)
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn union(self, other: Self) -> Self {
                Self(self.0 | other.0)
            }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            #[must_use]
            pub const fn difference(self, other: Self) -> Self {
                Self(self.0 & !other.0)
            }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn symmetric_difference(self, other: Self) -> Self {
                Self(self.0 ^ other.0)
            }
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            #[must_use]
            pub const fn complement(self) -> Self {
                Self::from_bits_truncate(!self.0)
            }
        }
        impl ::bitflags::__private::core::fmt::Binary for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Binary::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::Octal for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Octal::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::LowerHex for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::LowerHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::UpperHex for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::UpperHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::ops::BitOr for InternalBitFlags {
            type Output = Self;
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor(self, other: InternalBitFlags) -> Self {
                self.union(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitOrAssign for
            InternalBitFlags {
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor_assign(&mut self, other: Self) { self.insert(other); }
        }
        impl ::bitflags::__private::core::ops::BitXor for InternalBitFlags {
            type Output = Self;
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor(self, other: Self) -> Self {
                self.symmetric_difference(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitXorAssign for
            InternalBitFlags {
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor_assign(&mut self, other: Self) { self.toggle(other); }
        }
        impl ::bitflags::__private::core::ops::BitAnd for InternalBitFlags {
            type Output = Self;
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand(self, other: Self) -> Self { self.intersection(other) }
        }
        impl ::bitflags::__private::core::ops::BitAndAssign for
            InternalBitFlags {
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand_assign(&mut self, other: Self) {
                *self =
                    Self::from_bits_retain(self.bits()).intersection(other);
            }
        }
        impl ::bitflags::__private::core::ops::Sub for InternalBitFlags {
            type Output = Self;
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub(self, other: Self) -> Self { self.difference(other) }
        }
        impl ::bitflags::__private::core::ops::SubAssign for InternalBitFlags
            {
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub_assign(&mut self, other: Self) { self.remove(other); }
        }
        impl ::bitflags::__private::core::ops::Not for InternalBitFlags {
            type Output = Self;
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            fn not(self) -> Self { self.complement() }
        }
        impl ::bitflags::__private::core::iter::Extend<InternalBitFlags> for
            InternalBitFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn extend<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(&mut self, iterator: T) {
                for item in iterator { self.insert(item) }
            }
        }
        impl ::bitflags::__private::core::iter::FromIterator<InternalBitFlags>
            for InternalBitFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn from_iter<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(iterator: T) -> Self {
                use ::bitflags::__private::core::iter::Extend;
                let mut result = Self::empty();
                result.extend(iterator);
                result
            }
        }
        impl InternalBitFlags {
            /// Yield a set of contained flags values.
            ///
            /// Each yielded flags value will correspond to a defined named flag. Any unknown bits
            /// will be yielded together as a final flags value.
            #[inline]
            pub const fn iter(&self)
                -> ::bitflags::iter::Iter<AllocKindFlags> {
                ::bitflags::iter::Iter::__private_const_new(<AllocKindFlags as
                        ::bitflags::Flags>::FLAGS,
                    AllocKindFlags::from_bits_retain(self.bits()),
                    AllocKindFlags::from_bits_retain(self.bits()))
            }
            /// Yield a set of contained named flags values.
            ///
            /// This method is like [`iter`](#method.iter), except only yields bits in contained named flags.
            /// Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
            #[inline]
            pub const fn iter_names(&self)
                -> ::bitflags::iter::IterNames<AllocKindFlags> {
                ::bitflags::iter::IterNames::__private_const_new(<AllocKindFlags
                        as ::bitflags::Flags>::FLAGS,
                    AllocKindFlags::from_bits_retain(self.bits()),
                    AllocKindFlags::from_bits_retain(self.bits()))
            }
        }
        impl ::bitflags::__private::core::iter::IntoIterator for
            InternalBitFlags {
            type Item = AllocKindFlags;
            type IntoIter = ::bitflags::iter::Iter<AllocKindFlags>;
            fn into_iter(self) -> Self::IntoIter { self.iter() }
        }
        impl InternalBitFlags {
            /// Returns a mutable reference to the raw value of the flags currently stored.
            #[inline]
            pub fn bits_mut(&mut self) -> &mut u64 { &mut self.0 }
        }
        #[allow(dead_code, deprecated, unused_attributes)]
        impl AllocKindFlags {
            /// Get a flags value with all bits unset.
            #[inline]
            pub const fn empty() -> Self { Self(InternalBitFlags::empty()) }
            /// Get a flags value with all known bits set.
            #[inline]
            pub const fn all() -> Self { Self(InternalBitFlags::all()) }
            /// Get the underlying bits value.
            ///
            /// The returned value is exactly the bits set in this flags value.
            #[inline]
            pub const fn bits(&self) -> u64 { self.0.bits() }
            /// Convert from a bits value.
            ///
            /// This method will return `None` if any unknown bits are set.
            #[inline]
            pub const fn from_bits(bits: u64)
                -> ::bitflags::__private::core::option::Option<Self> {
                match InternalBitFlags::from_bits(bits) {
                    ::bitflags::__private::core::option::Option::Some(bits) =>
                        ::bitflags::__private::core::option::Option::Some(Self(bits)),
                    ::bitflags::__private::core::option::Option::None =>
                        ::bitflags::__private::core::option::Option::None,
                }
            }
            /// Convert from a bits value, unsetting any unknown bits.
            #[inline]
            pub const fn from_bits_truncate(bits: u64) -> Self {
                Self(InternalBitFlags::from_bits_truncate(bits))
            }
            /// Convert from a bits value exactly.
            #[inline]
            pub const fn from_bits_retain(bits: u64) -> Self {
                Self(InternalBitFlags::from_bits_retain(bits))
            }
            /// Get a flags value with the bits of a flag with the given name set.
            ///
            /// This method will return `None` if `name` is empty or doesn't
            /// correspond to any named flag.
            #[inline]
            pub fn from_name(name: &str)
                -> ::bitflags::__private::core::option::Option<Self> {
                match InternalBitFlags::from_name(name) {
                    ::bitflags::__private::core::option::Option::Some(bits) =>
                        ::bitflags::__private::core::option::Option::Some(Self(bits)),
                    ::bitflags::__private::core::option::Option::None =>
                        ::bitflags::__private::core::option::Option::None,
                }
            }
            /// Whether all bits in this flags value are unset.
            #[inline]
            pub const fn is_empty(&self) -> bool { self.0.is_empty() }
            /// Whether all known bits in this flags value are set.
            #[inline]
            pub const fn is_all(&self) -> bool { self.0.is_all() }
            /// Whether any set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn intersects(&self, other: Self) -> bool {
                self.0.intersects(other.0)
            }
            /// Whether all set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn contains(&self, other: Self) -> bool {
                self.0.contains(other.0)
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            pub fn insert(&mut self, other: Self) { self.0.insert(other.0) }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `remove` won't truncate `other`, but the `!` operator will.
            #[inline]
            pub fn remove(&mut self, other: Self) { self.0.remove(other.0) }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            pub fn toggle(&mut self, other: Self) { self.0.toggle(other.0) }
            /// Call `insert` when `value` is `true` or `remove` when `value` is `false`.
            #[inline]
            pub fn set(&mut self, other: Self, value: bool) {
                self.0.set(other.0, value)
            }
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn intersection(self, other: Self) -> Self {
                Self(self.0.intersection(other.0))
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn union(self, other: Self) -> Self {
                Self(self.0.union(other.0))
            }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            #[must_use]
            pub const fn difference(self, other: Self) -> Self {
                Self(self.0.difference(other.0))
            }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn symmetric_difference(self, other: Self) -> Self {
                Self(self.0.symmetric_difference(other.0))
            }
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            #[must_use]
            pub const fn complement(self) -> Self {
                Self(self.0.complement())
            }
        }
        impl ::bitflags::__private::core::fmt::Binary for AllocKindFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Binary::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::Octal for AllocKindFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Octal::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::LowerHex for AllocKindFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::LowerHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::UpperHex for AllocKindFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::UpperHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::ops::BitOr for AllocKindFlags {
            type Output = Self;
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor(self, other: AllocKindFlags) -> Self {
                self.union(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitOrAssign for AllocKindFlags
            {
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor_assign(&mut self, other: Self) { self.insert(other); }
        }
        impl ::bitflags::__private::core::ops::BitXor for AllocKindFlags {
            type Output = Self;
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor(self, other: Self) -> Self {
                self.symmetric_difference(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitXorAssign for AllocKindFlags
            {
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor_assign(&mut self, other: Self) { self.toggle(other); }
        }
        impl ::bitflags::__private::core::ops::BitAnd for AllocKindFlags {
            type Output = Self;
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand(self, other: Self) -> Self { self.intersection(other) }
        }
        impl ::bitflags::__private::core::ops::BitAndAssign for AllocKindFlags
            {
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand_assign(&mut self, other: Self) {
                *self =
                    Self::from_bits_retain(self.bits()).intersection(other);
            }
        }
        impl ::bitflags::__private::core::ops::Sub for AllocKindFlags {
            type Output = Self;
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub(self, other: Self) -> Self { self.difference(other) }
        }
        impl ::bitflags::__private::core::ops::SubAssign for AllocKindFlags {
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub_assign(&mut self, other: Self) { self.remove(other); }
        }
        impl ::bitflags::__private::core::ops::Not for AllocKindFlags {
            type Output = Self;
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            fn not(self) -> Self { self.complement() }
        }
        impl ::bitflags::__private::core::iter::Extend<AllocKindFlags> for
            AllocKindFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn extend<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(&mut self, iterator: T) {
                for item in iterator { self.insert(item) }
            }
        }
        impl ::bitflags::__private::core::iter::FromIterator<AllocKindFlags>
            for AllocKindFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn from_iter<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(iterator: T) -> Self {
                use ::bitflags::__private::core::iter::Extend;
                let mut result = Self::empty();
                result.extend(iterator);
                result
            }
        }
        impl AllocKindFlags {
            /// Yield a set of contained flags values.
            ///
            /// Each yielded flags value will correspond to a defined named flag. Any unknown bits
            /// will be yielded together as a final flags value.
            #[inline]
            pub const fn iter(&self)
                -> ::bitflags::iter::Iter<AllocKindFlags> {
                ::bitflags::iter::Iter::__private_const_new(<AllocKindFlags as
                        ::bitflags::Flags>::FLAGS,
                    AllocKindFlags::from_bits_retain(self.bits()),
                    AllocKindFlags::from_bits_retain(self.bits()))
            }
            /// Yield a set of contained named flags values.
            ///
            /// This method is like [`iter`](#method.iter), except only yields bits in contained named flags.
            /// Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
            #[inline]
            pub const fn iter_names(&self)
                -> ::bitflags::iter::IterNames<AllocKindFlags> {
                ::bitflags::iter::IterNames::__private_const_new(<AllocKindFlags
                        as ::bitflags::Flags>::FLAGS,
                    AllocKindFlags::from_bits_retain(self.bits()),
                    AllocKindFlags::from_bits_retain(self.bits()))
            }
        }
        impl ::bitflags::__private::core::iter::IntoIterator for
            AllocKindFlags {
            type Item = AllocKindFlags;
            type IntoIter = ::bitflags::iter::Iter<AllocKindFlags>;
            fn into_iter(self) -> Self::IntoIter { self.iter() }
        }
    };bitflags! {
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_fields_are_eq(&self) {
                let _: ::core::cmp::AssertParamIsEq<c_uint>;
            }
        }
        #[automatically_derived]
        impl ::core::cmp::PartialOrd for InternalBitFlags {
            #[inline]
            fn partial_cmp(&self, other: &InternalBitFlags)
                -> ::core::option::Option<::core::cmp::Ordering> {
                ::core::cmp::PartialOrd::partial_cmp(&self.0, &other.0)
            }
        }
        #[automatically_derived]
        impl ::core::cmp::Ord for InternalBitFlags {
            #[inline]
            fn cmp(&self, other: &InternalBitFlags) -> ::core::cmp::Ordering {
                ::core::cmp::Ord::cmp(&self.0, &other.0)
            }
        }
        #[automatically_derived]
        impl ::core::hash::Hash for InternalBitFlags {
            #[inline]
            fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
                ::core::hash::Hash::hash(&self.0, state)
            }
        }
        impl ::bitflags::__private::PublicFlags for GEPNoWrapFlags {
            type Primitive = c_uint;
            type Internal = InternalBitFlags;
        }
        impl ::bitflags::__private::core::default::Default for
            InternalBitFlags {
            #[inline]
            fn default() -> Self { InternalBitFlags::empty() }
        }
        impl ::bitflags::__private::core::fmt::Debug for InternalBitFlags {
            fn fmt(&self,
                f: &mut ::bitflags::__private::core::fmt::Formatter<'_>)
                -> ::bitflags::__private::core::fmt::Result {
                if self.is_empty() {
                    f.write_fmt(format_args!("{0:#x}",
                            <c_uint as ::bitflags::Bits>::EMPTY))
                } else {
                    ::bitflags::__private::core::fmt::Display::fmt(self, f)
                }
            }
        }
        impl ::bitflags::__private::core::fmt::Display for InternalBitFlags {
            fn fmt(&self,
                f: &mut ::bitflags::__private::core::fmt::Formatter<'_>)
                -> ::bitflags::__private::core::fmt::Result {
                ::bitflags::parser::to_writer(&GEPNoWrapFlags(*self), f)
            }
        }
        impl ::bitflags::__private::core::str::FromStr for InternalBitFlags {
            type Err = ::bitflags::parser::ParseError;
            fn from_str(s: &str)
                ->
                    ::bitflags::__private::core::result::Result<Self,
                    Self::Err> {
                ::bitflags::parser::from_str::<GEPNoWrapFlags>(s).map(|flags|
                        flags.0)
            }
        }
        impl ::bitflags::__private::core::convert::AsRef<c_uint> for
            InternalBitFlags {
            fn as_ref(&self) -> &c_uint { &self.0 }
        }
        impl ::bitflags::__private::core::convert::From<c_uint> for
            InternalBitFlags {
            fn from(bits: c_uint) -> Self { Self::from_bits_retain(bits) }
        }
        #[allow(dead_code, deprecated, unused_attributes)]
        impl InternalBitFlags {
            /// Get a flags value with all bits unset.
            #[inline]
            pub const fn empty() -> Self {
                Self(<c_uint as ::bitflags::Bits>::EMPTY)
            }
            /// Get a flags value with all known bits set.
            #[inline]
            pub const fn all() -> Self {
                let mut truncated = <c_uint as ::bitflags::Bits>::EMPTY;
                let mut i = 0;
                {
                    {
                        let flag =
                            <GEPNoWrapFlags as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <GEPNoWrapFlags as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <GEPNoWrapFlags as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                let _ = i;
                Self(truncated)
            }
            /// Get the underlying bits value.
            ///
            /// The returned value is exactly the bits set in this flags value.
            #[inline]
            pub const fn bits(&self) -> c_uint { self.0 }
            /// Convert from a bits value.
            ///
            /// This method will return `None` if any unknown bits are set.
            #[inline]
            pub const fn from_bits(bits: c_uint)
                -> ::bitflags::__private::core::option::Option<Self> {
                let truncated = Self::from_bits_truncate(bits).0;
                if truncated == bits {
                    ::bitflags::__private::core::option::Option::Some(Self(bits))
                } else { ::bitflags::__private::core::option::Option::None }
            }
            /// Convert from a bits value, unsetting any unknown bits.
            #[inline]
            pub const fn from_bits_truncate(bits: c_uint) -> Self {
                Self(bits & Self::all().0)
            }
            /// Convert from a bits value exactly.
            #[inline]
            pub const fn from_bits_retain(bits: c_uint) -> Self { Self(bits) }
            /// Get a flags value with the bits of a flag with the given name set.
            ///
            /// This method will return `None` if `name` is empty or doesn't
            /// correspond to any named flag.
            #[inline]
            pub fn from_name(name: &str)
                -> ::bitflags::__private::core::option::Option<Self> {
                {
                    if name == "InBounds" {
                        return ::bitflags::__private::core::option::Option::Some(Self(GEPNoWrapFlags::InBounds.bits()));
                    }
                };
                ;
                {
                    if name == "NUSW" {
                        return ::bitflags::__private::core::option::Option::Some(Self(GEPNoWrapFlags::NUSW.bits()));
                    }
                };
                ;
                {
                    if name == "NUW" {
                        return ::bitflags::__private::core::option::Option::Some(Self(GEPNoWrapFlags::NUW.bits()));
                    }
                };
                ;
                let _ = name;
                ::bitflags::__private::core::option::Option::None
            }
            /// Whether all bits in this flags value are unset.
            #[inline]
            pub const fn is_empty(&self) -> bool {
                self.0 == <c_uint as ::bitflags::Bits>::EMPTY
            }
            /// Whether all known bits in this flags value are set.
            #[inline]
            pub const fn is_all(&self) -> bool {
                Self::all().0 | self.0 == self.0
            }
            /// Whether any set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn intersects(&self, other: Self) -> bool {
                self.0 & other.0 != <c_uint as ::bitflags::Bits>::EMPTY
            }
            /// Whether all set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn contains(&self, other: Self) -> bool {
                self.0 & other.0 == other.0
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            pub fn insert(&mut self, other: Self) {
                *self = Self(self.0).union(other);
            }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `remove` won't truncate `other`, but the `!` operator will.
            #[inline]
            pub fn remove(&mut self, other: Self) {
                *self = Self(self.0).difference(other);
            }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            pub fn toggle(&mut self, other: Self) {
                *self = Self(self.0).symmetric_difference(other);
            }
            /// Call `insert` when `value` is `true` or `remove` when `value` is `false`.
            #[inline]
            pub fn set(&mut self, other: Self, value: bool) {
                if value { self.insert(other); } else { self.remove(other); }
            }
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn intersection(self, other: Self) -> Self {
                Self(self.0 & other.0)
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn union(self, other: Self) -> Self {
                Self(self.0 | other.0)
            }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            #[must_use]
            pub const fn difference(self, other: Self) -> Self {
                Self(self.0 & !other.0)
            }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn symmetric_difference(self, other: Self) -> Self {
                Self(self.0 ^ other.0)
            }
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            #[must_use]
            pub const fn complement(self) -> Self {
                Self::from_bits_truncate(!self.0)
            }
        }
        impl ::bitflags::__private::core::fmt::Binary for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Binary::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::Octal for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Octal::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::LowerHex for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::LowerHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::UpperHex for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::UpperHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::ops::BitOr for InternalBitFlags {
            type Output = Self;
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor(self, other: InternalBitFlags) -> Self {
                self.union(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitOrAssign for
            InternalBitFlags {
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor_assign(&mut self, other: Self) { self.insert(other); }
        }
        impl ::bitflags::__private::core::ops::BitXor for InternalBitFlags {
            type Output = Self;
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor(self, other: Self) -> Self {
                self.symmetric_difference(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitXorAssign for
            InternalBitFlags {
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor_assign(&mut self, other: Self) { self.toggle(other); }
        }
        impl ::bitflags::__private::core::ops::BitAnd for InternalBitFlags {
            type Output = Self;
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand(self, other: Self) -> Self { self.intersection(other) }
        }
        impl ::bitflags::__private::core::ops::BitAndAssign for
            InternalBitFlags {
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand_assign(&mut self, other: Self) {
                *self =
                    Self::from_bits_retain(self.bits()).intersection(other);
            }
        }
        impl ::bitflags::__private::core::ops::Sub for InternalBitFlags {
            type Output = Self;
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub(self, other: Self) -> Self { self.difference(other) }
        }
        impl ::bitflags::__private::core::ops::SubAssign for InternalBitFlags
            {
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub_assign(&mut self, other: Self) { self.remove(other); }
        }
        impl ::bitflags::__private::core::ops::Not for InternalBitFlags {
            type Output = Self;
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            fn not(self) -> Self { self.complement() }
        }
        impl ::bitflags::__private::core::iter::Extend<InternalBitFlags> for
            InternalBitFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn extend<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(&mut self, iterator: T) {
                for item in iterator { self.insert(item) }
            }
        }
        impl ::bitflags::__private::core::iter::FromIterator<InternalBitFlags>
            for InternalBitFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn from_iter<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(iterator: T) -> Self {
                use ::bitflags::__private::core::iter::Extend;
                let mut result = Self::empty();
                result.extend(iterator);
                result
            }
        }
        impl InternalBitFlags {
            /// Yield a set of contained flags values.
            ///
            /// Each yielded flags value will correspond to a defined named flag. Any unknown bits
            /// will be yielded together as a final flags value.
            #[inline]
            pub const fn iter(&self)
                -> ::bitflags::iter::Iter<GEPNoWrapFlags> {
                ::bitflags::iter::Iter::__private_const_new(<GEPNoWrapFlags as
                        ::bitflags::Flags>::FLAGS,
                    GEPNoWrapFlags::from_bits_retain(self.bits()),
                    GEPNoWrapFlags::from_bits_retain(self.bits()))
            }
            /// Yield a set of contained named flags values.
            ///
            /// This method is like [`iter`](#method.iter), except only yields bits in contained named flags.
            /// Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
            #[inline]
            pub const fn iter_names(&self)
                -> ::bitflags::iter::IterNames<GEPNoWrapFlags> {
                ::bitflags::iter::IterNames::__private_const_new(<GEPNoWrapFlags
                        as ::bitflags::Flags>::FLAGS,
                    GEPNoWrapFlags::from_bits_retain(self.bits()),
                    GEPNoWrapFlags::from_bits_retain(self.bits()))
            }
        }
        impl ::bitflags::__private::core::iter::IntoIterator for
            InternalBitFlags {
            type Item = GEPNoWrapFlags;
            type IntoIter = ::bitflags::iter::Iter<GEPNoWrapFlags>;
            fn into_iter(self) -> Self::IntoIter { self.iter() }
        }
        impl InternalBitFlags {
            /// Returns a mutable reference to the raw value of the flags currently stored.
            #[inline]
            pub fn bits_mut(&mut self) -> &mut c_uint { &mut self.0 }
        }
        #[allow(dead_code, deprecated, unused_attributes)]
        impl GEPNoWrapFlags {
            /// Get a flags value with all bits unset.
            #[inline]
            pub const fn empty() -> Self { Self(InternalBitFlags::empty()) }
            /// Get a flags value with all known bits set.
            #[inline]
            pub const fn all() -> Self { Self(InternalBitFlags::all()) }
            /// Get the underlying bits value.
            ///
            /// The returned value is exactly the bits set in this flags value.
            #[inline]
            pub const fn bits(&self) -> c_uint { self.0.bits() }
            /// Convert from a bits value.
            ///
            /// This method will return `None` if any unknown bits are set.
            #[inline]
            pub const fn from_bits(bits: c_uint)
                -> ::bitflags::__private::core::option::Option<Self> {
                match InternalBitFlags::from_bits(bits) {
                    ::bitflags::__private::core::option::Option::Some(bits) =>
                        ::bitflags::__private::core::option::Option::Some(Self(bits)),
                    ::bitflags::__private::core::option::Option::None =>
                        ::bitflags::__private::core::option::Option::None,
                }
            }
            /// Convert from a bits value, unsetting any unknown bits.
            #[inline]
            pub const fn from_bits_truncate(bits: c_uint) -> Self {
                Self(InternalBitFlags::from_bits_truncate(bits))
            }
            /// Convert from a bits value exactly.
            #[inline]
            pub const fn from_bits_retain(bits: c_uint) -> Self {
                Self(InternalBitFlags::from_bits_retain(bits))
            }
            /// Get a flags value with the bits of a flag with the given name set.
            ///
            /// This method will return `None` if `name` is empty or doesn't
            /// correspond to any named flag.
            #[inline]
            pub fn from_name(name: &str)
                -> ::bitflags::__private::core::option::Option<Self> {
                match InternalBitFlags::from_name(name) {
                    ::bitflags::__private::core::option::Option::Some(bits) =>
                        ::bitflags::__private::core::option::Option::Some(Self(bits)),
                    ::bitflags::__private::core::option::Option::None =>
                        ::bitflags::__private::core::option::Option::None,
                }
            }
            /// Whether all bits in this flags value are unset.
            #[inline]
            pub const fn is_empty(&self) -> bool { self.0.is_empty() }
            /// Whether all known bits in this flags value are set.
            #[inline]
            pub const fn is_all(&self) -> bool { self.0.is_all() }
            /// Whether any set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn intersects(&self, other: Self) -> bool {
                self.0.intersects(other.0)
            }
            /// Whether all set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn contains(&self, other: Self) -> bool {
                self.0.contains(other.0)
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            pub fn insert(&mut self, other: Self) { self.0.insert(other.0) }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `remove` won't truncate `other`, but the `!` operator will.
            #[inline]
            pub fn remove(&mut self, other: Self) { self.0.remove(other.0) }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            pub fn toggle(&mut self, other: Self) { self.0.toggle(other.0) }
            /// Call `insert` when `value` is `true` or `remove` when `value` is `false`.
            #[inline]
            pub fn set(&mut self, other: Self, value: bool) {
                self.0.set(other.0, value)
            }
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn intersection(self, other: Self) -> Self {
                Self(self.0.intersection(other.0))
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn union(self, other: Self) -> Self {
                Self(self.0.union(other.0))
            }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            #[must_use]
            pub const fn difference(self, other: Self) -> Self {
                Self(self.0.difference(other.0))
            }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn symmetric_difference(self, other: Self) -> Self {
                Self(self.0.symmetric_difference(other.0))
            }
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            #[must_use]
            pub const fn complement(self) -> Self {
                Self(self.0.complement())
            }
        }
        impl ::bitflags::__private::core::fmt::Binary for GEPNoWrapFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Binary::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::Octal for GEPNoWrapFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Octal::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::LowerHex for GEPNoWrapFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::LowerHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::UpperHex for GEPNoWrapFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::UpperHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::ops::BitOr for GEPNoWrapFlags {
            type Output = Self;
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor(self, other: GEPNoWrapFlags) -> Self {
                self.union(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitOrAssign for GEPNoWrapFlags
            {
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor_assign(&mut self, other: Self) { self.insert(other); }
        }
        impl ::bitflags::__private::core::ops::BitXor for GEPNoWrapFlags {
            type Output = Self;
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor(self, other: Self) -> Self {
                self.symmetric_difference(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitXorAssign for GEPNoWrapFlags
            {
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor_assign(&mut self, other: Self) { self.toggle(other); }
        }
        impl ::bitflags::__private::core::ops::BitAnd for GEPNoWrapFlags {
            type Output = Self;
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand(self, other: Self) -> Self { self.intersection(other) }
        }
        impl ::bitflags::__private::core::ops::BitAndAssign for GEPNoWrapFlags
            {
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand_assign(&mut self, other: Self) {
                *self =
                    Self::from_bits_retain(self.bits()).intersection(other);
            }
        }
        impl ::bitflags::__private::core::ops::Sub for GEPNoWrapFlags {
            type Output = Self;
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub(self, other: Self) -> Self { self.difference(other) }
        }
        impl ::bitflags::__private::core::ops::SubAssign for GEPNoWrapFlags {
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub_assign(&mut self, other: Self) { self.remove(other); }
        }
        impl ::bitflags::__private::core::ops::Not for GEPNoWrapFlags {
            type Output = Self;
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            fn not(self) -> Self { self.complement() }
        }
        impl ::bitflags::__private::core::iter::Extend<GEPNoWrapFlags> for
            GEPNoWrapFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn extend<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(&mut self, iterator: T) {
                for item in iterator { self.insert(item) }
            }
        }
        impl ::bitflags::__private::core::iter::FromIterator<GEPNoWrapFlags>
            for GEPNoWrapFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn from_iter<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(iterator: T) -> Self {
                use ::bitflags::__private::core::iter::Extend;
                let mut result = Self::empty();
                result.extend(iterator);
                result
            }
        }
        impl GEPNoWrapFlags {
            /// Yield a set of contained flags values.
            ///
            /// Each yielded flags value will correspond to a defined named flag. Any unknown bits
            /// will be yielded together as a final flags value.
            #[inline]
            pub const fn iter(&self)
                -> ::bitflags::iter::Iter<GEPNoWrapFlags> {
                ::bitflags::iter::Iter::__private_const_new(<GEPNoWrapFlags as
                        ::bitflags::Flags>::FLAGS,
                    GEPNoWrapFlags::from_bits_retain(self.bits()),
                    GEPNoWrapFlags::from_bits_retain(self.bits()))
            }
            /// Yield a set of contained named flags values.
            ///
            /// This method is like [`iter`](#method.iter), except only yields bits in contained named flags.
            /// Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
            #[inline]
            pub const fn iter_names(&self)
                -> ::bitflags::iter::IterNames<GEPNoWrapFlags> {
                ::bitflags::iter::IterNames::__private_const_new(<GEPNoWrapFlags
                        as ::bitflags::Flags>::FLAGS,
                    GEPNoWrapFlags::from_bits_retain(self.bits()),
                    GEPNoWrapFlags::from_bits_retain(self.bits()))
            }
        }
        impl ::bitflags::__private::core::iter::IntoIterator for
            GEPNoWrapFlags {
            type Item = GEPNoWrapFlags;
            type IntoIter = ::bitflags::iter::Iter<GEPNoWrapFlags>;
            fn into_iter(self) -> Self::IntoIter { self.iter() }
        }
    };bitflags! {
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 Buffer;
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    pub(crate) fn LLVMRustSetNoSignedZeros(Instr: &Value);
2052
2053    // Miscellaneous instructions
2054    pub(crate) fn LLVMRustBuildMemCpy<'a>(
2055        B: &Builder<'a>,
2056        Dst: &'a Value,
2057        DstAlign: c_uint,
2058        Src: &'a Value,
2059        SrcAlign: c_uint,
2060        Size: &'a Value,
2061        IsVolatile: bool,
2062    ) -> &'a Value;
2063    pub(crate) fn LLVMRustBuildMemMove<'a>(
2064        B: &Builder<'a>,
2065        Dst: &'a Value,
2066        DstAlign: c_uint,
2067        Src: &'a Value,
2068        SrcAlign: c_uint,
2069        Size: &'a Value,
2070        IsVolatile: bool,
2071    ) -> &'a Value;
2072    pub(crate) fn LLVMRustBuildMemSet<'a>(
2073        B: &Builder<'a>,
2074        Dst: &'a Value,
2075        DstAlign: c_uint,
2076        Val: &'a Value,
2077        Size: &'a Value,
2078        IsVolatile: bool,
2079    ) -> &'a Value;
2080
2081    pub(crate) fn LLVMRustTimeTraceProfilerInitialize();
2082
2083    pub(crate) fn LLVMRustTimeTraceProfilerFinishThread();
2084
2085    pub(crate) fn LLVMRustTimeTraceProfilerFinish(FileName: *const c_char);
2086
2087    /// Returns a string describing the last error caused by an LLVMRust* call.
2088    pub(crate) fn LLVMRustGetLastError() -> *const c_char;
2089
2090    /// Prints the timing information collected by `-Ztime-llvm-passes`.
2091    pub(crate) fn LLVMRustPrintPassTimings(OutStr: &RustString);
2092
2093    /// Prints the statistics collected by `-Zprint-codegen-stats`.
2094    pub(crate) fn LLVMRustPrintStatistics(OutStr: &RustString);
2095
2096    pub(crate) fn LLVMRustInlineAsmVerify(
2097        Ty: &Type,
2098        Constraints: *const c_uchar, // See "PTR_LEN_STR".
2099        ConstraintsLen: size_t,
2100    ) -> bool;
2101
2102    /// A list of pointer-length strings is passed as two pointer-length slices,
2103    /// one slice containing pointers and one slice containing their corresponding
2104    /// lengths. The implementation will check that both slices have the same length.
2105    pub(crate) fn LLVMRustCoverageWriteFilenamesToBuffer(
2106        Filenames: *const *const c_uchar, // See "PTR_LEN_STR".
2107        FilenamesLen: size_t,
2108        Lengths: *const size_t,
2109        LengthsLen: size_t,
2110        BufferOut: &RustString,
2111    );
2112
2113    pub(crate) fn LLVMRustCoverageWriteFunctionMappingsToBuffer(
2114        VirtualFileMappingIDs: *const c_uint,
2115        NumVirtualFileMappingIDs: size_t,
2116        Expressions: *const crate::coverageinfo::ffi::CounterExpression,
2117        NumExpressions: size_t,
2118        CodeRegions: *const crate::coverageinfo::ffi::CodeRegion,
2119        NumCodeRegions: size_t,
2120        ExpansionRegions: *const crate::coverageinfo::ffi::ExpansionRegion,
2121        NumExpansionRegions: size_t,
2122        BranchRegions: *const crate::coverageinfo::ffi::BranchRegion,
2123        NumBranchRegions: size_t,
2124        BufferOut: &RustString,
2125    );
2126
2127    pub(crate) fn LLVMRustCoverageCreatePGOFuncNameVar(
2128        F: &Value,
2129        FuncName: *const c_uchar, // See "PTR_LEN_STR".
2130        FuncNameLen: size_t,
2131    ) -> &Value;
2132    pub(crate) fn LLVMRustCoverageHashBytes(
2133        Bytes: *const c_uchar, // See "PTR_LEN_STR".
2134        NumBytes: size_t,
2135    ) -> u64;
2136
2137    pub(crate) safe fn LLVMRustCoverageWriteCovmapSectionNameToString(
2138        M: &Module,
2139        OutStr: &RustString,
2140    );
2141    pub(crate) safe fn LLVMRustCoverageWriteCovfunSectionNameToString(
2142        M: &Module,
2143        OutStr: &RustString,
2144    );
2145    pub(crate) safe fn LLVMRustCoverageWriteCovmapVarNameToString(OutStr: &RustString);
2146
2147    pub(crate) safe fn LLVMRustCoverageMappingVersion() -> u32;
2148    pub(crate) fn LLVMRustDebugMetadataVersion() -> u32;
2149    pub(crate) fn LLVMRustVersionMajor() -> u32;
2150    pub(crate) fn LLVMRustVersionMinor() -> u32;
2151    pub(crate) fn LLVMRustVersionPatch() -> u32;
2152
2153    /// Add LLVM module flags.
2154    ///
2155    /// In order for Rust-C LTO to work, module flags must be compatible with Clang. What
2156    /// "compatible" means depends on the merge behaviors involved.
2157    pub(crate) fn LLVMRustAddModuleFlagU32(
2158        M: &Module,
2159        MergeBehavior: ModuleFlagMergeBehavior,
2160        Name: *const c_char,
2161        NameLen: size_t,
2162        Value: u32,
2163    );
2164
2165    pub(crate) fn LLVMRustAddModuleFlagString(
2166        M: &Module,
2167        MergeBehavior: ModuleFlagMergeBehavior,
2168        Name: *const c_char,
2169        NameLen: size_t,
2170        Value: *const c_char,
2171        ValueLen: size_t,
2172    );
2173
2174    pub(crate) fn LLVMRustDIBuilderCreateCompileUnit<'a>(
2175        Builder: &DIBuilder<'a>,
2176        Lang: c_uint,
2177        File: &'a DIFile,
2178        Producer: *const c_char,
2179        ProducerLen: size_t,
2180        isOptimized: bool,
2181        Flags: *const c_char,
2182        RuntimeVer: c_uint,
2183        SplitName: *const c_char,
2184        SplitNameLen: size_t,
2185        kind: DebugEmissionKind,
2186        DWOId: u64,
2187        SplitDebugInlining: bool,
2188        DebugNameTableKind: DebugNameTableKind,
2189    ) -> &'a DIDescriptor;
2190
2191    pub(crate) fn LLVMRustDIBuilderCreateFile<'a>(
2192        Builder: &DIBuilder<'a>,
2193        Filename: *const c_char,
2194        FilenameLen: size_t,
2195        Directory: *const c_char,
2196        DirectoryLen: size_t,
2197        CSKind: ChecksumKind,
2198        Checksum: *const c_char,
2199        ChecksumLen: size_t,
2200        Source: *const c_char,
2201        SourceLen: size_t,
2202    ) -> &'a DIFile;
2203
2204    pub(crate) fn LLVMRustDIBuilderCreateFunction<'a>(
2205        Builder: &DIBuilder<'a>,
2206        Scope: &'a DIDescriptor,
2207        Name: *const c_char,
2208        NameLen: size_t,
2209        LinkageName: *const c_char,
2210        LinkageNameLen: size_t,
2211        File: &'a DIFile,
2212        LineNo: c_uint,
2213        Ty: &'a DIType,
2214        ScopeLine: c_uint,
2215        Flags: DIFlags,
2216        SPFlags: DISPFlags,
2217        MaybeFn: Option<&'a Value>,
2218        TParam: &'a DIArray,
2219        Decl: Option<&'a DIDescriptor>,
2220    ) -> &'a DISubprogram;
2221
2222    pub(crate) fn LLVMRustDIBuilderCreateMethod<'a>(
2223        Builder: &DIBuilder<'a>,
2224        Scope: &'a DIDescriptor,
2225        Name: *const c_char,
2226        NameLen: size_t,
2227        LinkageName: *const c_char,
2228        LinkageNameLen: size_t,
2229        File: &'a DIFile,
2230        LineNo: c_uint,
2231        Ty: &'a DIType,
2232        Flags: DIFlags,
2233        SPFlags: DISPFlags,
2234        TParam: &'a DIArray,
2235    ) -> &'a DISubprogram;
2236
2237    pub(crate) fn LLVMRustDIBuilderCreateVariantMemberType<'a>(
2238        Builder: &DIBuilder<'a>,
2239        Scope: &'a DIScope,
2240        Name: *const c_char,
2241        NameLen: size_t,
2242        File: &'a DIFile,
2243        LineNumber: c_uint,
2244        SizeInBits: u64,
2245        AlignInBits: u32,
2246        OffsetInBits: u64,
2247        Discriminant: Option<&'a Value>,
2248        Flags: DIFlags,
2249        Ty: &'a DIType,
2250    ) -> &'a DIType;
2251
2252    pub(crate) fn LLVMRustDIBuilderCreateEnumerator<'a>(
2253        Builder: &DIBuilder<'a>,
2254        Name: *const c_char,
2255        NameLen: size_t,
2256        Value: *const u64,
2257        SizeInBits: c_uint,
2258        IsUnsigned: bool,
2259    ) -> &'a DIEnumerator;
2260
2261    pub(crate) fn LLVMRustDIBuilderCreateEnumerationType<'a>(
2262        Builder: &DIBuilder<'a>,
2263        Scope: &'a DIScope,
2264        Name: *const c_char,
2265        NameLen: size_t,
2266        File: &'a DIFile,
2267        LineNumber: c_uint,
2268        SizeInBits: u64,
2269        AlignInBits: u32,
2270        Elements: &'a DIArray,
2271        ClassType: &'a DIType,
2272        IsScoped: bool,
2273    ) -> &'a DIType;
2274
2275    pub(crate) fn LLVMRustDIBuilderCreateVariantPart<'a>(
2276        Builder: &DIBuilder<'a>,
2277        Scope: &'a DIScope,
2278        Name: *const c_char,
2279        NameLen: size_t,
2280        File: &'a DIFile,
2281        LineNo: c_uint,
2282        SizeInBits: u64,
2283        AlignInBits: u32,
2284        Flags: DIFlags,
2285        Discriminator: Option<&'a DIDerivedType>,
2286        Elements: &'a DIArray,
2287        UniqueId: *const c_char,
2288        UniqueIdLen: size_t,
2289    ) -> &'a DIDerivedType;
2290
2291    pub(crate) fn LLVMRustDIBuilderCreateTemplateTypeParameter<'a>(
2292        Builder: &DIBuilder<'a>,
2293        Scope: Option<&'a DIScope>,
2294        Name: *const c_char,
2295        NameLen: size_t,
2296        Ty: &'a DIType,
2297    ) -> &'a DITemplateTypeParameter;
2298
2299    pub(crate) fn LLVMRustDICompositeTypeReplaceArrays<'a>(
2300        Builder: &DIBuilder<'a>,
2301        CompositeType: &'a DIType,
2302        Elements: Option<&'a DIArray>,
2303        Params: Option<&'a DIArray>,
2304    );
2305
2306    pub(crate) fn LLVMRustDIGetOrCreateSubrange<'a>(
2307        Builder: &DIBuilder<'a>,
2308        CountNode: Option<&'a Metadata>,
2309        LB: &'a Metadata,
2310        UB: &'a Metadata,
2311        Stride: Option<&'a Metadata>,
2312    ) -> &'a Metadata;
2313
2314    pub(crate) fn LLVMRustDICreateVectorType<'a>(
2315        Builder: &DIBuilder<'a>,
2316        Size: u64,
2317        AlignInBits: u32,
2318        Type: &'a DIType,
2319        Subscripts: &'a DIArray,
2320        BitStride: Option<&'a Metadata>,
2321    ) -> &'a Metadata;
2322
2323    pub(crate) fn LLVMRustDILocationCloneWithBaseDiscriminator<'a>(
2324        Location: &'a DILocation,
2325        BD: c_uint,
2326    ) -> Option<&'a DILocation>;
2327
2328    pub(crate) fn LLVMRustWriteTypeToString(Type: &Type, s: &RustString);
2329    pub(crate) fn LLVMRustWriteValueToString(value_ref: &Value, s: &RustString);
2330
2331    pub(crate) fn LLVMRustHasFeature(T: &TargetMachine, s: *const c_char) -> bool;
2332
2333    pub(crate) fn LLVMRustPrintTargetCPUs(TM: &TargetMachine, OutStr: &RustString);
2334    pub(crate) fn LLVMRustGetTargetFeaturesCount(T: &TargetMachine) -> size_t;
2335    pub(crate) fn LLVMRustGetTargetFeature(
2336        T: &TargetMachine,
2337        Index: size_t,
2338        Feature: &mut *const c_char,
2339        Desc: &mut *const c_char,
2340    );
2341
2342    pub(crate) fn LLVMRustGetHostCPUName(LenOut: &mut size_t) -> *const u8;
2343
2344    // This function makes copies of pointed to data, so the data's lifetime may end after this
2345    // function returns.
2346    pub(crate) fn LLVMRustCreateTargetMachine(
2347        Triple: *const c_char,
2348        CPU: *const c_char,
2349        Features: *const c_char,
2350        Abi: *const c_char,
2351        Model: CodeModel,
2352        Reloc: RelocModel,
2353        Level: CodeGenOptLevel,
2354        FloatABIType: FloatAbi,
2355        FunctionSections: bool,
2356        DataSections: bool,
2357        UniqueSectionNames: bool,
2358        TrapUnreachable: bool,
2359        Singlethread: bool,
2360        VerboseAsm: bool,
2361        EmitStackSizeSection: bool,
2362        RelaxELFRelocations: bool,
2363        UseInitArray: bool,
2364        SplitDwarfFile: *const c_char,
2365        OutputObjFile: *const c_char,
2366        DebugInfoCompression: CompressionKind,
2367        UseEmulatedTls: bool,
2368        UseWasmEH: bool,
2369        LargeDataThreshold: u64,
2370    ) -> *mut TargetMachine;
2371
2372    pub(crate) fn LLVMRustAddLibraryInfo<'a>(
2373        T: &TargetMachine,
2374        PM: &PassManager<'a>,
2375        M: &'a Module,
2376        DisableSimplifyLibCalls: bool,
2377    );
2378    pub(crate) fn LLVMRustWriteOutputFile<'a>(
2379        T: &'a TargetMachine,
2380        PM: *mut PassManager<'a>,
2381        M: &'a Module,
2382        Output: *const c_char,
2383        DwoOutput: *const c_char,
2384        FileType: FileType,
2385        VerifyIR: bool,
2386    ) -> LLVMRustResult;
2387    pub(crate) fn LLVMRustOptimize<'a>(
2388        M: &'a Module,
2389        TM: &'a TargetMachine,
2390        OptLevel: PassBuilderOptLevel,
2391        OptStage: OptStage,
2392        IsLinkerPluginLTO: bool,
2393        NoPrepopulatePasses: bool,
2394        VerifyIR: bool,
2395        LintIR: bool,
2396        ThinLTOBuffer: Option<&mut Option<crate::back::lto::Buffer>>,
2397        ThinLTOSummaryBuffer: Option<&mut Option<crate::back::lto::Buffer>>,
2398        MergeFunctions: bool,
2399        UnrollLoops: bool,
2400        SLPVectorize: bool,
2401        LoopVectorize: bool,
2402        DisableSimplifyLibCalls: bool,
2403        EmitLifetimeMarkers: bool,
2404        RunEnzyme: *const c_void,
2405        PrintBeforeEnzyme: bool,
2406        PrintAfterEnzyme: bool,
2407        PrintPasses: bool,
2408        SanitizerOptions: Option<&SanitizerOptions>,
2409        PGOGenPath: *const c_char,
2410        PGOUsePath: *const c_char,
2411        InstrumentCoverage: bool,
2412        InstrProfileOutput: *const c_char,
2413        PGOSampleUsePath: *const c_char,
2414        DebugInfoForProfiling: bool,
2415        llvm_selfprofiler: *mut c_void,
2416        begin_callback: SelfProfileBeforePassCallback,
2417        end_callback: SelfProfileAfterPassCallback,
2418        ExtraPasses: *const c_char,
2419        ExtraPassesLen: size_t,
2420        LLVMPlugins: *const c_char,
2421        LLVMPluginsLen: size_t,
2422    ) -> LLVMRustResult;
2423    pub(crate) fn LLVMRustPrintModule(
2424        M: &Module,
2425        Output: *const c_char,
2426        Demangle: extern "C" fn(*const c_char, size_t, *mut c_char, size_t) -> size_t,
2427    ) -> LLVMRustResult;
2428    pub(crate) fn LLVMRustSetLLVMOptions(Argc: c_int, Argv: *const *const c_char);
2429    pub(crate) fn LLVMRustPrintPasses();
2430    pub(crate) fn LLVMRustSetNormalizedTarget(M: &Module, triple: *const c_char);
2431    pub(crate) fn LLVMRustRunRestrictionPass(M: &Module, syms: *const *const c_char, len: size_t);
2432
2433    pub(crate) fn LLVMRustWriteTwineToString(T: &Twine, s: &RustString);
2434
2435    pub(crate) fn LLVMRustUnpackOptimizationDiagnostic<'a>(
2436        DI: &'a DiagnosticInfo,
2437        pass_name_out: &RustString,
2438        function_out: &mut Option<&'a Value>,
2439        loc_line_out: &mut c_uint,
2440        loc_column_out: &mut c_uint,
2441        loc_filename_out: &RustString,
2442        message_out: &RustString,
2443    );
2444
2445    pub(crate) fn LLVMRustUnpackInlineAsmDiagnostic<'a>(
2446        DI: &'a DiagnosticInfo,
2447        level_out: &mut DiagnosticLevel,
2448        cookie_out: &mut u64,
2449        message_out: &mut Option<&'a Twine>,
2450    );
2451
2452    pub(crate) fn LLVMRustWriteDiagnosticInfoToString(DI: &DiagnosticInfo, s: &RustString);
2453    pub(crate) fn LLVMRustGetDiagInfoKind(DI: &DiagnosticInfo) -> DiagnosticKind;
2454
2455    pub(crate) fn LLVMRustGetSMDiagnostic<'a>(
2456        DI: &'a DiagnosticInfo,
2457        cookie_out: &mut u64,
2458    ) -> &'a SMDiagnostic;
2459
2460    pub(crate) fn LLVMRustUnpackSMDiagnostic(
2461        d: &SMDiagnostic,
2462        message_out: &RustString,
2463        buffer_out: &RustString,
2464        level_out: &mut DiagnosticLevel,
2465        loc_out: &mut c_uint,
2466        ranges_out: *mut c_uint,
2467        num_ranges: &mut usize,
2468    ) -> bool;
2469
2470    pub(crate) fn LLVMRustSetDataLayoutFromTargetMachine<'a>(M: &'a Module, TM: &'a TargetMachine);
2471
2472    pub(crate) fn LLVMRustPositionBuilderPastAllocas<'a>(B: &Builder<'a>, Fn: &'a Value);
2473    pub(crate) fn LLVMRustPositionBuilderAtStart<'a>(B: &Builder<'a>, BB: &'a BasicBlock);
2474
2475    pub(crate) fn LLVMRustSetModulePICLevel(M: &Module);
2476    pub(crate) fn LLVMRustSetModulePIELevel(M: &Module);
2477    pub(crate) fn LLVMRustSetModuleCodeModel(M: &Module, Model: CodeModel);
2478    pub(crate) fn LLVMRustBufferPtr(p: &Buffer) -> *const u8;
2479    pub(crate) fn LLVMRustBufferLen(p: &Buffer) -> usize;
2480    pub(crate) fn LLVMRustBufferFree(p: &'static mut Buffer);
2481    pub(crate) fn LLVMRustModuleCost(M: &Module) -> u64;
2482    pub(crate) fn LLVMRustModuleInstructionStats(M: &Module) -> u64;
2483
2484    pub(crate) fn LLVMRustModuleSerialize(M: &Module, is_thin: bool) -> &'static mut Buffer;
2485    pub(crate) fn LLVMRustCreateThinLTOData(
2486        Modules: *const ThinLTOModule,
2487        NumModules: size_t,
2488        PreservedSymbols: *const *const c_char,
2489        PreservedSymbolsLen: size_t,
2490    ) -> Option<&'static mut ThinLTOData>;
2491    pub(crate) fn LLVMRustPrepareThinLTORename(
2492        Data: &ThinLTOData,
2493        Module: &Module,
2494        Target: &TargetMachine,
2495    );
2496    pub(crate) fn LLVMRustPrepareThinLTOResolveWeak(Data: &ThinLTOData, Module: &Module) -> bool;
2497    pub(crate) fn LLVMRustPrepareThinLTOInternalize(Data: &ThinLTOData, Module: &Module) -> bool;
2498    pub(crate) fn LLVMRustPrepareThinLTOImport(
2499        Data: &ThinLTOData,
2500        Module: &Module,
2501        Target: &TargetMachine,
2502    ) -> bool;
2503    pub(crate) fn LLVMRustFreeThinLTOData(Data: &'static mut ThinLTOData);
2504    pub(crate) fn LLVMRustParseBitcodeForLTO(
2505        Context: &Context,
2506        Data: *const u8,
2507        len: usize,
2508        Identifier: *const c_char,
2509    ) -> Option<&Module>;
2510
2511    pub(crate) fn LLVMRustLinkerNew(M: &Module) -> &mut Linker<'_>;
2512    pub(crate) fn LLVMRustLinkerAdd(
2513        linker: &Linker<'_>,
2514        bytecode: *const c_char,
2515        bytecode_len: usize,
2516    ) -> bool;
2517    pub(crate) fn LLVMRustLinkerFree<'a>(linker: &'a mut Linker<'a>);
2518    pub(crate) fn LLVMRustComputeLTOCacheKey(
2519        key_out: &RustString,
2520        mod_id: *const c_char,
2521        data: &ThinLTOData,
2522    );
2523
2524    pub(crate) fn LLVMRustContextGetDiagnosticHandler(
2525        Context: &Context,
2526    ) -> Option<&DiagnosticHandler>;
2527    pub(crate) fn LLVMRustContextSetDiagnosticHandler(
2528        context: &Context,
2529        diagnostic_handler: Option<&DiagnosticHandler>,
2530    );
2531    pub(crate) fn LLVMRustContextConfigureDiagnosticHandler(
2532        context: &Context,
2533        diagnostic_handler_callback: DiagnosticHandlerTy,
2534        diagnostic_handler_context: *mut c_void,
2535        remark_all_passes: bool,
2536        remark_passes: *const *const c_char,
2537        remark_passes_len: usize,
2538        remark_file: *const c_char,
2539        pgo_available: bool,
2540    );
2541
2542    pub(crate) fn LLVMRustGetMangledName(V: &Value, out: &RustString);
2543
2544    pub(crate) fn LLVMRustGetElementTypeArgIndex(CallSite: &Value) -> i32;
2545
2546    pub(crate) safe fn LLVMRustLLVMHasZlibCompression() -> bool;
2547    pub(crate) safe fn LLVMRustLLVMHasZstdCompression() -> bool;
2548
2549    pub(crate) fn LLVMRustGetSymbols(
2550        buf_ptr: *const u8,
2551        buf_len: usize,
2552        state: *mut c_void,
2553        callback: GetSymbolsCallback,
2554        error_callback: GetSymbolsErrorCallback,
2555    ) -> *mut c_void;
2556
2557    pub(crate) fn LLVMRustIs64BitSymbolicFile(buf_ptr: *const u8, buf_len: usize) -> bool;
2558
2559    pub(crate) fn LLVMRustIsECObject(buf_ptr: *const u8, buf_len: usize) -> bool;
2560
2561    pub(crate) fn LLVMRustIsAnyArm64Coff(buf_ptr: *const u8, buf_len: usize) -> bool;
2562
2563    pub(crate) fn LLVMRustSetNoSanitizeAddress(Global: &Value);
2564    pub(crate) fn LLVMRustSetNoSanitizeHWAddress(Global: &Value);
2565
2566    pub(crate) fn LLVMAddAlias2<'ll>(
2567        M: &'ll Module,
2568        ValueTy: &Type,
2569        AddressSpace: c_uint,
2570        Aliasee: &Value,
2571        Name: *const c_char,
2572    ) -> &'ll Value;
2573}