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