use cranelift_codegen::ir;
use cranelift_codegen::ir::immediates::Offset32;
use cranelift_codegen::isa::TargetFrontendConfig;
use smallvec::SmallVec;
use wasmtime_environ::{GlobalConstValue, Tunables, TypeConvert, WasmHeapType};
#[derive(Clone, Copy)]
pub enum GlobalVariable {
Constant {
value: GlobalConstValue,
},
Memory {
gv: ir::GlobalValue,
offset: Offset32,
ty: ir::Type,
},
Custom,
}
pub trait TargetEnvironment: TypeConvert {
fn target_config(&self) -> TargetFrontendConfig;
fn heap_access_spectre_mitigation(&self) -> bool;
fn reference_type(&self, ty: WasmHeapType) -> (ir::Type, bool);
fn tunables(&self) -> &Tunables;
}
pub type StructFieldsVec = SmallVec<[ir::Value; 4]>;