1#![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#[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 pub(crate) fn is_true(self) -> bool {
56 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 v => f.write_fmt(format_args!("TRUE ({0})", v))write!(f, "TRUE ({v})"),
69 }
70 }
71}
72
73pub(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#[repr(transparent)]
95pub(crate) struct RawEnum<T> {
96 value: u32,
97 _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 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)] pub(crate) enum LLVMRustResult {
116 Success,
117 Failure,
118}
119
120#[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#[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#[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#[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#[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#[repr(C)]
225pub(crate) enum UnnamedAddr {
226 No,
227 #[expect(dead_code)]
228 Local,
229 Global,
230}
231
232#[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, #[allow(dead_code)]
240 DllExport = 2, }
242
243#[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 None = 0,
249 Sync = 1,
251 Async = 2,
253}
254
255#[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#[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#[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#[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#[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#[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#[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 Acquire = 4,
422 Release = 5,
423 AcquireRelease = 6,
424 SequentiallyConsistent = 7,
425}
426
427#[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#[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#[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#[repr(C)]
455pub(crate) enum PassBuilderOptLevel {
456 O0,
457 O1,
458 O2,
459 O3,
460 Os,
461 Oz,
462}
463
464#[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#[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#[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#[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#[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#[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)] pub(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#[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)] pub(crate) enum DiagnosticLevel {
559 Error,
560 Warning,
561 Note,
562 Remark,
563}
564
565unsafe extern "C" {
566 pub(crate) type ThinLTOData;
568}
569
570#[repr(C)]
572pub(crate) struct ThinLTOModule {
573 pub identifier: *const c_char,
574 pub data: *const u8,
575 pub len: usize,
576}
577
578#[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#[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#[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#[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#[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
702unsafe 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 pub(crate) type DbgRecord;
715}
716#[repr(C)]
717pub(crate) struct Builder<'a>(InvariantOpaque<'a>);
718#[repr(C)]
719pub(crate) struct PassManager<'a>(InvariantOpaque<'a>);
720unsafe extern "C" {
721 pub type TargetMachine;
722}
723unsafe extern "C" {
724 pub(crate) type MCSubtargetInfo;
725 pub(crate) type Twine;
726 pub(crate) type DiagnosticInfo;
727 pub(crate) type SMDiagnostic;
728}
729#[repr(C)]
731pub(crate) struct OperandBundle<'a>(InvariantOpaque<'a>);
732#[repr(C)]
733pub(crate) struct Linker<'a>(InvariantOpaque<'a>);
734
735unsafe extern "C" {
736 pub(crate) type DiagnosticHandler;
737}
738
739pub(crate) type DiagnosticHandlerTy = unsafe extern "C" fn(&DiagnosticInfo, *mut c_void);
740
741pub(crate) mod debuginfo {
742 use bitflags::bitflags;
743
744 use super::{InvariantOpaque, Metadata};
745
746 #[repr(C)]
755 pub(crate) struct DIBuilder<'ll>(InvariantOpaque<'ll>);
756
757 pub(crate) type DIDescriptor = Metadata;
758 pub(crate) type DILocation = Metadata;
759 pub(crate) type DIScope = DIDescriptor;
760 pub(crate) type DIFile = DIScope;
761 pub(crate) type DILexicalBlock = DIScope;
762 pub(crate) type DISubprogram = DIScope;
763 pub(crate) type DIType = DIDescriptor;
764 pub(crate) type DIBasicType = DIType;
765 pub(crate) type DIDerivedType = DIType;
766 pub(crate) type DICompositeType = DIDerivedType;
767 pub(crate) type DIVariable = DIDescriptor;
768 pub(crate) type DIArray = DIDescriptor;
769 pub(crate) type DITemplateTypeParameter = DIDescriptor;
770
771 #[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 { DIFlags(::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 {
#[inline]
pub const fn empty() -> Self {
Self(<u32 as ::bitflags::Bits>::EMPTY)
}
#[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)
}
#[inline]
pub const fn bits(&self) -> u32 { self.0 }
#[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 }
}
#[inline]
pub const fn from_bits_truncate(bits: u32) -> Self {
Self(bits & Self::all().0)
}
#[inline]
pub const fn from_bits_retain(bits: u32) -> Self { Self(bits) }
#[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
}
#[inline]
pub const fn is_empty(&self) -> bool {
self.0 == <u32 as ::bitflags::Bits>::EMPTY
}
#[inline]
pub const fn is_all(&self) -> bool {
Self::all().0 | self.0 == self.0
}
#[inline]
pub const fn intersects(&self, other: Self) -> bool {
self.0 & other.0 != <u32 as ::bitflags::Bits>::EMPTY
}
#[inline]
pub const fn contains(&self, other: Self) -> bool {
self.0 & other.0 == other.0
}
#[inline]
pub fn insert(&mut self, other: Self) {
*self = Self(self.0).union(other);
}
#[inline]
pub fn remove(&mut self, other: Self) {
*self = Self(self.0).difference(other);
}
#[inline]
pub fn toggle(&mut self, other: Self) {
*self = Self(self.0).symmetric_difference(other);
}
#[inline]
pub fn set(&mut self, other: Self, value: bool) {
if value { self.insert(other); } else { self.remove(other); }
}
#[inline]
#[must_use]
pub const fn intersection(self, other: Self) -> Self {
Self(self.0 & other.0)
}
#[inline]
#[must_use]
pub const fn union(self, other: Self) -> Self {
Self(self.0 | other.0)
}
#[inline]
#[must_use]
pub const fn difference(self, other: Self) -> Self {
Self(self.0 & !other.0)
}
#[inline]
#[must_use]
pub const fn symmetric_difference(self, other: Self) -> Self {
Self(self.0 ^ other.0)
}
#[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;
#[inline]
fn bitor(self, other: InternalBitFlags) -> Self {
self.union(other)
}
}
impl ::bitflags::__private::core::ops::BitOrAssign for
InternalBitFlags {
#[inline]
fn bitor_assign(&mut self, other: Self) { self.insert(other); }
}
impl ::bitflags::__private::core::ops::BitXor for InternalBitFlags {
type Output = Self;
#[inline]
fn bitxor(self, other: Self) -> Self {
self.symmetric_difference(other)
}
}
impl ::bitflags::__private::core::ops::BitXorAssign for
InternalBitFlags {
#[inline]
fn bitxor_assign(&mut self, other: Self) { self.toggle(other); }
}
impl ::bitflags::__private::core::ops::BitAnd for InternalBitFlags {
type Output = Self;
#[inline]
fn bitand(self, other: Self) -> Self { self.intersection(other) }
}
impl ::bitflags::__private::core::ops::BitAndAssign for
InternalBitFlags {
#[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;
#[inline]
fn sub(self, other: Self) -> Self { self.difference(other) }
}
impl ::bitflags::__private::core::ops::SubAssign for InternalBitFlags
{
#[inline]
fn sub_assign(&mut self, other: Self) { self.remove(other); }
}
impl ::bitflags::__private::core::ops::Not for InternalBitFlags {
type Output = Self;
#[inline]
fn not(self) -> Self { self.complement() }
}
impl ::bitflags::__private::core::iter::Extend<InternalBitFlags> for
InternalBitFlags {
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 {
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 {
#[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()))
}
#[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 {
#[inline]
pub fn bits_mut(&mut self) -> &mut u32 { &mut self.0 }
}
#[allow(dead_code, deprecated, unused_attributes)]
impl DIFlags {
#[inline]
pub const fn empty() -> Self { Self(InternalBitFlags::empty()) }
#[inline]
pub const fn all() -> Self { Self(InternalBitFlags::all()) }
#[inline]
pub const fn bits(&self) -> u32 { self.0.bits() }
#[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,
}
}
#[inline]
pub const fn from_bits_truncate(bits: u32) -> Self {
Self(InternalBitFlags::from_bits_truncate(bits))
}
#[inline]
pub const fn from_bits_retain(bits: u32) -> Self {
Self(InternalBitFlags::from_bits_retain(bits))
}
#[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,
}
}
#[inline]
pub const fn is_empty(&self) -> bool { self.0.is_empty() }
#[inline]
pub const fn is_all(&self) -> bool { self.0.is_all() }
#[inline]
pub const fn intersects(&self, other: Self) -> bool {
self.0.intersects(other.0)
}
#[inline]
pub const fn contains(&self, other: Self) -> bool {
self.0.contains(other.0)
}
#[inline]
pub fn insert(&mut self, other: Self) { self.0.insert(other.0) }
#[inline]
pub fn remove(&mut self, other: Self) { self.0.remove(other.0) }
#[inline]
pub fn toggle(&mut self, other: Self) { self.0.toggle(other.0) }
#[inline]
pub fn set(&mut self, other: Self, value: bool) {
self.0.set(other.0, value)
}
#[inline]
#[must_use]
pub const fn intersection(self, other: Self) -> Self {
Self(self.0.intersection(other.0))
}
#[inline]
#[must_use]
pub const fn union(self, other: Self) -> Self {
Self(self.0.union(other.0))
}
#[inline]
#[must_use]
pub const fn difference(self, other: Self) -> Self {
Self(self.0.difference(other.0))
}
#[inline]
#[must_use]
pub const fn symmetric_difference(self, other: Self) -> Self {
Self(self.0.symmetric_difference(other.0))
}
#[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;
#[inline]
fn bitor(self, other: DIFlags) -> Self { self.union(other) }
}
impl ::bitflags::__private::core::ops::BitOrAssign for DIFlags {
#[inline]
fn bitor_assign(&mut self, other: Self) { self.insert(other); }
}
impl ::bitflags::__private::core::ops::BitXor for DIFlags {
type Output = Self;
#[inline]
fn bitxor(self, other: Self) -> Self {
self.symmetric_difference(other)
}
}
impl ::bitflags::__private::core::ops::BitXorAssign for DIFlags {
#[inline]
fn bitxor_assign(&mut self, other: Self) { self.toggle(other); }
}
impl ::bitflags::__private::core::ops::BitAnd for DIFlags {
type Output = Self;
#[inline]
fn bitand(self, other: Self) -> Self { self.intersection(other) }
}
impl ::bitflags::__private::core::ops::BitAndAssign for DIFlags {
#[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;
#[inline]
fn sub(self, other: Self) -> Self { self.difference(other) }
}
impl ::bitflags::__private::core::ops::SubAssign for DIFlags {
#[inline]
fn sub_assign(&mut self, other: Self) { self.remove(other); }
}
impl ::bitflags::__private::core::ops::Not for DIFlags {
type Output = Self;
#[inline]
fn not(self) -> Self { self.complement() }
}
impl ::bitflags::__private::core::iter::Extend<DIFlags> for DIFlags {
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 {
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 {
#[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()))
}
#[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! {
772 #[repr(transparent)]
777 #[derive(Clone, Copy, Default)]
778 pub(crate) struct DIFlags: u32 {
779 const FlagZero = 0;
780 const FlagPrivate = 1;
781 const FlagProtected = 2;
782 const FlagPublic = 3;
783 const FlagFwdDecl = (1 << 2);
784 const FlagAppleBlock = (1 << 3);
785 const FlagReservedBit4 = (1 << 4);
786 const FlagVirtual = (1 << 5);
787 const FlagArtificial = (1 << 6);
788 const FlagExplicit = (1 << 7);
789 const FlagPrototyped = (1 << 8);
790 const FlagObjcClassComplete = (1 << 9);
791 const FlagObjectPointer = (1 << 10);
792 const FlagVector = (1 << 11);
793 const FlagStaticMember = (1 << 12);
794 const FlagLValueReference = (1 << 13);
795 const FlagRValueReference = (1 << 14);
796 const FlagReserved = (1 << 15);
797 const FlagSingleInheritance = (1 << 16);
798 const FlagMultipleInheritance = (2 << 16);
799 const FlagVirtualInheritance = (3 << 16);
800 const FlagIntroducedVirtual = (1 << 18);
801 const FlagBitField = (1 << 19);
802 const FlagNoReturn = (1 << 20);
803 const FlagTypePassByValue = (1 << 22);
805 const FlagTypePassByReference = (1 << 23);
806 const FlagEnumClass = (1 << 24);
807 const FlagThunk = (1 << 25);
808 const FlagNonTrivial = (1 << 26);
809 const FlagBigEndian = (1 << 27);
810 const FlagLittleEndian = (1 << 28);
811 }
812 }
813
814 #[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 { DISPFlags(::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 {
#[inline]
pub const fn empty() -> Self {
Self(<u32 as ::bitflags::Bits>::EMPTY)
}
#[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)
}
#[inline]
pub const fn bits(&self) -> u32 { self.0 }
#[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 }
}
#[inline]
pub const fn from_bits_truncate(bits: u32) -> Self {
Self(bits & Self::all().0)
}
#[inline]
pub const fn from_bits_retain(bits: u32) -> Self { Self(bits) }
#[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
}
#[inline]
pub const fn is_empty(&self) -> bool {
self.0 == <u32 as ::bitflags::Bits>::EMPTY
}
#[inline]
pub const fn is_all(&self) -> bool {
Self::all().0 | self.0 == self.0
}
#[inline]
pub const fn intersects(&self, other: Self) -> bool {
self.0 & other.0 != <u32 as ::bitflags::Bits>::EMPTY
}
#[inline]
pub const fn contains(&self, other: Self) -> bool {
self.0 & other.0 == other.0
}
#[inline]
pub fn insert(&mut self, other: Self) {
*self = Self(self.0).union(other);
}
#[inline]
pub fn remove(&mut self, other: Self) {
*self = Self(self.0).difference(other);
}
#[inline]
pub fn toggle(&mut self, other: Self) {
*self = Self(self.0).symmetric_difference(other);
}
#[inline]
pub fn set(&mut self, other: Self, value: bool) {
if value { self.insert(other); } else { self.remove(other); }
}
#[inline]
#[must_use]
pub const fn intersection(self, other: Self) -> Self {
Self(self.0 & other.0)
}
#[inline]
#[must_use]
pub const fn union(self, other: Self) -> Self {
Self(self.0 | other.0)
}
#[inline]
#[must_use]
pub const fn difference(self, other: Self) -> Self {
Self(self.0 & !other.0)
}
#[inline]
#[must_use]
pub const fn symmetric_difference(self, other: Self) -> Self {
Self(self.0 ^ other.0)
}
#[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;
#[inline]
fn bitor(self, other: InternalBitFlags) -> Self {
self.union(other)
}
}
impl ::bitflags::__private::core::ops::BitOrAssign for
InternalBitFlags {
#[inline]
fn bitor_assign(&mut self, other: Self) { self.insert(other); }
}
impl ::bitflags::__private::core::ops::BitXor for InternalBitFlags {
type Output = Self;
#[inline]
fn bitxor(self, other: Self) -> Self {
self.symmetric_difference(other)
}
}
impl ::bitflags::__private::core::ops::BitXorAssign for
InternalBitFlags {
#[inline]
fn bitxor_assign(&mut self, other: Self) { self.toggle(other); }
}
impl ::bitflags::__private::core::ops::BitAnd for InternalBitFlags {
type Output = Self;
#[inline]
fn bitand(self, other: Self) -> Self { self.intersection(other) }
}
impl ::bitflags::__private::core::ops::BitAndAssign for
InternalBitFlags {
#[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;
#[inline]
fn sub(self, other: Self) -> Self { self.difference(other) }
}
impl ::bitflags::__private::core::ops::SubAssign for InternalBitFlags
{
#[inline]
fn sub_assign(&mut self, other: Self) { self.remove(other); }
}
impl ::bitflags::__private::core::ops::Not for InternalBitFlags {
type Output = Self;
#[inline]
fn not(self) -> Self { self.complement() }
}
impl ::bitflags::__private::core::iter::Extend<InternalBitFlags> for
InternalBitFlags {
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 {
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 {
#[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()))
}
#[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 {
#[inline]
pub fn bits_mut(&mut self) -> &mut u32 { &mut self.0 }
}
#[allow(dead_code, deprecated, unused_attributes)]
impl DISPFlags {
#[inline]
pub const fn empty() -> Self { Self(InternalBitFlags::empty()) }
#[inline]
pub const fn all() -> Self { Self(InternalBitFlags::all()) }
#[inline]
pub const fn bits(&self) -> u32 { self.0.bits() }
#[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,
}
}
#[inline]
pub const fn from_bits_truncate(bits: u32) -> Self {
Self(InternalBitFlags::from_bits_truncate(bits))
}
#[inline]
pub const fn from_bits_retain(bits: u32) -> Self {
Self(InternalBitFlags::from_bits_retain(bits))
}
#[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,
}
}
#[inline]
pub const fn is_empty(&self) -> bool { self.0.is_empty() }
#[inline]
pub const fn is_all(&self) -> bool { self.0.is_all() }
#[inline]
pub const fn intersects(&self, other: Self) -> bool {
self.0.intersects(other.0)
}
#[inline]
pub const fn contains(&self, other: Self) -> bool {
self.0.contains(other.0)
}
#[inline]
pub fn insert(&mut self, other: Self) { self.0.insert(other.0) }
#[inline]
pub fn remove(&mut self, other: Self) { self.0.remove(other.0) }
#[inline]
pub fn toggle(&mut self, other: Self) { self.0.toggle(other.0) }
#[inline]
pub fn set(&mut self, other: Self, value: bool) {
self.0.set(other.0, value)
}
#[inline]
#[must_use]
pub const fn intersection(self, other: Self) -> Self {
Self(self.0.intersection(other.0))
}
#[inline]
#[must_use]
pub const fn union(self, other: Self) -> Self {
Self(self.0.union(other.0))
}
#[inline]
#[must_use]
pub const fn difference(self, other: Self) -> Self {
Self(self.0.difference(other.0))
}
#[inline]
#[must_use]
pub const fn symmetric_difference(self, other: Self) -> Self {
Self(self.0.symmetric_difference(other.0))
}
#[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;
#[inline]
fn bitor(self, other: DISPFlags) -> Self { self.union(other) }
}
impl ::bitflags::__private::core::ops::BitOrAssign for DISPFlags {
#[inline]
fn bitor_assign(&mut self, other: Self) { self.insert(other); }
}
impl ::bitflags::__private::core::ops::BitXor for DISPFlags {
type Output = Self;
#[inline]
fn bitxor(self, other: Self) -> Self {
self.symmetric_difference(other)
}
}
impl ::bitflags::__private::core::ops::BitXorAssign for DISPFlags {
#[inline]
fn bitxor_assign(&mut self, other: Self) { self.toggle(other); }
}
impl ::bitflags::__private::core::ops::BitAnd for DISPFlags {
type Output = Self;
#[inline]
fn bitand(self, other: Self) -> Self { self.intersection(other) }
}
impl ::bitflags::__private::core::ops::BitAndAssign for DISPFlags {
#[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;
#[inline]
fn sub(self, other: Self) -> Self { self.difference(other) }
}
impl ::bitflags::__private::core::ops::SubAssign for DISPFlags {
#[inline]
fn sub_assign(&mut self, other: Self) { self.remove(other); }
}
impl ::bitflags::__private::core::ops::Not for DISPFlags {
type Output = Self;
#[inline]
fn not(self) -> Self { self.complement() }
}
impl ::bitflags::__private::core::iter::Extend<DISPFlags> for
DISPFlags {
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 {
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 {
#[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()))
}
#[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! {
816 #[repr(transparent)]
817 #[derive(Clone, Copy, Default)]
818 pub(crate) struct DISPFlags: u32 {
819 const SPFlagZero = 0;
820 const SPFlagVirtual = 1;
821 const SPFlagPureVirtual = 2;
822 const SPFlagLocalToUnit = (1 << 2);
823 const SPFlagDefinition = (1 << 3);
824 const SPFlagOptimized = (1 << 4);
825 const SPFlagMainSubprogram = (1 << 5);
826 }
827 }
828
829 #[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)]
831 #[repr(C)]
832 pub(crate) enum DebugEmissionKind {
833 NoDebug,
834 FullDebug,
835 LineTablesOnly,
836 DebugDirectivesOnly,
837 }
838
839 #[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)]
841 #[repr(C)]
842 pub(crate) enum DebugNameTableKind {
843 Default,
844 #[expect(dead_code)]
845 Gnu,
846 None,
847 }
848}
849
850#[repr(transparent)]
pub(crate) struct AllocKindFlags(<AllocKindFlags as
::bitflags::__private::PublicFlags>::Internal);
#[automatically_derived]
impl ::core::default::Default for AllocKindFlags {
#[inline]
fn default() -> Self {
AllocKindFlags(::core::default::Default::default())
}
}
impl AllocKindFlags {
#[allow(deprecated, non_upper_case_globals,)]
pub const Unknown: Self = Self::from_bits_retain(0);
#[allow(deprecated, non_upper_case_globals,)]
pub const Alloc: Self = Self::from_bits_retain(1);
#[allow(deprecated, non_upper_case_globals,)]
pub const Realloc: Self = Self::from_bits_retain(1 << 1);
#[allow(deprecated, non_upper_case_globals,)]
pub const Free: Self = Self::from_bits_retain(1 << 2);
#[allow(deprecated, non_upper_case_globals,)]
pub const Uninitialized: Self = Self::from_bits_retain(1 << 3);
#[allow(deprecated, non_upper_case_globals,)]
pub const Zeroed: Self = Self::from_bits_retain(1 << 4);
#[allow(deprecated, non_upper_case_globals,)]
pub const Aligned: Self = Self::from_bits_retain(1 << 5);
}
impl ::bitflags::Flags for AllocKindFlags {
const FLAGS: &'static [::bitflags::Flag<AllocKindFlags>] =
&[{
#[allow(deprecated, non_upper_case_globals,)]
::bitflags::Flag::new("Unknown", AllocKindFlags::Unknown)
},
{
#[allow(deprecated, non_upper_case_globals,)]
::bitflags::Flag::new("Alloc", AllocKindFlags::Alloc)
},
{
#[allow(deprecated, non_upper_case_globals,)]
::bitflags::Flag::new("Realloc", AllocKindFlags::Realloc)
},
{
#[allow(deprecated, non_upper_case_globals,)]
::bitflags::Flag::new("Free", AllocKindFlags::Free)
},
{
#[allow(deprecated, non_upper_case_globals,)]
::bitflags::Flag::new("Uninitialized",
AllocKindFlags::Uninitialized)
},
{
#[allow(deprecated, non_upper_case_globals,)]
::bitflags::Flag::new("Zeroed", AllocKindFlags::Zeroed)
},
{
#[allow(deprecated, non_upper_case_globals,)]
::bitflags::Flag::new("Aligned", AllocKindFlags::Aligned)
}];
type Bits = u64;
fn bits(&self) -> u64 { AllocKindFlags::bits(self) }
fn from_bits_retain(bits: u64) -> AllocKindFlags {
AllocKindFlags::from_bits_retain(bits)
}
}
#[allow(dead_code, deprecated, unused_doc_comments, unused_attributes,
unused_mut, unused_imports, non_upper_case_globals, clippy ::
assign_op_pattern, clippy :: indexing_slicing, clippy :: same_name_method,
clippy :: iter_without_into_iter,)]
const _: () =
{
#[repr(transparent)]
pub(crate) struct InternalBitFlags(u64);
#[automatically_derived]
#[doc(hidden)]
unsafe impl ::core::clone::TrivialClone for InternalBitFlags { }
#[automatically_derived]
impl ::core::clone::Clone for InternalBitFlags {
#[inline]
fn clone(&self) -> 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 {
#[inline]
pub const fn empty() -> Self {
Self(<u64 as ::bitflags::Bits>::EMPTY)
}
#[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)
}
#[inline]
pub const fn bits(&self) -> u64 { self.0 }
#[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 }
}
#[inline]
pub const fn from_bits_truncate(bits: u64) -> Self {
Self(bits & Self::all().0)
}
#[inline]
pub const fn from_bits_retain(bits: u64) -> Self { Self(bits) }
#[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
}
#[inline]
pub const fn is_empty(&self) -> bool {
self.0 == <u64 as ::bitflags::Bits>::EMPTY
}
#[inline]
pub const fn is_all(&self) -> bool {
Self::all().0 | self.0 == self.0
}
#[inline]
pub const fn intersects(&self, other: Self) -> bool {
self.0 & other.0 != <u64 as ::bitflags::Bits>::EMPTY
}
#[inline]
pub const fn contains(&self, other: Self) -> bool {
self.0 & other.0 == other.0
}
#[inline]
pub fn insert(&mut self, other: Self) {
*self = Self(self.0).union(other);
}
#[inline]
pub fn remove(&mut self, other: Self) {
*self = Self(self.0).difference(other);
}
#[inline]
pub fn toggle(&mut self, other: Self) {
*self = Self(self.0).symmetric_difference(other);
}
#[inline]
pub fn set(&mut self, other: Self, value: bool) {
if value { self.insert(other); } else { self.remove(other); }
}
#[inline]
#[must_use]
pub const fn intersection(self, other: Self) -> Self {
Self(self.0 & other.0)
}
#[inline]
#[must_use]
pub const fn union(self, other: Self) -> Self {
Self(self.0 | other.0)
}
#[inline]
#[must_use]
pub const fn difference(self, other: Self) -> Self {
Self(self.0 & !other.0)
}
#[inline]
#[must_use]
pub const fn symmetric_difference(self, other: Self) -> Self {
Self(self.0 ^ other.0)
}
#[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;
#[inline]
fn bitor(self, other: InternalBitFlags) -> Self {
self.union(other)
}
}
impl ::bitflags::__private::core::ops::BitOrAssign for
InternalBitFlags {
#[inline]
fn bitor_assign(&mut self, other: Self) { self.insert(other); }
}
impl ::bitflags::__private::core::ops::BitXor for InternalBitFlags {
type Output = Self;
#[inline]
fn bitxor(self, other: Self) -> Self {
self.symmetric_difference(other)
}
}
impl ::bitflags::__private::core::ops::BitXorAssign for
InternalBitFlags {
#[inline]
fn bitxor_assign(&mut self, other: Self) { self.toggle(other); }
}
impl ::bitflags::__private::core::ops::BitAnd for InternalBitFlags {
type Output = Self;
#[inline]
fn bitand(self, other: Self) -> Self { self.intersection(other) }
}
impl ::bitflags::__private::core::ops::BitAndAssign for
InternalBitFlags {
#[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;
#[inline]
fn sub(self, other: Self) -> Self { self.difference(other) }
}
impl ::bitflags::__private::core::ops::SubAssign for InternalBitFlags
{
#[inline]
fn sub_assign(&mut self, other: Self) { self.remove(other); }
}
impl ::bitflags::__private::core::ops::Not for InternalBitFlags {
type Output = Self;
#[inline]
fn not(self) -> Self { self.complement() }
}
impl ::bitflags::__private::core::iter::Extend<InternalBitFlags> for
InternalBitFlags {
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 {
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 {
#[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()))
}
#[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 {
#[inline]
pub fn bits_mut(&mut self) -> &mut u64 { &mut self.0 }
}
#[allow(dead_code, deprecated, unused_attributes)]
impl AllocKindFlags {
#[inline]
pub const fn empty() -> Self { Self(InternalBitFlags::empty()) }
#[inline]
pub const fn all() -> Self { Self(InternalBitFlags::all()) }
#[inline]
pub const fn bits(&self) -> u64 { self.0.bits() }
#[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,
}
}
#[inline]
pub const fn from_bits_truncate(bits: u64) -> Self {
Self(InternalBitFlags::from_bits_truncate(bits))
}
#[inline]
pub const fn from_bits_retain(bits: u64) -> Self {
Self(InternalBitFlags::from_bits_retain(bits))
}
#[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,
}
}
#[inline]
pub const fn is_empty(&self) -> bool { self.0.is_empty() }
#[inline]
pub const fn is_all(&self) -> bool { self.0.is_all() }
#[inline]
pub const fn intersects(&self, other: Self) -> bool {
self.0.intersects(other.0)
}
#[inline]
pub const fn contains(&self, other: Self) -> bool {
self.0.contains(other.0)
}
#[inline]
pub fn insert(&mut self, other: Self) { self.0.insert(other.0) }
#[inline]
pub fn remove(&mut self, other: Self) { self.0.remove(other.0) }
#[inline]
pub fn toggle(&mut self, other: Self) { self.0.toggle(other.0) }
#[inline]
pub fn set(&mut self, other: Self, value: bool) {
self.0.set(other.0, value)
}
#[inline]
#[must_use]
pub const fn intersection(self, other: Self) -> Self {
Self(self.0.intersection(other.0))
}
#[inline]
#[must_use]
pub const fn union(self, other: Self) -> Self {
Self(self.0.union(other.0))
}
#[inline]
#[must_use]
pub const fn difference(self, other: Self) -> Self {
Self(self.0.difference(other.0))
}
#[inline]
#[must_use]
pub const fn symmetric_difference(self, other: Self) -> Self {
Self(self.0.symmetric_difference(other.0))
}
#[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;
#[inline]
fn bitor(self, other: AllocKindFlags) -> Self {
self.union(other)
}
}
impl ::bitflags::__private::core::ops::BitOrAssign for AllocKindFlags
{
#[inline]
fn bitor_assign(&mut self, other: Self) { self.insert(other); }
}
impl ::bitflags::__private::core::ops::BitXor for AllocKindFlags {
type Output = Self;
#[inline]
fn bitxor(self, other: Self) -> Self {
self.symmetric_difference(other)
}
}
impl ::bitflags::__private::core::ops::BitXorAssign for AllocKindFlags
{
#[inline]
fn bitxor_assign(&mut self, other: Self) { self.toggle(other); }
}
impl ::bitflags::__private::core::ops::BitAnd for AllocKindFlags {
type Output = Self;
#[inline]
fn bitand(self, other: Self) -> Self { self.intersection(other) }
}
impl ::bitflags::__private::core::ops::BitAndAssign for AllocKindFlags
{
#[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;
#[inline]
fn sub(self, other: Self) -> Self { self.difference(other) }
}
impl ::bitflags::__private::core::ops::SubAssign for AllocKindFlags {
#[inline]
fn sub_assign(&mut self, other: Self) { self.remove(other); }
}
impl ::bitflags::__private::core::ops::Not for AllocKindFlags {
type Output = Self;
#[inline]
fn not(self) -> Self { self.complement() }
}
impl ::bitflags::__private::core::iter::Extend<AllocKindFlags> for
AllocKindFlags {
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 {
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 {
#[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()))
}
#[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! {
852 #[repr(transparent)]
853 #[derive(Default)]
854 pub(crate) struct AllocKindFlags : u64 {
855 const Unknown = 0;
856 const Alloc = 1;
857 const Realloc = 1 << 1;
858 const Free = 1 << 2;
859 const Uninitialized = 1 << 3;
860 const Zeroed = 1 << 4;
861 const Aligned = 1 << 5;
862 }
863}
864
865#[repr(transparent)]
pub struct GEPNoWrapFlags(<GEPNoWrapFlags as
::bitflags::__private::PublicFlags>::Internal);
#[automatically_derived]
impl ::core::default::Default for GEPNoWrapFlags {
#[inline]
fn default() -> Self {
GEPNoWrapFlags(::core::default::Default::default())
}
}
impl GEPNoWrapFlags {
#[allow(deprecated, non_upper_case_globals,)]
pub const InBounds: Self = Self::from_bits_retain(1 << 0);
#[allow(deprecated, non_upper_case_globals,)]
pub const NUSW: Self = Self::from_bits_retain(1 << 1);
#[allow(deprecated, non_upper_case_globals,)]
pub const NUW: Self = Self::from_bits_retain(1 << 2);
}
impl ::bitflags::Flags for GEPNoWrapFlags {
const FLAGS: &'static [::bitflags::Flag<GEPNoWrapFlags>] =
&[{
#[allow(deprecated, non_upper_case_globals,)]
::bitflags::Flag::new("InBounds", GEPNoWrapFlags::InBounds)
},
{
#[allow(deprecated, non_upper_case_globals,)]
::bitflags::Flag::new("NUSW", GEPNoWrapFlags::NUSW)
},
{
#[allow(deprecated, non_upper_case_globals,)]
::bitflags::Flag::new("NUW", GEPNoWrapFlags::NUW)
}];
type Bits = c_uint;
fn bits(&self) -> c_uint { GEPNoWrapFlags::bits(self) }
fn from_bits_retain(bits: c_uint) -> GEPNoWrapFlags {
GEPNoWrapFlags::from_bits_retain(bits)
}
}
#[allow(dead_code, deprecated, unused_doc_comments, unused_attributes,
unused_mut, unused_imports, non_upper_case_globals, clippy ::
assign_op_pattern, clippy :: indexing_slicing, clippy :: same_name_method,
clippy :: iter_without_into_iter,)]
const _: () =
{
#[repr(transparent)]
pub struct InternalBitFlags(c_uint);
#[automatically_derived]
#[doc(hidden)]
unsafe impl ::core::clone::TrivialClone for InternalBitFlags { }
#[automatically_derived]
impl ::core::clone::Clone for InternalBitFlags {
#[inline]
fn clone(&self) -> 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 {
#[inline]
pub const fn empty() -> Self {
Self(<c_uint as ::bitflags::Bits>::EMPTY)
}
#[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)
}
#[inline]
pub const fn bits(&self) -> c_uint { self.0 }
#[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 }
}
#[inline]
pub const fn from_bits_truncate(bits: c_uint) -> Self {
Self(bits & Self::all().0)
}
#[inline]
pub const fn from_bits_retain(bits: c_uint) -> Self { Self(bits) }
#[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
}
#[inline]
pub const fn is_empty(&self) -> bool {
self.0 == <c_uint as ::bitflags::Bits>::EMPTY
}
#[inline]
pub const fn is_all(&self) -> bool {
Self::all().0 | self.0 == self.0
}
#[inline]
pub const fn intersects(&self, other: Self) -> bool {
self.0 & other.0 != <c_uint as ::bitflags::Bits>::EMPTY
}
#[inline]
pub const fn contains(&self, other: Self) -> bool {
self.0 & other.0 == other.0
}
#[inline]
pub fn insert(&mut self, other: Self) {
*self = Self(self.0).union(other);
}
#[inline]
pub fn remove(&mut self, other: Self) {
*self = Self(self.0).difference(other);
}
#[inline]
pub fn toggle(&mut self, other: Self) {
*self = Self(self.0).symmetric_difference(other);
}
#[inline]
pub fn set(&mut self, other: Self, value: bool) {
if value { self.insert(other); } else { self.remove(other); }
}
#[inline]
#[must_use]
pub const fn intersection(self, other: Self) -> Self {
Self(self.0 & other.0)
}
#[inline]
#[must_use]
pub const fn union(self, other: Self) -> Self {
Self(self.0 | other.0)
}
#[inline]
#[must_use]
pub const fn difference(self, other: Self) -> Self {
Self(self.0 & !other.0)
}
#[inline]
#[must_use]
pub const fn symmetric_difference(self, other: Self) -> Self {
Self(self.0 ^ other.0)
}
#[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;
#[inline]
fn bitor(self, other: InternalBitFlags) -> Self {
self.union(other)
}
}
impl ::bitflags::__private::core::ops::BitOrAssign for
InternalBitFlags {
#[inline]
fn bitor_assign(&mut self, other: Self) { self.insert(other); }
}
impl ::bitflags::__private::core::ops::BitXor for InternalBitFlags {
type Output = Self;
#[inline]
fn bitxor(self, other: Self) -> Self {
self.symmetric_difference(other)
}
}
impl ::bitflags::__private::core::ops::BitXorAssign for
InternalBitFlags {
#[inline]
fn bitxor_assign(&mut self, other: Self) { self.toggle(other); }
}
impl ::bitflags::__private::core::ops::BitAnd for InternalBitFlags {
type Output = Self;
#[inline]
fn bitand(self, other: Self) -> Self { self.intersection(other) }
}
impl ::bitflags::__private::core::ops::BitAndAssign for
InternalBitFlags {
#[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;
#[inline]
fn sub(self, other: Self) -> Self { self.difference(other) }
}
impl ::bitflags::__private::core::ops::SubAssign for InternalBitFlags
{
#[inline]
fn sub_assign(&mut self, other: Self) { self.remove(other); }
}
impl ::bitflags::__private::core::ops::Not for InternalBitFlags {
type Output = Self;
#[inline]
fn not(self) -> Self { self.complement() }
}
impl ::bitflags::__private::core::iter::Extend<InternalBitFlags> for
InternalBitFlags {
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 {
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 {
#[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()))
}
#[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 {
#[inline]
pub fn bits_mut(&mut self) -> &mut c_uint { &mut self.0 }
}
#[allow(dead_code, deprecated, unused_attributes)]
impl GEPNoWrapFlags {
#[inline]
pub const fn empty() -> Self { Self(InternalBitFlags::empty()) }
#[inline]
pub const fn all() -> Self { Self(InternalBitFlags::all()) }
#[inline]
pub const fn bits(&self) -> c_uint { self.0.bits() }
#[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,
}
}
#[inline]
pub const fn from_bits_truncate(bits: c_uint) -> Self {
Self(InternalBitFlags::from_bits_truncate(bits))
}
#[inline]
pub const fn from_bits_retain(bits: c_uint) -> Self {
Self(InternalBitFlags::from_bits_retain(bits))
}
#[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,
}
}
#[inline]
pub const fn is_empty(&self) -> bool { self.0.is_empty() }
#[inline]
pub const fn is_all(&self) -> bool { self.0.is_all() }
#[inline]
pub const fn intersects(&self, other: Self) -> bool {
self.0.intersects(other.0)
}
#[inline]
pub const fn contains(&self, other: Self) -> bool {
self.0.contains(other.0)
}
#[inline]
pub fn insert(&mut self, other: Self) { self.0.insert(other.0) }
#[inline]
pub fn remove(&mut self, other: Self) { self.0.remove(other.0) }
#[inline]
pub fn toggle(&mut self, other: Self) { self.0.toggle(other.0) }
#[inline]
pub fn set(&mut self, other: Self, value: bool) {
self.0.set(other.0, value)
}
#[inline]
#[must_use]
pub const fn intersection(self, other: Self) -> Self {
Self(self.0.intersection(other.0))
}
#[inline]
#[must_use]
pub const fn union(self, other: Self) -> Self {
Self(self.0.union(other.0))
}
#[inline]
#[must_use]
pub const fn difference(self, other: Self) -> Self {
Self(self.0.difference(other.0))
}
#[inline]
#[must_use]
pub const fn symmetric_difference(self, other: Self) -> Self {
Self(self.0.symmetric_difference(other.0))
}
#[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;
#[inline]
fn bitor(self, other: GEPNoWrapFlags) -> Self {
self.union(other)
}
}
impl ::bitflags::__private::core::ops::BitOrAssign for GEPNoWrapFlags
{
#[inline]
fn bitor_assign(&mut self, other: Self) { self.insert(other); }
}
impl ::bitflags::__private::core::ops::BitXor for GEPNoWrapFlags {
type Output = Self;
#[inline]
fn bitxor(self, other: Self) -> Self {
self.symmetric_difference(other)
}
}
impl ::bitflags::__private::core::ops::BitXorAssign for GEPNoWrapFlags
{
#[inline]
fn bitxor_assign(&mut self, other: Self) { self.toggle(other); }
}
impl ::bitflags::__private::core::ops::BitAnd for GEPNoWrapFlags {
type Output = Self;
#[inline]
fn bitand(self, other: Self) -> Self { self.intersection(other) }
}
impl ::bitflags::__private::core::ops::BitAndAssign for GEPNoWrapFlags
{
#[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;
#[inline]
fn sub(self, other: Self) -> Self { self.difference(other) }
}
impl ::bitflags::__private::core::ops::SubAssign for GEPNoWrapFlags {
#[inline]
fn sub_assign(&mut self, other: Self) { self.remove(other); }
}
impl ::bitflags::__private::core::ops::Not for GEPNoWrapFlags {
type Output = Self;
#[inline]
fn not(self) -> Self { self.complement() }
}
impl ::bitflags::__private::core::iter::Extend<GEPNoWrapFlags> for
GEPNoWrapFlags {
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 {
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 {
#[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()))
}
#[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! {
867 #[repr(transparent)]
868 #[derive(Default)]
869 pub struct GEPNoWrapFlags : c_uint {
870 const InBounds = 1 << 0;
871 const NUSW = 1 << 1;
872 const NUW = 1 << 2;
873 }
874}
875
876unsafe extern "C" {
877 pub(crate) type Buffer;
878}
879
880pub(crate) type SelfProfileBeforePassCallback =
881 unsafe extern "C" fn(*mut c_void, *const c_char, *const c_char);
882pub(crate) type SelfProfileAfterPassCallback = unsafe extern "C" fn(*mut c_void);
883
884pub(crate) type GetSymbolsCallback =
885 unsafe extern "C" fn(*mut c_void, *const c_char) -> *mut c_void;
886pub(crate) type GetSymbolsErrorCallback = unsafe extern "C" fn(*const c_char) -> *mut c_void;
887
888unsafe extern "C" {
889 pub(crate) fn LLVMContextCreate() -> &'static mut Context;
891 pub(crate) fn LLVMContextDispose(C: &'static mut Context);
892 pub(crate) fn LLVMContextSetDiscardValueNames(C: &Context, Discard: Bool);
893 pub(crate) fn LLVMGetMDKindIDInContext(
894 C: &Context,
895 Name: *const c_char,
896 SLen: c_uint,
897 ) -> MetadataKindId;
898
899 pub(crate) safe fn LLVMGetVersion(major: &mut c_uint, minor: &mut c_uint, patch: &mut c_uint);
904
905 pub(crate) fn LLVMDisposeTargetMachine(T: ptr::NonNull<TargetMachine>);
906
907 pub(crate) fn LLVMModuleCreateWithNameInContext(
909 ModuleID: *const c_char,
910 C: &Context,
911 ) -> &Module;
912 pub(crate) safe fn LLVMCloneModule(M: &Module) -> &Module;
913
914 pub(crate) fn LLVMGetDataLayoutStr(M: &Module) -> *const c_char;
916 pub(crate) fn LLVMSetDataLayout(M: &Module, Triple: *const c_char);
917
918 pub(crate) fn LLVMGetInlineAsm<'ll>(
920 Ty: &'ll Type,
921 AsmString: *const c_uchar, AsmStringSize: size_t,
923 Constraints: *const c_uchar, ConstraintsSize: size_t,
925 HasSideEffects: llvm::Bool,
926 IsAlignStack: llvm::Bool,
927 Dialect: AsmDialect,
928 CanThrow: llvm::Bool,
929 ) -> &'ll Value;
930
931 pub(crate) safe fn LLVMGetTypeKind(Ty: &Type) -> RawEnum<TypeKind>;
932
933 pub(crate) fn LLVMInt1TypeInContext(C: &Context) -> &Type;
935 pub(crate) fn LLVMInt8TypeInContext(C: &Context) -> &Type;
936 pub(crate) fn LLVMInt16TypeInContext(C: &Context) -> &Type;
937 pub(crate) fn LLVMInt32TypeInContext(C: &Context) -> &Type;
938 pub(crate) fn LLVMInt64TypeInContext(C: &Context) -> &Type;
939 pub(crate) safe fn LLVMIntTypeInContext(C: &Context, NumBits: c_uint) -> &Type;
940
941 pub(crate) fn LLVMGetIntTypeWidth(IntegerTy: &Type) -> c_uint;
942
943 pub(crate) fn LLVMHalfTypeInContext(C: &Context) -> &Type;
945 pub(crate) fn LLVMFloatTypeInContext(C: &Context) -> &Type;
946 pub(crate) fn LLVMDoubleTypeInContext(C: &Context) -> &Type;
947 pub(crate) fn LLVMFP128TypeInContext(C: &Context) -> &Type;
948
949 pub(crate) fn LLVMBFloatTypeInContext(C: &Context) -> &Type;
951
952 pub(crate) fn LLVMFunctionType<'a>(
954 ReturnType: &'a Type,
955 ParamTypes: *const &'a Type,
956 ParamCount: c_uint,
957 IsVarArg: Bool,
958 ) -> &'a Type;
959 pub(crate) fn LLVMCountParamTypes(FunctionTy: &Type) -> c_uint;
960 pub(crate) fn LLVMGetParamTypes<'a>(FunctionTy: &'a Type, Dest: *mut &'a Type);
961 pub(crate) fn LLVMGetReturnType(FunctionTy: &Type) -> &Type;
962 pub(crate) fn LLVMIsFunctionVarArg(FunctionTy: &Type) -> Bool;
963
964 pub(crate) fn LLVMStructTypeInContext<'a>(
966 C: &'a Context,
967 ElementTypes: *const &'a Type,
968 ElementCount: c_uint,
969 Packed: Bool,
970 ) -> &'a Type;
971
972 pub(crate) safe fn LLVMPointerTypeInContext(C: &Context, AddressSpace: c_uint) -> &Type;
974 pub(crate) fn LLVMVectorType(ElementType: &Type, ElementCount: c_uint) -> &Type;
975 pub(crate) fn LLVMScalableVectorType(ElementType: &Type, ElementCount: c_uint) -> &Type;
976
977 pub(crate) fn LLVMGetElementType(Ty: &Type) -> &Type;
978 pub(crate) fn LLVMGetVectorSize(VectorTy: &Type) -> c_uint;
979
980 pub(crate) fn LLVMVoidTypeInContext(C: &Context) -> &Type;
982
983 pub(crate) fn LLVMTypeOf(Val: &Value) -> &Type;
985 pub(crate) fn LLVMGetValueName2(Val: &Value, Length: *mut size_t) -> *const c_char;
986 pub(crate) fn LLVMSetValueName2(Val: &Value, Name: *const c_char, NameLen: size_t);
987 pub(crate) fn LLVMReplaceAllUsesWith<'a>(OldVal: &'a Value, NewVal: &'a Value);
988 pub(crate) safe fn LLVMGetMetadata<'a>(
989 Val: &'a Value,
990 KindID: MetadataKindId,
991 ) -> Option<&'a Value>;
992 pub(crate) safe fn LLVMSetMetadata<'a>(Val: &'a Value, KindID: MetadataKindId, Node: &'a Value);
993 pub(crate) fn LLVMGlobalSetMetadata<'a>(
994 Val: &'a Value,
995 KindID: MetadataKindId,
996 Metadata: &'a Metadata,
997 );
998 pub(crate) safe fn LLVMValueAsMetadata(Node: &Value) -> &Metadata;
999
1000 pub(crate) fn LLVMConstNull(Ty: &Type) -> &Value;
1002 pub(crate) fn LLVMGetUndef(Ty: &Type) -> &Value;
1003 pub(crate) fn LLVMGetPoison(Ty: &Type) -> &Value;
1004
1005 pub(crate) fn LLVMMDStringInContext2(
1007 C: &Context,
1008 Str: *const c_char,
1009 SLen: size_t,
1010 ) -> &Metadata;
1011 pub(crate) fn LLVMMDNodeInContext2<'a>(
1012 C: &'a Context,
1013 Vals: *const &'a Metadata,
1014 Count: size_t,
1015 ) -> &'a Metadata;
1016 pub(crate) fn LLVMAddNamedMetadataOperand<'a>(
1017 M: &'a Module,
1018 Name: *const c_char,
1019 Val: &'a Value,
1020 );
1021 pub(crate) fn LLVMReplaceMDNodeOperandWith(Val: &Value, index: u32, replacement: &Metadata);
1022
1023 pub(crate) fn LLVMConstInt(IntTy: &Type, N: c_ulonglong, SignExtend: Bool) -> &Value;
1025 pub(crate) fn LLVMConstIntOfArbitraryPrecision(
1026 IntTy: &Type,
1027 Wn: c_uint,
1028 Ws: *const u64,
1029 ) -> &Value;
1030 pub(crate) fn LLVMConstReal(RealTy: &Type, N: f64) -> &Value;
1031
1032 pub(crate) fn LLVMConstArray2<'a>(
1034 ElementTy: &'a Type,
1035 ConstantVals: *const &'a Value,
1036 Length: u64,
1037 ) -> &'a Value;
1038 pub(crate) fn LLVMArrayType2(ElementType: &Type, ElementCount: u64) -> &Type;
1039 pub(crate) fn LLVMConstStringInContext2(
1040 C: &Context,
1041 Str: *const c_char,
1042 Length: size_t,
1043 DontNullTerminate: Bool,
1044 ) -> &Value;
1045 pub(crate) fn LLVMConstStructInContext<'a>(
1046 C: &'a Context,
1047 ConstantVals: *const &'a Value,
1048 Count: c_uint,
1049 Packed: Bool,
1050 ) -> &'a Value;
1051 pub(crate) fn LLVMConstNamedStruct<'a>(
1052 StructTy: &'a Type,
1053 ConstantVals: *const &'a Value,
1054 Count: c_uint,
1055 ) -> &'a Value;
1056 pub(crate) fn LLVMConstVector(ScalarConstantVals: *const &Value, Size: c_uint) -> &Value;
1057
1058 pub(crate) fn LLVMConstInBoundsGEP2<'a>(
1060 ty: &'a Type,
1061 ConstantVal: &'a Value,
1062 ConstantIndices: *const &'a Value,
1063 NumIndices: c_uint,
1064 ) -> &'a Value;
1065 pub(crate) fn LLVMConstPtrToInt<'a>(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
1066 pub(crate) fn LLVMConstIntToPtr<'a>(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
1067 pub(crate) fn LLVMConstBitCast<'a>(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
1068 pub(crate) fn LLVMConstPointerCast<'a>(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
1069 pub(crate) fn LLVMGetAggregateElement(ConstantVal: &Value, Idx: c_uint) -> Option<&Value>;
1070 pub(crate) fn LLVMGetConstOpcode(ConstantVal: &Value) -> Opcode;
1071 pub(crate) fn LLVMIsAConstantExpr(Val: &Value) -> Option<&Value>;
1072
1073 pub(crate) fn LLVMIsDeclaration(Global: &Value) -> Bool;
1075 pub(crate) fn LLVMGetLinkage(Global: &Value) -> RawEnum<Linkage>;
1076 pub(crate) fn LLVMSetLinkage(Global: &Value, RustLinkage: Linkage);
1077 pub(crate) fn LLVMSetSection(Global: &Value, Section: *const c_char);
1078 pub(crate) fn LLVMGetVisibility(Global: &Value) -> RawEnum<Visibility>;
1079 pub(crate) fn LLVMSetVisibility(Global: &Value, Viz: Visibility);
1080 pub(crate) fn LLVMGetAlignment(Global: &Value) -> c_uint;
1081 pub(crate) fn LLVMSetAlignment(Global: &Value, Bytes: c_uint);
1082 pub(crate) fn LLVMSetDLLStorageClass(V: &Value, C: DLLStorageClass);
1083 pub(crate) fn LLVMGlobalGetValueType(Global: &Value) -> &Type;
1084
1085 pub(crate) safe fn LLVMIsAGlobalVariable(GlobalVar: &Value) -> Option<&Value>;
1087 pub(crate) fn LLVMAddGlobal<'a>(M: &'a Module, Ty: &'a Type, Name: *const c_char) -> &'a Value;
1088 pub(crate) fn LLVMGetNamedGlobal(M: &Module, Name: *const c_char) -> Option<&Value>;
1089 pub(crate) fn LLVMGetFirstGlobal(M: &Module) -> Option<&Value>;
1090 pub(crate) fn LLVMGetNextGlobal(GlobalVar: &Value) -> Option<&Value>;
1091 pub(crate) fn LLVMDeleteGlobal(GlobalVar: &Value);
1092 pub(crate) safe fn LLVMGetInitializer(GlobalVar: &Value) -> Option<&Value>;
1093 pub(crate) fn LLVMSetInitializer<'a>(GlobalVar: &'a Value, ConstantVal: &'a Value);
1094 pub(crate) safe fn LLVMIsThreadLocal(GlobalVar: &Value) -> Bool;
1095 pub(crate) fn LLVMSetThreadLocalMode(GlobalVar: &Value, Mode: ThreadLocalMode);
1096 pub(crate) safe fn LLVMIsGlobalConstant(GlobalVar: &Value) -> Bool;
1097 pub(crate) safe fn LLVMSetGlobalConstant(GlobalVar: &Value, IsConstant: Bool);
1098 pub(crate) safe fn LLVMSetTailCall(CallInst: &Value, IsTailCall: Bool);
1099 pub(crate) safe fn LLVMSetTailCallKind(CallInst: &Value, kind: TailCallKind);
1100 pub(crate) safe fn LLVMSetExternallyInitialized(GlobalVar: &Value, IsExtInit: Bool);
1101
1102 pub(crate) fn LLVMAddAlias2<'ll>(
1104 M: &'ll Module,
1105 ValueTy: &Type,
1106 AddressSpace: c_uint,
1107 Aliasee: &Value,
1108 Name: *const c_char,
1109 ) -> &'ll Value;
1110 pub(crate) fn LLVMGetFirstGlobalAlias(M: &Module) -> Option<&Value>;
1111 pub(crate) fn LLVMGetNextGlobalAlias(GlobalAlias: &Value) -> Option<&Value>;
1112
1113 pub(crate) fn LLVMCreateStringAttribute(
1115 C: &Context,
1116 Name: *const c_char,
1117 NameLen: c_uint,
1118 Value: *const c_char,
1119 ValueLen: c_uint,
1120 ) -> &Attribute;
1121
1122 pub(crate) fn LLVMSetFunctionCallConv(Fn: &Value, CC: c_uint);
1124 pub(crate) fn LLVMAddFunction<'a>(
1125 Mod: &'a Module,
1126 Name: *const c_char,
1127 FunctionTy: &'a Type,
1128 ) -> &'a Value;
1129 pub(crate) fn LLVMDeleteFunction(Fn: &Value);
1130
1131 pub(crate) fn LLVMLookupIntrinsicID(Name: *const c_char, NameLen: size_t) -> c_uint;
1133 pub(crate) fn LLVMIntrinsicIsOverloaded(ID: NonZero<c_uint>) -> Bool;
1134 pub(crate) fn LLVMGetIntrinsicDeclaration<'a>(
1135 Mod: &'a Module,
1136 ID: NonZero<c_uint>,
1137 ParamTypes: *const &'a Type,
1138 ParamCount: size_t,
1139 ) -> &'a Value;
1140 pub(crate) fn LLVMRustUpgradeIntrinsicFunction<'a>(
1141 Fn: &'a Value,
1142 NewFn: &mut Option<&'a Value>,
1143 ) -> bool;
1144 pub(crate) fn LLVMRustIsTargetIntrinsic(ID: NonZero<c_uint>) -> bool;
1145
1146 pub(crate) fn LLVMIsAArgument(Val: &Value) -> Option<&Value>;
1148 pub(crate) safe fn LLVMCountParams(Fn: &Value) -> c_uint;
1149 pub(crate) fn LLVMGetParam(Fn: &Value, Index: c_uint) -> &Value;
1150
1151 pub(crate) fn LLVMGetBasicBlockParent(BB: &BasicBlock) -> &Value;
1153 pub(crate) fn LLVMAppendBasicBlockInContext<'a>(
1154 C: &'a Context,
1155 Fn: &'a Value,
1156 Name: *const c_char,
1157 ) -> &'a BasicBlock;
1158
1159 pub(crate) fn LLVMIsAInstruction(Val: &Value) -> Option<&Value>;
1161 pub(crate) fn LLVMGetFirstBasicBlock(Fn: &Value) -> &BasicBlock;
1162 pub(crate) fn LLVMGetOperand(Val: &Value, Index: c_uint) -> Option<&Value>;
1163
1164 pub(crate) fn LLVMSetInstructionCallConv(Instr: &Value, CC: c_uint);
1166
1167 pub(crate) fn LLVMSetVolatile(MemoryAccessInst: &Value, volatile: Bool);
1169 pub(crate) fn LLVMSetOrdering(MemoryAccessInst: &Value, Ordering: AtomicOrdering);
1170
1171 pub(crate) fn LLVMAddIncoming<'a>(
1173 PhiNode: &'a Value,
1174 IncomingValues: *const &'a Value,
1175 IncomingBlocks: *const &'a BasicBlock,
1176 Count: c_uint,
1177 );
1178
1179 pub(crate) fn LLVMCreateBuilderInContext(C: &Context) -> &mut Builder<'_>;
1181 pub(crate) fn LLVMPositionBuilderAtEnd<'a>(Builder: &Builder<'a>, Block: &'a BasicBlock);
1182 pub(crate) fn LLVMGetInsertBlock<'a>(Builder: &Builder<'a>) -> &'a BasicBlock;
1183 pub(crate) fn LLVMDisposeBuilder<'a>(Builder: &'a mut Builder<'a>);
1184
1185 pub(crate) fn LLVMSetCurrentDebugLocation2<'a>(Builder: &Builder<'a>, Loc: *const Metadata);
1187 pub(crate) fn LLVMGetCurrentDebugLocation2<'a>(Builder: &Builder<'a>) -> Option<&'a Metadata>;
1188
1189 pub(crate) safe fn LLVMBuildRetVoid<'a>(B: &Builder<'a>) -> &'a Value;
1191 pub(crate) fn LLVMBuildRet<'a>(B: &Builder<'a>, V: &'a Value) -> &'a Value;
1192 pub(crate) fn LLVMBuildBr<'a>(B: &Builder<'a>, Dest: &'a BasicBlock) -> &'a Value;
1193 pub(crate) fn LLVMBuildCondBr<'a>(
1194 B: &Builder<'a>,
1195 If: &'a Value,
1196 Then: &'a BasicBlock,
1197 Else: &'a BasicBlock,
1198 ) -> &'a Value;
1199 pub(crate) fn LLVMBuildSwitch<'a>(
1200 B: &Builder<'a>,
1201 V: &'a Value,
1202 Else: &'a BasicBlock,
1203 NumCases: c_uint,
1204 ) -> &'a Value;
1205 pub(crate) fn LLVMBuildLandingPad<'a>(
1206 B: &Builder<'a>,
1207 Ty: &'a Type,
1208 PersFn: Option<&'a Value>,
1209 NumClauses: c_uint,
1210 Name: *const c_char,
1211 ) -> &'a Value;
1212 pub(crate) fn LLVMBuildResume<'a>(B: &Builder<'a>, Exn: &'a Value) -> &'a Value;
1213 pub(crate) fn LLVMBuildUnreachable<'a>(B: &Builder<'a>) -> &'a Value;
1214
1215 pub(crate) fn LLVMBuildCleanupPad<'a>(
1216 B: &Builder<'a>,
1217 ParentPad: Option<&'a Value>,
1218 Args: *const &'a Value,
1219 NumArgs: c_uint,
1220 Name: *const c_char,
1221 ) -> Option<&'a Value>;
1222 pub(crate) fn LLVMBuildCleanupRet<'a>(
1223 B: &Builder<'a>,
1224 CleanupPad: &'a Value,
1225 BB: Option<&'a BasicBlock>,
1226 ) -> Option<&'a Value>;
1227 pub(crate) fn LLVMBuildCatchPad<'a>(
1228 B: &Builder<'a>,
1229 ParentPad: &'a Value,
1230 Args: *const &'a Value,
1231 NumArgs: c_uint,
1232 Name: *const c_char,
1233 ) -> Option<&'a Value>;
1234 pub(crate) fn LLVMBuildCatchRet<'a>(
1235 B: &Builder<'a>,
1236 CatchPad: &'a Value,
1237 BB: &'a BasicBlock,
1238 ) -> Option<&'a Value>;
1239 pub(crate) fn LLVMBuildCatchSwitch<'a>(
1240 Builder: &Builder<'a>,
1241 ParentPad: Option<&'a Value>,
1242 UnwindBB: Option<&'a BasicBlock>,
1243 NumHandlers: c_uint,
1244 Name: *const c_char,
1245 ) -> Option<&'a Value>;
1246 pub(crate) fn LLVMAddHandler<'a>(CatchSwitch: &'a Value, Dest: &'a BasicBlock);
1247 pub(crate) fn LLVMSetPersonalityFn<'a>(Func: &'a Value, Pers: &'a Value);
1248
1249 pub(crate) fn LLVMAddCase<'a>(Switch: &'a Value, OnVal: &'a Value, Dest: &'a BasicBlock);
1251
1252 pub(crate) fn LLVMAddClause<'a>(LandingPad: &'a Value, ClauseVal: &'a Value);
1254
1255 pub(crate) fn LLVMSetCleanup(LandingPad: &Value, Val: Bool);
1257
1258 pub(crate) fn LLVMBuildAdd<'a>(
1260 B: &Builder<'a>,
1261 LHS: &'a Value,
1262 RHS: &'a Value,
1263 Name: *const c_char,
1264 ) -> &'a Value;
1265 pub(crate) fn LLVMBuildFAdd<'a>(
1266 B: &Builder<'a>,
1267 LHS: &'a Value,
1268 RHS: &'a Value,
1269 Name: *const c_char,
1270 ) -> &'a Value;
1271 pub(crate) fn LLVMBuildSub<'a>(
1272 B: &Builder<'a>,
1273 LHS: &'a Value,
1274 RHS: &'a Value,
1275 Name: *const c_char,
1276 ) -> &'a Value;
1277 pub(crate) fn LLVMBuildFSub<'a>(
1278 B: &Builder<'a>,
1279 LHS: &'a Value,
1280 RHS: &'a Value,
1281 Name: *const c_char,
1282 ) -> &'a Value;
1283 pub(crate) fn LLVMBuildMul<'a>(
1284 B: &Builder<'a>,
1285 LHS: &'a Value,
1286 RHS: &'a Value,
1287 Name: *const c_char,
1288 ) -> &'a Value;
1289 pub(crate) fn LLVMBuildFMul<'a>(
1290 B: &Builder<'a>,
1291 LHS: &'a Value,
1292 RHS: &'a Value,
1293 Name: *const c_char,
1294 ) -> &'a Value;
1295 pub(crate) fn LLVMBuildUDiv<'a>(
1296 B: &Builder<'a>,
1297 LHS: &'a Value,
1298 RHS: &'a Value,
1299 Name: *const c_char,
1300 ) -> &'a Value;
1301 pub(crate) fn LLVMBuildExactUDiv<'a>(
1302 B: &Builder<'a>,
1303 LHS: &'a Value,
1304 RHS: &'a Value,
1305 Name: *const c_char,
1306 ) -> &'a Value;
1307 pub(crate) fn LLVMBuildSDiv<'a>(
1308 B: &Builder<'a>,
1309 LHS: &'a Value,
1310 RHS: &'a Value,
1311 Name: *const c_char,
1312 ) -> &'a Value;
1313 pub(crate) fn LLVMBuildExactSDiv<'a>(
1314 B: &Builder<'a>,
1315 LHS: &'a Value,
1316 RHS: &'a Value,
1317 Name: *const c_char,
1318 ) -> &'a Value;
1319 pub(crate) fn LLVMBuildFDiv<'a>(
1320 B: &Builder<'a>,
1321 LHS: &'a Value,
1322 RHS: &'a Value,
1323 Name: *const c_char,
1324 ) -> &'a Value;
1325 pub(crate) fn LLVMBuildURem<'a>(
1326 B: &Builder<'a>,
1327 LHS: &'a Value,
1328 RHS: &'a Value,
1329 Name: *const c_char,
1330 ) -> &'a Value;
1331 pub(crate) fn LLVMBuildSRem<'a>(
1332 B: &Builder<'a>,
1333 LHS: &'a Value,
1334 RHS: &'a Value,
1335 Name: *const c_char,
1336 ) -> &'a Value;
1337 pub(crate) fn LLVMBuildFRem<'a>(
1338 B: &Builder<'a>,
1339 LHS: &'a Value,
1340 RHS: &'a Value,
1341 Name: *const c_char,
1342 ) -> &'a Value;
1343 pub(crate) fn LLVMBuildShl<'a>(
1344 B: &Builder<'a>,
1345 LHS: &'a Value,
1346 RHS: &'a Value,
1347 Name: *const c_char,
1348 ) -> &'a Value;
1349 pub(crate) fn LLVMBuildLShr<'a>(
1350 B: &Builder<'a>,
1351 LHS: &'a Value,
1352 RHS: &'a Value,
1353 Name: *const c_char,
1354 ) -> &'a Value;
1355 pub(crate) fn LLVMBuildAShr<'a>(
1356 B: &Builder<'a>,
1357 LHS: &'a Value,
1358 RHS: &'a Value,
1359 Name: *const c_char,
1360 ) -> &'a Value;
1361 pub(crate) fn LLVMBuildNSWAdd<'a>(
1362 B: &Builder<'a>,
1363 LHS: &'a Value,
1364 RHS: &'a Value,
1365 Name: *const c_char,
1366 ) -> &'a Value;
1367 pub(crate) fn LLVMBuildNUWAdd<'a>(
1368 B: &Builder<'a>,
1369 LHS: &'a Value,
1370 RHS: &'a Value,
1371 Name: *const c_char,
1372 ) -> &'a Value;
1373 pub(crate) fn LLVMBuildNSWSub<'a>(
1374 B: &Builder<'a>,
1375 LHS: &'a Value,
1376 RHS: &'a Value,
1377 Name: *const c_char,
1378 ) -> &'a Value;
1379 pub(crate) fn LLVMBuildNUWSub<'a>(
1380 B: &Builder<'a>,
1381 LHS: &'a Value,
1382 RHS: &'a Value,
1383 Name: *const c_char,
1384 ) -> &'a Value;
1385 pub(crate) fn LLVMBuildNSWMul<'a>(
1386 B: &Builder<'a>,
1387 LHS: &'a Value,
1388 RHS: &'a Value,
1389 Name: *const c_char,
1390 ) -> &'a Value;
1391 pub(crate) fn LLVMBuildNUWMul<'a>(
1392 B: &Builder<'a>,
1393 LHS: &'a Value,
1394 RHS: &'a Value,
1395 Name: *const c_char,
1396 ) -> &'a Value;
1397 pub(crate) fn LLVMBuildAnd<'a>(
1398 B: &Builder<'a>,
1399 LHS: &'a Value,
1400 RHS: &'a Value,
1401 Name: *const c_char,
1402 ) -> &'a Value;
1403 pub(crate) fn LLVMBuildOr<'a>(
1404 B: &Builder<'a>,
1405 LHS: &'a Value,
1406 RHS: &'a Value,
1407 Name: *const c_char,
1408 ) -> &'a Value;
1409 pub(crate) fn LLVMBuildXor<'a>(
1410 B: &Builder<'a>,
1411 LHS: &'a Value,
1412 RHS: &'a Value,
1413 Name: *const c_char,
1414 ) -> &'a Value;
1415 pub(crate) fn LLVMBuildNeg<'a>(B: &Builder<'a>, V: &'a Value, Name: *const c_char)
1416 -> &'a Value;
1417 pub(crate) fn LLVMBuildFNeg<'a>(
1418 B: &Builder<'a>,
1419 V: &'a Value,
1420 Name: *const c_char,
1421 ) -> &'a Value;
1422 pub(crate) fn LLVMBuildNot<'a>(B: &Builder<'a>, V: &'a Value, Name: *const c_char)
1423 -> &'a Value;
1424
1425 pub(crate) fn LLVMSetIsDisjoint(Instr: &Value, IsDisjoint: Bool);
1427 pub(crate) fn LLVMSetNUW(ArithInst: &Value, HasNUW: Bool);
1428 pub(crate) fn LLVMSetNSW(ArithInst: &Value, HasNSW: Bool);
1429
1430 pub(crate) fn LLVMBuildAlloca<'a>(
1432 B: &Builder<'a>,
1433 Ty: &'a Type,
1434 Name: *const c_char,
1435 ) -> &'a Value;
1436 pub(crate) fn LLVMBuildLoad2<'a>(
1437 B: &Builder<'a>,
1438 Ty: &'a Type,
1439 PointerVal: &'a Value,
1440 Name: *const c_char,
1441 ) -> &'a Value;
1442
1443 pub(crate) fn LLVMBuildStore<'a>(B: &Builder<'a>, Val: &'a Value, Ptr: &'a Value) -> &'a Value;
1444
1445 pub(crate) fn LLVMBuildGEPWithNoWrapFlags<'a>(
1446 B: &Builder<'a>,
1447 Ty: &'a Type,
1448 Pointer: &'a Value,
1449 Indices: *const &'a Value,
1450 NumIndices: c_uint,
1451 Name: *const c_char,
1452 Flags: GEPNoWrapFlags,
1453 ) -> &'a Value;
1454
1455 pub(crate) fn LLVMBuildTrunc<'a>(
1457 B: &Builder<'a>,
1458 Val: &'a Value,
1459 DestTy: &'a Type,
1460 Name: *const c_char,
1461 ) -> &'a Value;
1462 pub(crate) fn LLVMBuildZExt<'a>(
1463 B: &Builder<'a>,
1464 Val: &'a Value,
1465 DestTy: &'a Type,
1466 Name: *const c_char,
1467 ) -> &'a Value;
1468 pub(crate) fn LLVMBuildSExt<'a>(
1469 B: &Builder<'a>,
1470 Val: &'a Value,
1471 DestTy: &'a Type,
1472 Name: *const c_char,
1473 ) -> &'a Value;
1474 pub(crate) fn LLVMBuildFPToUI<'a>(
1475 B: &Builder<'a>,
1476 Val: &'a Value,
1477 DestTy: &'a Type,
1478 Name: *const c_char,
1479 ) -> &'a Value;
1480 pub(crate) fn LLVMBuildFPToSI<'a>(
1481 B: &Builder<'a>,
1482 Val: &'a Value,
1483 DestTy: &'a Type,
1484 Name: *const c_char,
1485 ) -> &'a Value;
1486 pub(crate) fn LLVMBuildUIToFP<'a>(
1487 B: &Builder<'a>,
1488 Val: &'a Value,
1489 DestTy: &'a Type,
1490 Name: *const c_char,
1491 ) -> &'a Value;
1492 pub(crate) fn LLVMBuildSIToFP<'a>(
1493 B: &Builder<'a>,
1494 Val: &'a Value,
1495 DestTy: &'a Type,
1496 Name: *const c_char,
1497 ) -> &'a Value;
1498 pub(crate) fn LLVMBuildFPTrunc<'a>(
1499 B: &Builder<'a>,
1500 Val: &'a Value,
1501 DestTy: &'a Type,
1502 Name: *const c_char,
1503 ) -> &'a Value;
1504 pub(crate) fn LLVMBuildFPExt<'a>(
1505 B: &Builder<'a>,
1506 Val: &'a Value,
1507 DestTy: &'a Type,
1508 Name: *const c_char,
1509 ) -> &'a Value;
1510 pub(crate) fn LLVMBuildPtrToInt<'a>(
1511 B: &Builder<'a>,
1512 Val: &'a Value,
1513 DestTy: &'a Type,
1514 Name: *const c_char,
1515 ) -> &'a Value;
1516 pub(crate) fn LLVMBuildIntToPtr<'a>(
1517 B: &Builder<'a>,
1518 Val: &'a Value,
1519 DestTy: &'a Type,
1520 Name: *const c_char,
1521 ) -> &'a Value;
1522 pub(crate) fn LLVMBuildBitCast<'a>(
1523 B: &Builder<'a>,
1524 Val: &'a Value,
1525 DestTy: &'a Type,
1526 Name: *const c_char,
1527 ) -> &'a Value;
1528 pub(crate) fn LLVMBuildPointerCast<'a>(
1529 B: &Builder<'a>,
1530 Val: &'a Value,
1531 DestTy: &'a Type,
1532 Name: *const c_char,
1533 ) -> &'a Value;
1534 pub(crate) fn LLVMBuildIntCast2<'a>(
1535 B: &Builder<'a>,
1536 Val: &'a Value,
1537 DestTy: &'a Type,
1538 IsSigned: Bool,
1539 Name: *const c_char,
1540 ) -> &'a Value;
1541
1542 pub(crate) fn LLVMBuildICmp<'a>(
1544 B: &Builder<'a>,
1545 Op: c_uint,
1546 LHS: &'a Value,
1547 RHS: &'a Value,
1548 Name: *const c_char,
1549 ) -> &'a Value;
1550 pub(crate) fn LLVMBuildFCmp<'a>(
1551 B: &Builder<'a>,
1552 Op: c_uint,
1553 LHS: &'a Value,
1554 RHS: &'a Value,
1555 Name: *const c_char,
1556 ) -> &'a Value;
1557
1558 pub(crate) fn LLVMBuildPhi<'a>(B: &Builder<'a>, Ty: &'a Type, Name: *const c_char)
1560 -> &'a Value;
1561 pub(crate) fn LLVMBuildSelect<'a>(
1562 B: &Builder<'a>,
1563 If: &'a Value,
1564 Then: &'a Value,
1565 Else: &'a Value,
1566 Name: *const c_char,
1567 ) -> &'a Value;
1568 pub(crate) fn LLVMBuildVAArg<'a>(
1569 B: &Builder<'a>,
1570 list: &'a Value,
1571 Ty: &'a Type,
1572 Name: *const c_char,
1573 ) -> &'a Value;
1574 pub(crate) fn LLVMBuildExtractElement<'a>(
1575 B: &Builder<'a>,
1576 VecVal: &'a Value,
1577 Index: &'a Value,
1578 Name: *const c_char,
1579 ) -> &'a Value;
1580 pub(crate) fn LLVMBuildInsertElement<'a>(
1581 B: &Builder<'a>,
1582 VecVal: &'a Value,
1583 EltVal: &'a Value,
1584 Index: &'a Value,
1585 Name: *const c_char,
1586 ) -> &'a Value;
1587 pub(crate) fn LLVMBuildShuffleVector<'a>(
1588 B: &Builder<'a>,
1589 V1: &'a Value,
1590 V2: &'a Value,
1591 Mask: &'a Value,
1592 Name: *const c_char,
1593 ) -> &'a Value;
1594 pub(crate) fn LLVMBuildExtractValue<'a>(
1595 B: &Builder<'a>,
1596 AggVal: &'a Value,
1597 Index: c_uint,
1598 Name: *const c_char,
1599 ) -> &'a Value;
1600 pub(crate) fn LLVMBuildInsertValue<'a>(
1601 B: &Builder<'a>,
1602 AggVal: &'a Value,
1603 EltVal: &'a Value,
1604 Index: c_uint,
1605 Name: *const c_char,
1606 ) -> &'a Value;
1607
1608 pub(crate) fn LLVMBuildAtomicCmpXchg<'a>(
1610 B: &Builder<'a>,
1611 LHS: &'a Value,
1612 CMP: &'a Value,
1613 RHS: &'a Value,
1614 Order: AtomicOrdering,
1615 FailureOrder: AtomicOrdering,
1616 SingleThreaded: Bool,
1617 ) -> &'a Value;
1618
1619 pub(crate) fn LLVMSetWeak(CmpXchgInst: &Value, IsWeak: Bool);
1620
1621 pub(crate) fn LLVMBuildAtomicRMW<'a>(
1622 B: &Builder<'a>,
1623 Op: AtomicRmwBinOp,
1624 LHS: &'a Value,
1625 RHS: &'a Value,
1626 Order: AtomicOrdering,
1627 SingleThreaded: Bool,
1628 ) -> &'a Value;
1629
1630 pub(crate) fn LLVMBuildFence<'a>(
1631 B: &Builder<'a>,
1632 Order: AtomicOrdering,
1633 SingleThreaded: Bool,
1634 Name: *const c_char,
1635 ) -> &'a Value;
1636
1637 pub(crate) fn LLVMWriteBitcodeToFile(M: &Module, Path: *const c_char) -> c_int;
1639
1640 pub(crate) fn LLVMCreatePassManager<'a>() -> &'a mut PassManager<'a>;
1642
1643 pub(crate) fn LLVMAddAnalysisPasses<'a>(T: &'a TargetMachine, PM: &PassManager<'a>);
1644
1645 pub(crate) fn LLVMGetHostCPUFeatures() -> *mut c_char;
1646
1647 pub(crate) fn LLVMDisposeMessage(message: *mut c_char);
1648
1649 pub(crate) fn LLVMIsMultithreaded() -> Bool;
1650
1651 pub(crate) fn LLVMStructCreateNamed(C: &Context, Name: *const c_char) -> &Type;
1652
1653 pub(crate) fn LLVMStructSetBody<'a>(
1654 StructTy: &'a Type,
1655 ElementTypes: *const &'a Type,
1656 ElementCount: c_uint,
1657 Packed: Bool,
1658 );
1659
1660 pub(crate) fn LLVMCountStructElementTypes(StructTy: &Type) -> c_uint;
1661 pub(crate) fn LLVMGetStructElementTypes<'a>(StructTy: &'a Type, Dest: *mut &'a Type);
1662
1663 pub(crate) safe fn LLVMMetadataAsValue<'a>(C: &'a Context, MD: &'a Metadata) -> &'a Value;
1664
1665 pub(crate) safe fn LLVMSetUnnamedAddress(Global: &Value, UnnamedAddr: UnnamedAddr);
1666
1667 pub(crate) fn LLVMIsAConstantInt(value_ref: &Value) -> Option<&ConstantInt>;
1668
1669 pub(crate) fn LLVMGetOrInsertComdat(M: &Module, Name: *const c_char) -> &Comdat;
1670 pub(crate) fn LLVMSetComdat(V: &Value, C: &Comdat);
1671
1672 pub(crate) fn LLVMCreateOperandBundle(
1673 Tag: *const c_char,
1674 TagLen: size_t,
1675 Args: *const &'_ Value,
1676 NumArgs: c_uint,
1677 ) -> *mut OperandBundle<'_>;
1678 pub(crate) fn LLVMDisposeOperandBundle(Bundle: ptr::NonNull<OperandBundle<'_>>);
1679
1680 pub(crate) fn LLVMBuildCallWithOperandBundles<'a>(
1681 B: &Builder<'a>,
1682 Ty: &'a Type,
1683 Fn: &'a Value,
1684 Args: *const &'a Value,
1685 NumArgs: c_uint,
1686 Bundles: *const &OperandBundle<'a>,
1687 NumBundles: c_uint,
1688 Name: *const c_char,
1689 ) -> &'a Value;
1690 pub(crate) fn LLVMBuildInvokeWithOperandBundles<'a>(
1691 B: &Builder<'a>,
1692 Ty: &'a Type,
1693 Fn: &'a Value,
1694 Args: *const &'a Value,
1695 NumArgs: c_uint,
1696 Then: &'a BasicBlock,
1697 Catch: &'a BasicBlock,
1698 Bundles: *const &OperandBundle<'a>,
1699 NumBundles: c_uint,
1700 Name: *const c_char,
1701 ) -> &'a Value;
1702 pub(crate) fn LLVMBuildCallBr<'a>(
1703 B: &Builder<'a>,
1704 Ty: &'a Type,
1705 Fn: &'a Value,
1706 DefaultDest: &'a BasicBlock,
1707 IndirectDests: *const &'a BasicBlock,
1708 NumIndirectDests: c_uint,
1709 Args: *const &'a Value,
1710 NumArgs: c_uint,
1711 Bundles: *const &OperandBundle<'a>,
1712 NumBundles: c_uint,
1713 Name: *const c_char,
1714 ) -> &'a Value;
1715}
1716
1717unsafe extern "C" {
1724 pub(crate) fn LLVMCreateDIBuilder<'ll>(M: &'ll Module) -> *mut DIBuilder<'ll>;
1725 pub(crate) fn LLVMDisposeDIBuilder<'ll>(Builder: ptr::NonNull<DIBuilder<'ll>>);
1726
1727 pub(crate) fn LLVMDIBuilderFinalize<'ll>(Builder: &DIBuilder<'ll>);
1728
1729 pub(crate) fn LLVMDIBuilderCreateNameSpace<'ll>(
1730 Builder: &DIBuilder<'ll>,
1731 ParentScope: Option<&'ll Metadata>,
1732 Name: *const c_uchar, NameLen: size_t,
1734 ExportSymbols: llvm::Bool,
1735 ) -> &'ll Metadata;
1736
1737 pub(crate) fn LLVMDIBuilderCreateLexicalBlock<'ll>(
1738 Builder: &DIBuilder<'ll>,
1739 Scope: &'ll Metadata,
1740 File: &'ll Metadata,
1741 Line: c_uint,
1742 Column: c_uint,
1743 ) -> &'ll Metadata;
1744
1745 pub(crate) fn LLVMDIBuilderCreateLexicalBlockFile<'ll>(
1746 Builder: &DIBuilder<'ll>,
1747 Scope: &'ll Metadata,
1748 File: &'ll Metadata,
1749 Discriminator: c_uint, ) -> &'ll Metadata;
1751
1752 pub(crate) fn LLVMDIBuilderCreateDebugLocation<'ll>(
1753 Ctx: &'ll Context,
1754 Line: c_uint,
1755 Column: c_uint,
1756 Scope: &'ll Metadata,
1757 InlinedAt: Option<&'ll Metadata>,
1758 ) -> &'ll Metadata;
1759
1760 pub(crate) fn LLVMDIBuilderCreateSubroutineType<'ll>(
1761 Builder: &DIBuilder<'ll>,
1762 File: Option<&'ll Metadata>, ParameterTypes: *const Option<&'ll Metadata>,
1764 NumParameterTypes: c_uint,
1765 Flags: DIFlags, ) -> &'ll Metadata;
1767
1768 pub(crate) fn LLVMDIBuilderCreateEnumeratorOfArbitraryPrecision<'ll>(
1769 Builder: &DIBuilder<'ll>,
1770 Name: *const c_uchar, NameLen: size_t,
1772 SizeInBits: u64,
1773 Words: *const u64, IsUnsigned: llvm::Bool,
1775 ) -> &'ll Metadata;
1776
1777 pub(crate) fn LLVMDIBuilderCreateUnionType<'ll>(
1778 Builder: &DIBuilder<'ll>,
1779 Scope: Option<&'ll Metadata>,
1780 Name: *const c_uchar, NameLen: size_t,
1782 File: &'ll Metadata,
1783 LineNumber: c_uint,
1784 SizeInBits: u64,
1785 AlignInBits: u32,
1786 Flags: DIFlags,
1787 Elements: *const Option<&'ll Metadata>,
1788 NumElements: c_uint,
1789 RunTimeLang: c_uint, UniqueId: *const c_uchar, UniqueIdLen: size_t,
1792 ) -> &'ll Metadata;
1793
1794 pub(crate) fn LLVMDIBuilderCreateArrayType<'ll>(
1795 Builder: &DIBuilder<'ll>,
1796 Size: u64,
1797 Align: u32,
1798 Ty: &'ll Metadata,
1799 Subscripts: *const &'ll Metadata,
1800 NumSubscripts: c_uint,
1801 ) -> &'ll Metadata;
1802
1803 pub(crate) fn LLVMDIBuilderCreateBasicType<'ll>(
1804 Builder: &DIBuilder<'ll>,
1805 Name: *const c_uchar, NameLen: size_t,
1807 SizeInBits: u64,
1808 Encoding: c_uint, Flags: DIFlags, ) -> &'ll Metadata;
1811
1812 pub(crate) fn LLVMDIBuilderCreatePointerType<'ll>(
1813 Builder: &DIBuilder<'ll>,
1814 PointeeTy: &'ll Metadata,
1815 SizeInBits: u64,
1816 AlignInBits: u32,
1817 AddressSpace: c_uint, Name: *const c_uchar, NameLen: size_t,
1820 ) -> &'ll Metadata;
1821
1822 pub(crate) fn LLVMDIBuilderCreateStructType<'ll>(
1823 Builder: &DIBuilder<'ll>,
1824 Scope: Option<&'ll Metadata>,
1825 Name: *const c_uchar, NameLen: size_t,
1827 File: &'ll Metadata,
1828 LineNumber: c_uint,
1829 SizeInBits: u64,
1830 AlignInBits: u32,
1831 Flags: DIFlags,
1832 DerivedFrom: Option<&'ll Metadata>,
1833 Elements: *const Option<&'ll Metadata>,
1834 NumElements: c_uint,
1835 RunTimeLang: c_uint, VTableHolder: Option<&'ll Metadata>,
1837 UniqueId: *const c_uchar, UniqueIdLen: size_t,
1839 ) -> &'ll Metadata;
1840
1841 pub(crate) fn LLVMDIBuilderCreateMemberType<'ll>(
1842 Builder: &DIBuilder<'ll>,
1843 Scope: &'ll Metadata,
1844 Name: *const c_uchar, NameLen: size_t,
1846 File: &'ll Metadata,
1847 LineNo: c_uint,
1848 SizeInBits: u64,
1849 AlignInBits: u32,
1850 OffsetInBits: u64,
1851 Flags: DIFlags,
1852 Ty: &'ll Metadata,
1853 ) -> &'ll Metadata;
1854
1855 pub(crate) fn LLVMDIBuilderCreateStaticMemberType<'ll>(
1856 Builder: &DIBuilder<'ll>,
1857 Scope: &'ll Metadata,
1858 Name: *const c_uchar, NameLen: size_t,
1860 File: &'ll Metadata,
1861 LineNumber: c_uint,
1862 Type: &'ll Metadata,
1863 Flags: DIFlags,
1864 ConstantVal: Option<&'ll Value>,
1865 AlignInBits: u32,
1866 ) -> &'ll Metadata;
1867
1868 pub(crate) fn LLVMDIBuilderCreateQualifiedType<'ll>(
1871 Builder: &DIBuilder<'ll>,
1872 Tag: c_uint, Type: &'ll Metadata,
1874 ) -> &'ll Metadata;
1875
1876 pub(crate) fn LLVMDIBuilderCreateTypedef<'ll>(
1877 Builder: &DIBuilder<'ll>,
1878 Type: &'ll Metadata,
1879 Name: *const c_uchar, NameLen: size_t,
1881 File: &'ll Metadata,
1882 LineNo: c_uint,
1883 Scope: Option<&'ll Metadata>,
1884 AlignInBits: u32, ) -> &'ll Metadata;
1886
1887 pub(crate) fn LLVMDIBuilderGetOrCreateSubrange<'ll>(
1888 Builder: &DIBuilder<'ll>,
1889 LowerBound: i64,
1890 Count: i64,
1891 ) -> &'ll Metadata;
1892
1893 pub(crate) fn LLVMDIBuilderGetOrCreateArray<'ll>(
1894 Builder: &DIBuilder<'ll>,
1895 Data: *const Option<&'ll Metadata>,
1896 NumElements: size_t,
1897 ) -> &'ll Metadata;
1898
1899 pub(crate) fn LLVMDIBuilderCreateExpression<'ll>(
1900 Builder: &DIBuilder<'ll>,
1901 Addr: *const u64,
1902 Length: size_t,
1903 ) -> &'ll Metadata;
1904
1905 pub(crate) fn LLVMDIBuilderCreateGlobalVariableExpression<'ll>(
1906 Builder: &DIBuilder<'ll>,
1907 Scope: Option<&'ll Metadata>,
1908 Name: *const c_uchar, NameLen: size_t,
1910 Linkage: *const c_uchar, LinkLen: size_t,
1912 File: &'ll Metadata,
1913 LineNo: c_uint,
1914 Ty: &'ll Metadata,
1915 LocalToUnit: llvm::Bool,
1916 Expr: &'ll Metadata,
1917 Decl: Option<&'ll Metadata>,
1918 AlignInBits: u32,
1919 ) -> &'ll Metadata;
1920
1921 pub(crate) fn LLVMDIBuilderInsertDeclareRecordAtEnd<'ll>(
1922 Builder: &DIBuilder<'ll>,
1923 Storage: &'ll Value,
1924 VarInfo: &'ll Metadata,
1925 Expr: &'ll Metadata,
1926 DebugLoc: &'ll Metadata,
1927 Block: &'ll BasicBlock,
1928 ) -> &'ll DbgRecord;
1929
1930 pub(crate) fn LLVMDIBuilderInsertDbgValueRecordAtEnd<'ll>(
1931 Builder: &DIBuilder<'ll>,
1932 Val: &'ll Value,
1933 VarInfo: &'ll Metadata,
1934 Expr: &'ll Metadata,
1935 DebugLoc: &'ll Metadata,
1936 Block: &'ll BasicBlock,
1937 ) -> &'ll DbgRecord;
1938
1939 pub(crate) fn LLVMDIBuilderCreateAutoVariable<'ll>(
1940 Builder: &DIBuilder<'ll>,
1941 Scope: &'ll Metadata,
1942 Name: *const c_uchar, NameLen: size_t,
1944 File: &'ll Metadata,
1945 LineNo: c_uint,
1946 Ty: &'ll Metadata,
1947 AlwaysPreserve: llvm::Bool, Flags: DIFlags,
1949 AlignInBits: u32,
1950 ) -> &'ll Metadata;
1951
1952 pub(crate) fn LLVMDIBuilderCreateParameterVariable<'ll>(
1953 Builder: &DIBuilder<'ll>,
1954 Scope: &'ll Metadata,
1955 Name: *const c_uchar, NameLen: size_t,
1957 ArgNo: c_uint,
1958 File: &'ll Metadata,
1959 LineNo: c_uint,
1960 Ty: &'ll Metadata,
1961 AlwaysPreserve: llvm::Bool, Flags: DIFlags,
1963 ) -> &'ll Metadata;
1964}
1965
1966#[link(name = "llvm-wrapper", kind = "static")]
1967unsafe extern "C" {
1968 pub(crate) fn LLVMRustInstallErrorHandlers();
1969 pub(crate) fn LLVMRustDisableSystemDialogsOnCrash();
1970
1971 pub(crate) fn LLVMRustGlobalAddMetadata<'a>(
1974 Val: &'a Value,
1975 KindID: MetadataKindId,
1976 Metadata: &'a Metadata,
1977 );
1978 pub(crate) fn LLVMRustIsNonGVFunctionPointerTy(Val: &Value) -> bool;
1979 pub(crate) fn LLVMRustStripPointerCasts<'a>(Val: &'a Value) -> &'a Value;
1980
1981 pub(crate) fn LLVMRustConstIntGetZExtValue(ConstantVal: &ConstantInt, Value: &mut u64) -> bool;
1983 pub(crate) fn LLVMRustConstInt128Get(
1984 ConstantVal: &ConstantInt,
1985 SExt: bool,
1986 high: &mut u64,
1987 low: &mut u64,
1988 ) -> bool;
1989
1990 pub(crate) fn LLVMRustSetDSOLocal(Global: &Value, is_dso_local: bool);
1992
1993 pub(crate) fn LLVMRustGetOrInsertGlobal<'a>(
1995 M: &'a Module,
1996 Name: *const c_char,
1997 NameLen: size_t,
1998 T: &'a Type,
1999 ) -> &'a Value;
2000 pub(crate) fn LLVMRustGetOrInsertGlobalInAddrspace<'a>(
2001 M: &'a Module,
2002 Name: *const c_char,
2003 NameLen: size_t,
2004 T: &'a Type,
2005 AddressSpace: c_uint,
2006 ) -> &'a Value;
2007 pub(crate) fn LLVMRustGetNamedValue(
2008 M: &Module,
2009 Name: *const c_char,
2010 NameLen: size_t,
2011 ) -> Option<&Value>;
2012
2013 pub(crate) fn LLVMRustCreateAttrNoValue(C: &Context, attr: AttributeKind) -> &Attribute;
2015 pub(crate) fn LLVMRustCreateAlignmentAttr(C: &Context, bytes: u64) -> &Attribute;
2016 pub(crate) fn LLVMRustCreateDereferenceableAttr(C: &Context, bytes: u64) -> &Attribute;
2017 pub(crate) fn LLVMRustCreateDereferenceableOrNullAttr(C: &Context, bytes: u64) -> &Attribute;
2018 pub(crate) fn LLVMRustCreateByValAttr<'a>(C: &'a Context, ty: &'a Type) -> &'a Attribute;
2019 pub(crate) fn LLVMRustCreateByRefAttr<'a>(C: &'a Context, ty: &'a Type) -> &'a Attribute;
2020 pub(crate) fn LLVMRustCreateStructRetAttr<'a>(C: &'a Context, ty: &'a Type) -> &'a Attribute;
2021 pub(crate) fn LLVMRustCreateElementTypeAttr<'a>(C: &'a Context, ty: &'a Type) -> &'a Attribute;
2022 pub(crate) fn LLVMRustCreateUWTableAttr(C: &Context, async_: bool) -> &Attribute;
2023 pub(crate) fn LLVMRustCreateAllocSizeAttr(C: &Context, size_arg: u32) -> &Attribute;
2024 pub(crate) fn LLVMRustCreateAllocKindAttr(C: &Context, size_arg: u64) -> &Attribute;
2025 pub(crate) fn LLVMRustCreateMemoryEffectsAttr(
2026 C: &Context,
2027 effects: MemoryEffects,
2028 ) -> &Attribute;
2029 pub(crate) fn LLVMRustCreateRangeAttribute(
2036 C: &Context,
2037 NumBits: c_uint,
2038 LowerWords: *const u64,
2039 UpperWords: *const u64,
2040 ) -> &Attribute;
2041
2042 pub(crate) fn LLVMRustGetOrInsertFunction<'a>(
2045 M: &'a Module,
2046 Name: *const c_char,
2047 NameLen: size_t,
2048 FunctionTy: &'a Type,
2049 ) -> &'a Value;
2050 pub(crate) fn LLVMRustAddFunctionAttributes<'a>(
2051 Fn: &'a Value,
2052 index: c_uint,
2053 Attrs: *const &'a Attribute,
2054 AttrsLen: size_t,
2055 );
2056
2057 pub(crate) fn LLVMRustAddCallSiteAttributes<'a>(
2059 Instr: &'a Value,
2060 index: c_uint,
2061 Attrs: *const &'a Attribute,
2062 AttrsLen: size_t,
2063 );
2064
2065 pub(crate) fn LLVMRustSetFastMath(Instr: &Value);
2066 pub(crate) fn LLVMRustSetAlgebraicMath(Instr: &Value);
2067 pub(crate) fn LLVMRustSetAllowReassoc(Instr: &Value);
2068 pub(crate) fn LLVMRustSetNoSignedZeros(Instr: &Value);
2069
2070 pub(crate) fn LLVMRustBuildMemCpy<'a>(
2072 B: &Builder<'a>,
2073 Dst: &'a Value,
2074 DstAlign: c_uint,
2075 Src: &'a Value,
2076 SrcAlign: c_uint,
2077 Size: &'a Value,
2078 IsVolatile: bool,
2079 ) -> &'a Value;
2080 pub(crate) fn LLVMRustBuildMemMove<'a>(
2081 B: &Builder<'a>,
2082 Dst: &'a Value,
2083 DstAlign: c_uint,
2084 Src: &'a Value,
2085 SrcAlign: c_uint,
2086 Size: &'a Value,
2087 IsVolatile: bool,
2088 ) -> &'a Value;
2089 pub(crate) fn LLVMRustBuildMemSet<'a>(
2090 B: &Builder<'a>,
2091 Dst: &'a Value,
2092 DstAlign: c_uint,
2093 Val: &'a Value,
2094 Size: &'a Value,
2095 IsVolatile: bool,
2096 ) -> &'a Value;
2097
2098 pub(crate) fn LLVMRustBuildVScale<'a>(B: &Builder<'a>, Ty: &'a Type) -> &'a Value;
2099
2100 pub(crate) fn LLVMRustTimeTraceProfilerInitialize();
2101
2102 pub(crate) fn LLVMRustTimeTraceProfilerFinishThread();
2103
2104 pub(crate) fn LLVMRustTimeTraceProfilerFinish(FileName: *const c_char);
2105
2106 pub(crate) fn LLVMRustGetLastError() -> *const c_char;
2108
2109 pub(crate) fn LLVMRustPrintPassTimings(OutStr: &RustString);
2111
2112 pub(crate) fn LLVMRustPrintStatistics(OutStr: &RustString);
2114
2115 pub(crate) fn LLVMRustPrintStatisticsJSON(OutStr: &RustString);
2117
2118 pub(crate) fn LLVMRustInlineAsmVerify(
2119 Ty: &Type,
2120 Constraints: *const c_uchar, ConstraintsLen: size_t,
2122 ) -> bool;
2123
2124 pub(crate) fn LLVMRustAppendModuleInlineAsm(
2126 M: &Module,
2127 Asm: *const c_uchar, AsmLen: size_t,
2129 TargetFeatures: *const c_uchar, TargetFeaturesLen: size_t,
2131 TargetCpu: *const c_uchar, TargetCpuLen: size_t,
2133 );
2134
2135 pub(crate) fn LLVMRustCoverageWriteFilenamesToBuffer(
2139 Filenames: *const *const c_uchar, FilenamesLen: size_t,
2141 Lengths: *const size_t,
2142 LengthsLen: size_t,
2143 BufferOut: &RustString,
2144 );
2145
2146 pub(crate) fn LLVMRustCoverageWriteFunctionMappingsToBuffer(
2147 VirtualFileMappingIDs: *const c_uint,
2148 NumVirtualFileMappingIDs: size_t,
2149 Expressions: *const crate::coverageinfo::ffi::CounterExpression,
2150 NumExpressions: size_t,
2151 CodeRegions: *const crate::coverageinfo::ffi::CodeRegion,
2152 NumCodeRegions: size_t,
2153 ExpansionRegions: *const crate::coverageinfo::ffi::ExpansionRegion,
2154 NumExpansionRegions: size_t,
2155 BranchRegions: *const crate::coverageinfo::ffi::BranchRegion,
2156 NumBranchRegions: size_t,
2157 BufferOut: &RustString,
2158 );
2159
2160 pub(crate) fn LLVMRustCoverageCreatePGOFuncNameVar(
2161 F: &Value,
2162 FuncName: *const c_uchar, FuncNameLen: size_t,
2164 ) -> &Value;
2165 pub(crate) fn LLVMRustCoverageHashBytes(
2166 Bytes: *const c_uchar, NumBytes: size_t,
2168 ) -> u64;
2169
2170 pub(crate) safe fn LLVMRustCoverageWriteCovmapSectionNameToString(
2171 M: &Module,
2172 OutStr: &RustString,
2173 );
2174 pub(crate) safe fn LLVMRustCoverageWriteCovfunSectionNameToString(
2175 M: &Module,
2176 OutStr: &RustString,
2177 );
2178 pub(crate) safe fn LLVMRustCoverageWriteCovmapVarNameToString(OutStr: &RustString);
2179
2180 pub(crate) safe fn LLVMRustCoverageMappingVersion() -> u32;
2181 pub(crate) fn LLVMRustDebugMetadataVersion() -> u32;
2182
2183 pub(crate) safe fn LLVMRustVersionMajor() -> u32;
2189
2190 pub(crate) fn LLVMRustAddModuleFlagU32(
2195 M: &Module,
2196 MergeBehavior: ModuleFlagMergeBehavior,
2197 Name: *const c_char,
2198 NameLen: size_t,
2199 Value: u32,
2200 );
2201
2202 pub(crate) fn LLVMRustAddModuleFlagString(
2203 M: &Module,
2204 MergeBehavior: ModuleFlagMergeBehavior,
2205 Name: *const c_char,
2206 NameLen: size_t,
2207 Value: *const c_char,
2208 ValueLen: size_t,
2209 );
2210
2211 pub(crate) fn LLVMRustDIBuilderCreateCompileUnit<'a>(
2215 Builder: &DIBuilder<'a>,
2216 Lang: c_uint,
2217 File: &'a DIFile,
2218 Producer: *const c_char,
2219 ProducerLen: size_t,
2220 isOptimized: bool,
2221 Flags: *const c_char,
2222 RuntimeVer: c_uint,
2223 SplitName: *const c_char,
2224 SplitNameLen: size_t,
2225 kind: DebugEmissionKind,
2226 DWOId: u64,
2227 SplitDebugInlining: bool,
2228 DebugNameTableKind: DebugNameTableKind,
2229 ) -> &'a DIDescriptor;
2230
2231 pub(crate) fn LLVMRustDIBuilderCreateFile<'a>(
2234 Builder: &DIBuilder<'a>,
2235 Filename: *const c_char,
2236 FilenameLen: size_t,
2237 Directory: *const c_char,
2238 DirectoryLen: size_t,
2239 CSKind: ChecksumKind,
2240 Checksum: *const c_char,
2241 ChecksumLen: size_t,
2242 Source: *const c_char,
2243 SourceLen: size_t,
2244 ) -> &'a DIFile;
2245
2246 pub(crate) fn LLVMRustDIBuilderCreateFunction<'a>(
2249 Builder: &DIBuilder<'a>,
2250 Scope: &'a DIDescriptor,
2251 Name: *const c_char,
2252 NameLen: size_t,
2253 LinkageName: *const c_char,
2254 LinkageNameLen: size_t,
2255 File: &'a DIFile,
2256 LineNo: c_uint,
2257 Ty: &'a DIType,
2258 ScopeLine: c_uint,
2259 Flags: DIFlags,
2260 SPFlags: DISPFlags,
2261 MaybeFn: Option<&'a Value>,
2262 TParam: &'a DIArray,
2263 Decl: Option<&'a DIDescriptor>,
2264 ) -> &'a DISubprogram;
2265
2266 pub(crate) fn LLVMRustDIBuilderCreateMethod<'a>(
2268 Builder: &DIBuilder<'a>,
2269 Scope: &'a DIDescriptor,
2270 Name: *const c_char,
2271 NameLen: size_t,
2272 LinkageName: *const c_char,
2273 LinkageNameLen: size_t,
2274 File: &'a DIFile,
2275 LineNo: c_uint,
2276 Ty: &'a DIType,
2277 Flags: DIFlags,
2278 SPFlags: DISPFlags,
2279 TParam: &'a DIArray,
2280 ) -> &'a DISubprogram;
2281
2282 pub(crate) fn LLVMRustDIBuilderCreateVariantMemberType<'a>(
2284 Builder: &DIBuilder<'a>,
2285 Scope: &'a DIScope,
2286 Name: *const c_char,
2287 NameLen: size_t,
2288 File: &'a DIFile,
2289 LineNumber: c_uint,
2290 SizeInBits: u64,
2291 AlignInBits: u32,
2292 OffsetInBits: u64,
2293 Discriminant: Option<&'a Value>,
2294 Flags: DIFlags,
2295 Ty: &'a DIType,
2296 ) -> &'a DIType;
2297
2298 pub(crate) fn LLVMRustDIBuilderCreateEnumerationType<'a>(
2300 Builder: &DIBuilder<'a>,
2301 Scope: &'a DIScope,
2302 Name: *const c_char,
2303 NameLen: size_t,
2304 File: &'a DIFile,
2305 LineNumber: c_uint,
2306 SizeInBits: u64,
2307 AlignInBits: u32,
2308 Elements: &'a DIArray,
2309 ClassType: &'a DIType,
2310 IsScoped: bool,
2311 ) -> &'a DIType;
2312
2313 pub(crate) fn LLVMRustDIBuilderCreateVariantPart<'a>(
2315 Builder: &DIBuilder<'a>,
2316 Scope: &'a DIScope,
2317 Name: *const c_char,
2318 NameLen: size_t,
2319 File: &'a DIFile,
2320 LineNo: c_uint,
2321 SizeInBits: u64,
2322 AlignInBits: u32,
2323 Flags: DIFlags,
2324 Discriminator: Option<&'a DIDerivedType>,
2325 Elements: &'a DIArray,
2326 UniqueId: *const c_char,
2327 UniqueIdLen: size_t,
2328 ) -> &'a DIDerivedType;
2329
2330 pub(crate) fn LLVMRustDIBuilderCreateTemplateTypeParameter<'a>(
2332 Builder: &DIBuilder<'a>,
2333 Scope: Option<&'a DIScope>,
2334 Name: *const c_char,
2335 NameLen: size_t,
2336 Ty: &'a DIType,
2337 ) -> &'a DITemplateTypeParameter;
2338
2339 pub(crate) fn LLVMRustDICompositeTypeReplaceArrays<'a>(
2342 Builder: &DIBuilder<'a>,
2343 CompositeType: &'a DIType,
2344 Elements: Option<&'a DIArray>,
2345 Params: Option<&'a DIArray>,
2346 );
2347
2348 pub(crate) fn LLVMRustDIGetOrCreateSubrange<'a>(
2351 Builder: &DIBuilder<'a>,
2352 CountNode: Option<&'a Metadata>,
2353 LB: &'a Metadata,
2354 UB: &'a Metadata,
2355 Stride: Option<&'a Metadata>,
2356 ) -> &'a Metadata;
2357
2358 pub(crate) fn LLVMRustDICreateVectorType<'a>(
2361 Builder: &DIBuilder<'a>,
2362 Size: u64,
2363 AlignInBits: u32,
2364 Type: &'a DIType,
2365 Subscripts: &'a DIArray,
2366 BitStride: Option<&'a Metadata>,
2367 ) -> &'a Metadata;
2368
2369 pub(crate) fn LLVMRustDILocationCloneWithBaseDiscriminator<'a>(
2371 Location: &'a DILocation,
2372 BD: c_uint,
2373 ) -> Option<&'a DILocation>;
2374
2375 pub(crate) fn LLVMRustWriteTypeToString(Type: &Type, s: &RustString);
2376 pub(crate) fn LLVMRustWriteValueToString(value_ref: &Value, s: &RustString);
2377
2378 pub(crate) fn LLVMRustTargetHasMnemonic(T: &TargetMachine, s: *const c_char) -> bool;
2379
2380 pub(crate) fn LLVMRustPrintTargetCPUs(TM: &TargetMachine, OutStr: &RustString);
2381 pub(crate) fn LLVMRustGetTargetFeaturesCount(T: &TargetMachine) -> size_t;
2382 pub(crate) fn LLVMRustGetTargetFeature(
2383 T: &TargetMachine,
2384 Index: size_t,
2385 Feature: &mut *const c_char,
2386 Desc: &mut *const c_char,
2387 );
2388
2389 pub(crate) fn LLVMRustGetHostCPUName(LenOut: &mut size_t) -> *const u8;
2390
2391 pub(crate) fn LLVMRustCreateTargetMachine(
2394 Triple: *const c_char,
2395 CPU: *const c_char,
2396 Features: *const c_char,
2397 Abi: *const c_char,
2398 Model: CodeModel,
2399 Reloc: RelocModel,
2400 Level: CodeGenOptLevel,
2401 FloatABIType: FloatAbi,
2402 FunctionSections: bool,
2403 DataSections: bool,
2404 UniqueSectionNames: bool,
2405 TrapUnreachable: bool,
2406 Singlethread: bool,
2407 VerboseAsm: bool,
2408 EmitStackSizeSection: bool,
2409 RelaxELFRelocations: bool,
2410 UseInitArray: bool,
2411 SplitDwarfFile: *const c_char,
2412 OutputObjFile: *const c_char,
2413 DebugInfoCompression: CompressionKind,
2414 UseEmulatedTls: bool,
2415 UseWasmEH: bool,
2416 LargeDataThreshold: u64,
2417 ) -> *mut TargetMachine;
2418
2419 pub(crate) fn LLVMRustCreateMCSubtargetInfo(
2420 TripleStr: *const c_char,
2421 CPU: *const c_char,
2422 Features: *const c_char,
2423 ) -> *mut MCSubtargetInfo;
2424
2425 pub(crate) fn LLVMRustMCSubtargetInfoCheckFeatures(
2426 MCInfo: &MCSubtargetInfo,
2427 Features: *const c_uchar, FeaturesLen: usize,
2429 ) -> bool;
2430
2431 pub(crate) fn LLVMRustDisposeMCSubtargetInfo(MCInfo: ptr::NonNull<MCSubtargetInfo>);
2432
2433 pub(crate) fn LLVMRustAddLibraryInfo<'a>(
2434 T: &TargetMachine,
2435 PM: &PassManager<'a>,
2436 M: &'a Module,
2437 DisableSimplifyLibCalls: bool,
2438 );
2439 pub(crate) fn LLVMRustWriteOutputFile<'a>(
2440 T: &'a TargetMachine,
2441 PM: *mut PassManager<'a>,
2442 M: &'a Module,
2443 Output: *const c_char,
2444 DwoOutput: *const c_char,
2445 FileType: FileType,
2446 VerifyIR: bool,
2447 ) -> LLVMRustResult;
2448 pub(crate) fn LLVMRustOptimize<'a>(
2449 M: &'a Module,
2450 TM: &'a TargetMachine,
2451 OptLevel: PassBuilderOptLevel,
2452 OptStage: OptStage,
2453 IsLinkerPluginLTO: bool,
2454 NoPrepopulatePasses: bool,
2455 VerifyIR: bool,
2456 LintIR: bool,
2457 ThinLTOBuffer: Option<&mut Option<crate::back::lto::Buffer>>,
2458 ThinLTOSummaryBuffer: Option<&mut Option<crate::back::lto::Buffer>>,
2459 MergeFunctions: bool,
2460 UnrollLoops: bool,
2461 SLPVectorize: bool,
2462 LoopVectorize: bool,
2463 DisableSimplifyLibCalls: bool,
2464 EmitLifetimeMarkers: bool,
2465 RunEnzyme: *const c_void,
2466 PrintBeforeEnzyme: bool,
2467 PrintAfterEnzyme: bool,
2468 PrintPasses: bool,
2469 SanitizerOptions: Option<&SanitizerOptions>,
2470 PGOGenPath: *const c_char,
2471 PGOUsePath: *const c_char,
2472 InstrumentCoverage: bool,
2473 InstrProfileOutput: *const c_char,
2474 PGOSampleUsePath: *const c_char,
2475 DebugInfoForProfiling: bool,
2476 llvm_selfprofiler: *mut c_void,
2477 begin_callback: SelfProfileBeforePassCallback,
2478 end_callback: SelfProfileAfterPassCallback,
2479 PostEnzymePasses: *const c_char,
2480 PostEnzymePassesLen: size_t,
2481 ExtraPasses: *const c_char,
2482 ExtraPassesLen: size_t,
2483 LLVMPlugins: *const c_char,
2484 LLVMPluginsLen: size_t,
2485 ) -> LLVMRustResult;
2486 pub(crate) fn LLVMRustPrintModule(
2487 M: &Module,
2488 Output: *const c_char,
2489 Demangle: extern "C" fn(*const c_char, size_t, *mut c_char, size_t) -> size_t,
2490 ) -> LLVMRustResult;
2491 pub(crate) fn LLVMRustSetLLVMOptions(Argc: c_int, Argv: *const *const c_char);
2492 pub(crate) fn LLVMRustPrintPasses();
2493 pub(crate) fn LLVMRustSetNormalizedTarget(M: &Module, triple: *const c_char);
2494 pub(crate) fn LLVMRustRunRestrictionPass(M: &Module, syms: *const *const c_char, len: size_t);
2495
2496 pub(crate) fn LLVMRustWriteTwineToString(T: &Twine, s: &RustString);
2497
2498 pub(crate) fn LLVMRustUnpackOptimizationDiagnostic<'a>(
2499 DI: &'a DiagnosticInfo,
2500 pass_name_out: &RustString,
2501 function_out: &mut Option<&'a Value>,
2502 loc_line_out: &mut c_uint,
2503 loc_column_out: &mut c_uint,
2504 loc_filename_out: &RustString,
2505 message_out: &RustString,
2506 );
2507
2508 pub(crate) fn LLVMRustUnpackInlineAsmDiagnostic<'a>(
2509 DI: &'a DiagnosticInfo,
2510 level_out: &mut DiagnosticLevel,
2511 cookie_out: &mut u64,
2512 message_out: &mut Option<&'a Twine>,
2513 );
2514
2515 pub(crate) fn LLVMRustWriteDiagnosticInfoToString(DI: &DiagnosticInfo, s: &RustString);
2516 pub(crate) fn LLVMRustGetDiagInfoKind(DI: &DiagnosticInfo) -> DiagnosticKind;
2517
2518 pub(crate) fn LLVMRustGetSMDiagnostic<'a>(
2519 DI: &'a DiagnosticInfo,
2520 cookie_out: &mut u64,
2521 ) -> &'a SMDiagnostic;
2522
2523 pub(crate) fn LLVMRustUnpackSMDiagnostic(
2524 d: &SMDiagnostic,
2525 message_out: &RustString,
2526 buffer_out: &RustString,
2527 level_out: &mut DiagnosticLevel,
2528 loc_out: &mut c_uint,
2529 ranges_out: *mut c_uint,
2530 num_ranges: &mut usize,
2531 ) -> bool;
2532
2533 pub(crate) fn LLVMRustSetDataLayoutFromTargetMachine<'a>(M: &'a Module, TM: &'a TargetMachine);
2534
2535 pub(crate) fn LLVMRustPositionBuilderPastAllocas<'a>(B: &Builder<'a>, Fn: &'a Value);
2536 pub(crate) fn LLVMRustPositionBuilderAtStart<'a>(B: &Builder<'a>, BB: &'a BasicBlock);
2537
2538 pub(crate) fn LLVMRustSetModulePICLevel(M: &Module);
2539 pub(crate) fn LLVMRustSetModulePIELevel(M: &Module);
2540 pub(crate) fn LLVMRustSetModuleCodeModel(M: &Module, Model: CodeModel);
2541 pub(crate) fn LLVMRustSetModuleLargeDataThreshold(M: &Module, Threshold: u64);
2542 pub(crate) fn LLVMRustBufferPtr(p: &Buffer) -> *const u8;
2543 pub(crate) fn LLVMRustBufferLen(p: &Buffer) -> usize;
2544 pub(crate) fn LLVMRustBufferFree(p: &'static mut Buffer);
2545 pub(crate) fn LLVMRustModuleCost(M: &Module) -> u64;
2546 pub(crate) fn LLVMRustModuleInstructionStats(M: &Module) -> u64;
2547
2548 pub(crate) fn LLVMRustModuleSerialize(M: &Module, is_thin: bool) -> &'static mut Buffer;
2549 pub(crate) fn LLVMRustCreateThinLTOData(
2550 Modules: *const ThinLTOModule,
2551 NumModules: size_t,
2552 PreservedSymbols: *const *const c_char,
2553 PreservedSymbolsLen: size_t,
2554 ) -> Option<&'static mut ThinLTOData>;
2555 pub(crate) fn LLVMRustPrepareThinLTORename(
2556 Data: &ThinLTOData,
2557 Module: &Module,
2558 Target: &TargetMachine,
2559 );
2560 pub(crate) fn LLVMRustPrepareThinLTOResolveWeak(Data: &ThinLTOData, Module: &Module) -> bool;
2561 pub(crate) fn LLVMRustPrepareThinLTOInternalize(Data: &ThinLTOData, Module: &Module) -> bool;
2562 pub(crate) fn LLVMRustPrepareThinLTOImport(
2563 Data: &ThinLTOData,
2564 Module: &Module,
2565 Target: &TargetMachine,
2566 ) -> bool;
2567 pub(crate) fn LLVMRustFreeThinLTOData(Data: &'static mut ThinLTOData);
2568 pub(crate) fn LLVMRustParseBitcodeForLTO(
2569 Context: &Context,
2570 Data: *const u8,
2571 len: usize,
2572 Identifier: *const c_char,
2573 ) -> Option<&Module>;
2574
2575 pub(crate) fn LLVMRustLinkerNew(M: &Module) -> &mut Linker<'_>;
2576 pub(crate) fn LLVMRustLinkerAdd(
2577 linker: &Linker<'_>,
2578 bytecode: *const c_char,
2579 bytecode_len: usize,
2580 ) -> bool;
2581 pub(crate) fn LLVMRustLinkerFree<'a>(linker: &'a mut Linker<'a>);
2582 pub(crate) fn LLVMRustComputeLTOCacheKey(
2583 key_out: &RustString,
2584 mod_id: *const c_char,
2585 data: &ThinLTOData,
2586 );
2587
2588 pub(crate) fn LLVMRustContextGetDiagnosticHandler(
2589 Context: &Context,
2590 ) -> Option<&DiagnosticHandler>;
2591 pub(crate) fn LLVMRustContextSetDiagnosticHandler(
2592 context: &Context,
2593 diagnostic_handler: Option<&DiagnosticHandler>,
2594 );
2595 pub(crate) fn LLVMRustContextConfigureDiagnosticHandler(
2596 context: &Context,
2597 diagnostic_handler_callback: DiagnosticHandlerTy,
2598 diagnostic_handler_context: *mut c_void,
2599 remark_all_passes: bool,
2600 remark_passes: *const *const c_char,
2601 remark_passes_len: usize,
2602 remark_file: *const c_char,
2603 pgo_available: bool,
2604 );
2605
2606 pub(crate) fn LLVMRustGetMangledName(V: &Value, out: &RustString);
2607
2608 pub(crate) fn LLVMRustGetElementTypeArgIndex(CallSite: &Value) -> i32;
2609
2610 pub(crate) safe fn LLVMRustLLVMHasZlibCompression() -> bool;
2611 pub(crate) safe fn LLVMRustLLVMHasZstdCompression() -> bool;
2612
2613 pub(crate) fn LLVMRustGetSymbols(
2614 buf_ptr: *const u8,
2615 buf_len: usize,
2616 state: *mut c_void,
2617 callback: GetSymbolsCallback,
2618 error_callback: GetSymbolsErrorCallback,
2619 ) -> *mut c_void;
2620
2621 pub(crate) fn LLVMRustIs64BitSymbolicFile(buf_ptr: *const u8, buf_len: usize) -> bool;
2622
2623 pub(crate) fn LLVMRustIsECObject(buf_ptr: *const u8, buf_len: usize) -> bool;
2624
2625 pub(crate) fn LLVMRustIsAnyArm64Coff(buf_ptr: *const u8, buf_len: usize) -> bool;
2626
2627 pub(crate) fn LLVMRustSetNoSanitizeAddress(Global: &Value);
2628 pub(crate) fn LLVMRustSetNoSanitizeHWAddress(Global: &Value);
2629
2630 pub(crate) fn LLVMRustConstPtrAuth(
2631 ptr: *const Value,
2632 key: u32,
2633 disc: u64,
2634 addr_diversity: *const Value,
2635 deactivation_symbol: *const Value,
2636 ) -> *const Value;
2637}