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