use num_enum::TryFromPrimitive;
use crate::constants::FIRST_APPLICATION_BLOCK_ID;
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, TryFromPrimitive)]
#[repr(u64)]
pub enum ReservedBlockId {
BlockInfo = 0,
Reserved1 = 1,
Reserved2 = 2,
Reserved3 = 3,
Reserved4 = 4,
Reserved5 = 5,
Reserved6 = 6,
Reserved7 = 7,
}
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, TryFromPrimitive)]
#[repr(u64)]
pub enum IrBlockId {
Module = FIRST_APPLICATION_BLOCK_ID,
ParamAttr,
ParamAttrGroup,
Constants,
Function,
Identification,
ValueSymtab,
Metadata,
MetadataAttachment,
Type,
Uselist,
ModuleStrtab,
GlobalValSummary,
OperandBundleTags,
MetadataKind,
Strtab,
FullLtoGlobalValSummary,
Symtab,
SyncScopeNames,
}
#[derive(Clone, Copy, Debug, PartialEq, TryFromPrimitive)]
#[repr(u64)]
pub enum ReservedAbbrevId {
EndBlock = 0,
EnterSubBlock,
DefineAbbrev,
UnabbrevRecord,
}
#[derive(Clone, Copy, Debug, PartialEq, TryFromPrimitive)]
#[repr(u64)]
pub enum AbbrevOpEnc {
Fixed = 1,
Vbr,
Array,
Char6,
Blob,
}
#[non_exhaustive]
#[derive(Debug, PartialEq, TryFromPrimitive)]
#[repr(u64)]
#[allow(missing_docs)]
pub enum CallingConvention {
C = 0,
Fast = 8,
Cold = 9,
GHC = 10,
HiPE = 11,
WebKitJS = 12,
AnyReg = 13,
PreserveMost = 14,
PreserveAll = 15,
Swift = 16,
CXXFASTTLS = 17,
X86Stdcall = 64,
X86Fastcall = 65,
ARMAPCS = 66,
ARMAAPCS = 67,
ARMAAPCSVFP = 68,
MSP430INTR = 69,
X86ThisCall = 70,
PTXKernel = 71,
PTXDevice = 72,
SPIRFUNC = 75,
SPIRKERNEL = 76,
IntelOCLBI = 77,
X8664SysV = 78,
Win64 = 79,
X86VectorCall = 80,
HHVM = 81,
HHVMC = 82,
X86INTR = 83,
AVRINTR = 84,
AVRSIGNAL = 85,
AVRBUILTIN = 86,
AMDGPUVS = 87,
AMDGPUGS = 88,
AMDGPUPS = 89,
AMDGPUCS = 90,
AMDGPUKERNEL = 91,
X86RegCall = 92,
AMDGPUHS = 93,
MSP430BUILTIN = 94,
AMDGPULS = 95,
AMDGPUES = 96,
}
#[non_exhaustive]
#[derive(Debug, PartialEq, TryFromPrimitive)]
#[repr(u64)]
pub enum BlockInfoCode {
SetBid = 1,
BlockName,
SetRecordName,
}
#[non_exhaustive]
#[derive(Debug, PartialEq, TryFromPrimitive)]
#[repr(u64)]
pub enum IdentificationCode {
ProducerString = 1,
Epoch,
}
#[non_exhaustive]
#[derive(Debug, PartialEq, TryFromPrimitive)]
#[repr(u64)]
pub enum ModuleCode {
Version = 1,
Triple,
DataLayout,
Asm,
SectionName,
DepLib,
GlobalVar,
Function,
AliasOld,
GcName,
Comdat,
VstOffset,
Alias,
MetadataValuesUnused,
SourceFilename,
Hash,
IFunc,
}
#[non_exhaustive]
#[derive(Debug, PartialEq, TryFromPrimitive)]
#[repr(u64)]
pub enum TypeCode {
NumEntry = 1,
Void,
Float,
Double,
Label,
Opaque,
Integer,
Pointer,
FunctionOld,
Half,
Array,
Vector,
X86Fp80,
Fp128,
PpcFp128,
Metadata,
X86Mmx,
StructAnon,
StructName,
StructNamed,
Function,
Token,
BFloat,
X86Amx,
OpaquePointer,
}
#[non_exhaustive]
#[derive(Debug, PartialEq, TryFromPrimitive)]
#[repr(u64)]
pub enum StrtabCode {
Blob = 1,
}
#[non_exhaustive]
#[derive(Debug, PartialEq, TryFromPrimitive)]
#[repr(u64)]
pub enum SymtabCode {
Blob = 1,
}
#[non_exhaustive]
#[derive(Debug, PartialEq, TryFromPrimitive)]
#[repr(u64)]
pub enum AttributeCode {
EntryOld = 1,
Entry,
GroupCodeEntry,
}