Skip to main content

rustc_codegen_llvm/llvm/
ffi.rs

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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