mirror of
https://github.com/fluencelabs/wasmer
synced 2025-07-31 15:22:03 +00:00
Improved formatting
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use cranelift_codegen::binemit;
|
||||
use cranelift_codegen::ir::{self, TrapCode, SourceLoc, ExternalName};
|
||||
use cranelift_codegen::ir::{self, ExternalName, SourceLoc, TrapCode};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Relocation {
|
||||
@@ -18,7 +18,6 @@ pub enum RelocationType {
|
||||
Intrinsic(String),
|
||||
}
|
||||
|
||||
|
||||
/// Implementation of a relocation sink that just saves all the information for later
|
||||
pub struct RelocSink {
|
||||
// func: &'func ir::Function,
|
||||
@@ -48,35 +47,28 @@ impl binemit::RelocSink for RelocSink {
|
||||
namespace: 0,
|
||||
index,
|
||||
} => {
|
||||
self.func_relocs.push(
|
||||
(
|
||||
Relocation {
|
||||
reloc,
|
||||
offset,
|
||||
addend,
|
||||
},
|
||||
RelocationType::Normal(index as _),
|
||||
)
|
||||
);
|
||||
},
|
||||
ExternalName::TestCase {
|
||||
length,
|
||||
ascii,
|
||||
} => {
|
||||
self.func_relocs.push((
|
||||
Relocation {
|
||||
reloc,
|
||||
offset,
|
||||
addend,
|
||||
},
|
||||
RelocationType::Normal(index as _),
|
||||
));
|
||||
}
|
||||
ExternalName::TestCase { length, ascii } => {
|
||||
let (slice, _) = ascii.split_at(length as usize);
|
||||
let name = String::from_utf8(slice.to_vec()).unwrap();
|
||||
|
||||
self.func_relocs.push(
|
||||
(
|
||||
Relocation {
|
||||
reloc,
|
||||
offset,
|
||||
addend,
|
||||
},
|
||||
RelocationType::Intrinsic(name),
|
||||
)
|
||||
);
|
||||
},
|
||||
self.func_relocs.push((
|
||||
Relocation {
|
||||
reloc,
|
||||
offset,
|
||||
addend,
|
||||
},
|
||||
RelocationType::Intrinsic(name),
|
||||
));
|
||||
}
|
||||
_ => {
|
||||
unimplemented!();
|
||||
}
|
||||
@@ -100,8 +92,6 @@ impl RelocSink {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
pub struct TrapData {
|
||||
pub offset: usize,
|
||||
pub code: TrapCode,
|
||||
|
Reference in New Issue
Block a user