Move target back into wasmer_types

This commit is contained in:
Syrus Akbary
2025-03-06 11:09:51 +01:00
parent bd13db0c48
commit 78eca7958d
41 changed files with 82 additions and 94 deletions

View File

@ -6,7 +6,7 @@ use crate::{
};
use std::collections::BTreeMap;
use std::slice::Iter;
use wasmer_compiler::types::target::CallingConvention;
use wasmer_types::target::CallingConvention;
use wasmer_types::{CompileError, Type};
/// General-purpose registers.

View File

@ -20,7 +20,6 @@ use wasmer_compiler::{
function::{CompiledFunction, CompiledFunctionFrameInfo, FunctionBody},
relocation::{Relocation, RelocationTarget},
section::SectionIndex,
target::CallingConvention,
},
wasmparser::{
BlockType as WpTypeOrFuncType, HeapType as WpHeapType, Operator, RefType as WpRefType,
@ -32,13 +31,13 @@ use wasmer_compiler::{
#[cfg(feature = "unwind")]
use wasmer_compiler::types::unwind::CompiledFunctionUnwindInfo;
use wasmer_types::target::CallingConvention;
use wasmer_types::{
entity::{EntityRef, PrimaryMap},
CompileError, FunctionIndex, FunctionType, GlobalIndex, LocalFunctionIndex, LocalMemoryIndex,
MemoryIndex, MemoryStyle, ModuleInfo, SignatureIndex, TableIndex, TableStyle, TrapCode, Type,
VMBuiltinFunctionIndex, VMOffsets,
};
/// The singlepass per-function code generator.
pub struct FuncGen<'a, M: Machine> {
// Immutable properties assigned at creation time.

View File

@ -25,12 +25,12 @@ use wasmer_compiler::{
function::{Compilation, CompiledFunction, FunctionBody, UnwindInfo},
module::CompileModuleInfo,
section::SectionIndex,
target::{Architecture, CallingConvention, CpuFeature, OperatingSystem, Target},
},
Compiler, CompilerConfig, FunctionBinaryReader, FunctionBodyData, MiddlewareBinaryReader,
ModuleMiddleware, ModuleMiddlewareChain, ModuleTranslationState,
};
use wasmer_types::entity::{EntityRef, PrimaryMap};
use wasmer_types::target::{Architecture, CallingConvention, CpuFeature, Target};
use wasmer_types::{
CompileError, FunctionIndex, FunctionType, LocalFunctionIndex, MemoryIndex, ModuleInfo,
TableIndex, TrapCode, TrapInformation, VMOffsets,

View File

@ -3,11 +3,11 @@
use crate::compiler::SinglepassCompiler;
use std::sync::Arc;
use wasmer_compiler::{
types::target::{CpuFeature, Target},
Compiler, CompilerConfig, Engine, EngineBuilder, ModuleMiddleware,
use wasmer_compiler::{Compiler, CompilerConfig, Engine, EngineBuilder, ModuleMiddleware};
use wasmer_types::{
target::{CpuFeature, Target},
Features,
};
use wasmer_types::Features;
#[derive(Debug, Clone)]
pub struct Singlepass {

View File

@ -5,9 +5,8 @@ use gimli::{
use wasmer_compiler::types::{
relocation::{Relocation, RelocationKind, RelocationTarget},
section::{CustomSection, CustomSectionProtection, SectionBody},
target::Endianness,
};
use wasmer_types::{entity::EntityRef, LocalFunctionIndex};
use wasmer_types::{entity::EntityRef, target::Endianness, LocalFunctionIndex};
#[derive(Clone, Debug)]
pub struct WriterRelocate {

View File

@ -13,9 +13,10 @@ use dynasmrt::{
use wasmer_compiler::types::{
function::FunctionBody,
section::{CustomSection, CustomSectionProtection, SectionBody},
target::CallingConvention,
};
use wasmer_types::{CompileError, FunctionIndex, FunctionType, Type, VMOffsets};
use wasmer_types::{
target::CallingConvention, CompileError, FunctionIndex, FunctionType, Type, VMOffsets,
};
type Assembler = VecAssembler<Aarch64Relocation>;

View File

@ -9,8 +9,7 @@ pub use crate::{
};
use dynasm::dynasm;
use dynasmrt::{AssemblyOffset, DynamicLabel, DynasmApi, DynasmLabelApi};
use wasmer_compiler::types::target::CpuFeature;
use wasmer_types::CompileError;
use wasmer_types::{target::CpuFeature, CompileError};
/// Force `dynasm!` to use the correct arch (x64) when cross-compiling.
/// `dynasm!` proc-macro tries to auto-detect it by default by looking at the

View File

@ -13,11 +13,11 @@ use wasmer_compiler::{
function::FunctionBody,
relocation::{Relocation, RelocationTarget},
section::CustomSection,
target::{Architecture, CallingConvention, Target},
},
wasmparser::{MemArg, ValType as WpType},
};
use wasmer_types::{
target::{Architecture, CallingConvention, Target},
CompileError, FunctionIndex, FunctionType, TrapCode, TrapInformation, VMOffsets,
};
pub type Label = DynamicLabel;

View File

@ -8,11 +8,11 @@ use wasmer_compiler::{
function::FunctionBody,
relocation::{Relocation, RelocationKind, RelocationTarget},
section::CustomSection,
target::{CallingConvention, CpuFeature, Target},
},
wasmparser::{MemArg, ValType as WpType},
};
use wasmer_types::{
target::{CallingConvention, CpuFeature, Target},
CompileError, FunctionIndex, FunctionType, SourceLoc, TrapCode, TrapInformation, VMOffsets,
};

View File

@ -19,11 +19,11 @@ use wasmer_compiler::{
function::FunctionBody,
relocation::{Relocation, RelocationKind, RelocationTarget},
section::{CustomSection, CustomSectionProtection, SectionBody},
target::{CallingConvention, CpuFeature, Target},
},
wasmparser::{MemArg, ValType as WpType},
};
use wasmer_types::{
target::{CallingConvention, CpuFeature, Target},
CompileError, FunctionIndex, FunctionType, SourceLoc, TrapCode, TrapInformation, Type,
VMOffsets,
};
@ -8302,7 +8302,7 @@ mod test {
use super::*;
use enumset::enum_set;
use std::str::FromStr;
use wasmer_compiler::types::target::{CpuFeature, Target, Triple};
use wasmer_types::target::{CpuFeature, Target, Triple};
fn test_move_location(machine: &mut MachineX86_64) -> Result<(), CompileError> {
machine.move_location_for_native(

View File

@ -4,7 +4,7 @@ use gimli::write::{Address, CallFrameInstruction, CommonInformationEntry, FrameD
use gimli::{AArch64, Encoding, Format, X86_64};
use std::fmt::Debug;
#[cfg(feature = "unwind")]
use wasmer_compiler::types::target::Architecture;
use wasmer_types::target::Architecture;
#[derive(Clone, Debug)]
pub enum UnwindOps {

View File

@ -6,8 +6,7 @@ use crate::location::CombinedRegister;
use crate::location::Reg as AbstractReg;
use std::collections::BTreeMap;
use std::slice::Iter;
use wasmer_compiler::types::target::CallingConvention;
use wasmer_types::{CompileError, Type};
use wasmer_types::{target::CallingConvention, CompileError, Type};
/// General-purpose registers.
#[repr(u8)]