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