Format with nightly rustfmt-preview, then with rustfmt-0.9 again.
This commit is contained in:
@@ -22,19 +22,19 @@
|
||||
//!
|
||||
//! That is why `translate_function_body` takes an object having the `WasmRuntime` trait as
|
||||
//! argument.
|
||||
use cretonne::ir::{self, InstBuilder, JumpTableData, MemFlags};
|
||||
use cretonne::ir::types::*;
|
||||
use cretonne::ir::condcodes::{FloatCC, IntCC};
|
||||
use cretonne::ir::types::*;
|
||||
use cretonne::ir::{self, InstBuilder, JumpTableData, MemFlags};
|
||||
use cretonne::packed_option::ReservedValue;
|
||||
use cton_frontend::{FunctionBuilder, Variable};
|
||||
use wasmparser::{MemoryImmediate, Operator};
|
||||
use translation_utils::{num_return_values, type_to_type, f32_translation, f64_translation};
|
||||
use translation_utils::{FunctionIndex, MemoryIndex, SignatureIndex, TableIndex};
|
||||
use environ::{FuncEnvironment, GlobalValue};
|
||||
use state::{ControlStackFrame, TranslationState};
|
||||
use std::collections::{hash_map, HashMap};
|
||||
use environ::{FuncEnvironment, GlobalValue};
|
||||
use std::{i32, u32};
|
||||
use std::vec::Vec;
|
||||
use std::{i32, u32};
|
||||
use translation_utils::{FunctionIndex, MemoryIndex, SignatureIndex, TableIndex};
|
||||
use translation_utils::{num_return_values, type_to_type, f32_translation, f64_translation};
|
||||
use wasmparser::{MemoryImmediate, Operator};
|
||||
|
||||
// Clippy warns about "flags: _" but its important to document that the flags field is ignored
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(unneeded_field_pattern))]
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
//! "Dummy" environment for testing wasm translation.
|
||||
|
||||
use cretonne::cursor::FuncCursor;
|
||||
use cretonne::ir::types::*;
|
||||
use cretonne::ir::{self, InstBuilder};
|
||||
use cretonne::settings;
|
||||
use environ::{FuncEnvironment, GlobalValue, ModuleEnvironment};
|
||||
use func_translator::FuncTranslator;
|
||||
use std::error::Error;
|
||||
use std::string::String;
|
||||
use std::vec::Vec;
|
||||
use translation_utils::{FunctionIndex, Global, GlobalIndex, Memory, MemoryIndex, SignatureIndex,
|
||||
Table, TableIndex};
|
||||
use func_translator::FuncTranslator;
|
||||
use cretonne::ir::{self, InstBuilder};
|
||||
use cretonne::ir::types::*;
|
||||
use cretonne::cursor::FuncCursor;
|
||||
use cretonne::settings;
|
||||
use wasmparser;
|
||||
use std::error::Error;
|
||||
use std::vec::Vec;
|
||||
use std::string::String;
|
||||
|
||||
/// Compute a `ir::ExternalName` for a given wasm function index.
|
||||
fn get_func_name(func_index: FunctionIndex) -> ir::ExternalName {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Support for configurable wasm translation.
|
||||
|
||||
mod spec;
|
||||
mod dummy;
|
||||
mod spec;
|
||||
|
||||
pub use environ::spec::{FuncEnvironment, GlobalValue, ModuleEnvironment};
|
||||
pub use environ::dummy::DummyEnvironment;
|
||||
pub use environ::spec::{FuncEnvironment, GlobalValue, ModuleEnvironment};
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
//! All the runtime support necessary for the wasm to cretonne translation is formalized by the
|
||||
//! traits `FunctionEnvironment` and `ModuleEnvironment`.
|
||||
use cretonne::ir::{self, InstBuilder};
|
||||
use cretonne::cursor::FuncCursor;
|
||||
use cretonne::ir::{self, InstBuilder};
|
||||
use cretonne::settings::Flags;
|
||||
use std::string::String;
|
||||
use std::vec::Vec;
|
||||
use translation_utils::{FunctionIndex, Global, GlobalIndex, Memory, MemoryIndex, SignatureIndex,
|
||||
Table, TableIndex};
|
||||
use std::vec::Vec;
|
||||
use std::string::String;
|
||||
|
||||
/// The value of a WebAssembly global variable.
|
||||
#[derive(Clone, Copy)]
|
||||
|
||||
@@ -232,10 +232,10 @@ fn cur_srcloc(reader: &BinaryReader) -> ir::SourceLoc {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use cretonne::{ir, Context};
|
||||
use cretonne::ir::types::I32;
|
||||
use environ::{DummyEnvironment, FuncEnvironment};
|
||||
use super::FuncTranslator;
|
||||
use cretonne::ir::types::I32;
|
||||
use cretonne::{ir, Context};
|
||||
use environ::{DummyEnvironment, FuncEnvironment};
|
||||
|
||||
#[test]
|
||||
fn small1() {
|
||||
|
||||
@@ -19,15 +19,15 @@ extern crate cton_frontend;
|
||||
extern crate wasmparser;
|
||||
|
||||
mod code_translator;
|
||||
mod environ;
|
||||
mod func_translator;
|
||||
mod module_translator;
|
||||
mod environ;
|
||||
mod sections_translator;
|
||||
mod state;
|
||||
mod translation_utils;
|
||||
|
||||
pub use environ::{DummyEnvironment, FuncEnvironment, GlobalValue, ModuleEnvironment};
|
||||
pub use func_translator::FuncTranslator;
|
||||
pub use module_translator::translate_module;
|
||||
pub use environ::{DummyEnvironment, FuncEnvironment, GlobalValue, ModuleEnvironment};
|
||||
pub use translation_utils::{FunctionIndex, Global, GlobalIndex, GlobalInit, Memory, MemoryIndex,
|
||||
SignatureIndex, Table, TableIndex};
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
//! Translation skeleton that traverses the whole WebAssembly module and call helper functions
|
||||
//! to deal with each part of it.
|
||||
use cretonne::timing;
|
||||
use wasmparser::{BinaryReaderError, Parser, ParserInput, ParserState, SectionCode, WasmDecoder};
|
||||
use environ::ModuleEnvironment;
|
||||
use sections_translator::{parse_data_section, parse_elements_section, parse_export_section,
|
||||
parse_function_section, parse_function_signatures, parse_global_section,
|
||||
parse_import_section, parse_memory_section, parse_start_section,
|
||||
parse_table_section, SectionParsingError};
|
||||
use environ::ModuleEnvironment;
|
||||
use wasmparser::{BinaryReaderError, Parser, ParserInput, ParserState, SectionCode, WasmDecoder};
|
||||
|
||||
use std::string::String;
|
||||
|
||||
|
||||
@@ -7,17 +7,17 @@
|
||||
//! The special case of the initialize expressions for table elements offsets or global variables
|
||||
//! is handled, according to the semantics of WebAssembly, to only specific expressions that are
|
||||
//! interpreted on the fly.
|
||||
use cretonne;
|
||||
use cretonne::ir::{AbiParam, CallConv, Signature};
|
||||
use environ::ModuleEnvironment;
|
||||
use std::str::from_utf8;
|
||||
use std::string::String;
|
||||
use std::vec::Vec;
|
||||
use translation_utils::{type_to_type, FunctionIndex, Global, GlobalIndex, GlobalInit, Memory,
|
||||
MemoryIndex, SignatureIndex, Table, TableElementType, TableIndex};
|
||||
use cretonne::ir::{AbiParam, CallConv, Signature};
|
||||
use cretonne;
|
||||
use wasmparser;
|
||||
use wasmparser::{ExternalKind, FuncType, ImportSectionEntryType, MemoryType, Operator, Parser,
|
||||
ParserState, WasmDecoder};
|
||||
use wasmparser;
|
||||
use std::str::from_utf8;
|
||||
use environ::ModuleEnvironment;
|
||||
use std::vec::Vec;
|
||||
use std::string::String;
|
||||
|
||||
pub enum SectionParsingError {
|
||||
WrongSectionContent(String),
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
use cretonne::ir::{self, Ebb, Inst, Value};
|
||||
use environ::{FuncEnvironment, GlobalValue};
|
||||
use std::collections::HashMap;
|
||||
use translation_utils::{FunctionIndex, GlobalIndex, MemoryIndex, SignatureIndex};
|
||||
use std::vec::Vec;
|
||||
use translation_utils::{FunctionIndex, GlobalIndex, MemoryIndex, SignatureIndex};
|
||||
|
||||
/// A control stack frame can be an `if`, a `block` or a `loop`, each one having the following
|
||||
/// fields:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Helper functions and structures for the translation.
|
||||
use wasmparser;
|
||||
use cretonne;
|
||||
use std::u32;
|
||||
use wasmparser;
|
||||
|
||||
/// Index of a function (imported or defined) inside the WebAssembly module.
|
||||
pub type FunctionIndex = usize;
|
||||
|
||||
Reference in New Issue
Block a user