Update to the latest stable rustfmt, 0.4.2-stable (febbb36 2018-04-12).

This commit is contained in:
Dan Gohman
2018-05-29 10:37:38 -07:00
parent 7045c41418
commit a1fe0f82e1
45 changed files with 124 additions and 76 deletions

View File

@@ -3,9 +3,9 @@
//! Read a sequence of Cretonne IR files and print them again to stdout. This has the effect of //! Read a sequence of Cretonne IR files and print them again to stdout. This has the effect of
//! normalizing formatting and removing comments. //! normalizing formatting and removing comments.
use CommandResult;
use cretonne_reader::parse_functions; use cretonne_reader::parse_functions;
use utils::read_to_string; use utils::read_to_string;
use CommandResult;
pub fn run(files: &[String]) -> CommandResult { pub fn run(files: &[String]) -> CommandResult {
for (i, f) in files.into_iter().enumerate() { for (i, f) in files.into_iter().enumerate() {

View File

@@ -1,10 +1,10 @@
//! CLI tool to read Cretonne IR files and compile them into native code. //! CLI tool to read Cretonne IR files and compile them into native code.
use capstone::prelude::*; use capstone::prelude::*;
use cretonne_codegen::Context;
use cretonne_codegen::isa::TargetIsa; use cretonne_codegen::isa::TargetIsa;
use cretonne_codegen::print_errors::pretty_error; use cretonne_codegen::print_errors::pretty_error;
use cretonne_codegen::settings::FlagsOrIsa; use cretonne_codegen::settings::FlagsOrIsa;
use cretonne_codegen::Context;
use cretonne_codegen::{binemit, ir}; use cretonne_codegen::{binemit, ir};
use cretonne_reader::parse_test; use cretonne_reader::parse_test;
use std::path::Path; use std::path::Path;

View File

@@ -1,8 +1,12 @@
#![deny(trivial_numeric_casts)] #![deny(trivial_numeric_casts)]
#![warn(unused_import_braces, unstable_features, unused_extern_crates)] #![warn(unused_import_braces, unstable_features, unused_extern_crates)]
#![cfg_attr(feature = "cargo-clippy", #![cfg_attr(
warn(float_arithmetic, mut_mut, nonminimal_bool, option_map_unwrap_or, feature = "cargo-clippy",
option_map_unwrap_or_else, unicode_not_nfc, use_self))] warn(
float_arithmetic, mut_mut, nonminimal_bool, option_map_unwrap_or, option_map_unwrap_or_else,
unicode_not_nfc, use_self
)
)]
#[macro_use] #[macro_use]
extern crate cfg_if; extern crate cfg_if;

View File

@@ -3,10 +3,10 @@
//! Read a series of Cretonne IR files and print their control flow graphs //! Read a series of Cretonne IR files and print their control flow graphs
//! in graphviz format. //! in graphviz format.
use CommandResult;
use cretonne_codegen::cfg_printer::CFGPrinter; use cretonne_codegen::cfg_printer::CFGPrinter;
use cretonne_reader::parse_functions; use cretonne_reader::parse_functions;
use utils::read_to_string; use utils::read_to_string;
use CommandResult;
pub fn run(files: &[String]) -> CommandResult { pub fn run(files: &[String]) -> CommandResult {
for (i, f) in files.into_iter().enumerate() { for (i, f) in files.into_iter().enumerate() {

View File

@@ -2,10 +2,10 @@
//! //!
//! This file is named to avoid a name collision with the filecheck crate. //! This file is named to avoid a name collision with the filecheck crate.
use CommandResult;
use filecheck::{Checker, CheckerBuilder, NO_VARIABLES}; use filecheck::{Checker, CheckerBuilder, NO_VARIABLES};
use std::io::{self, Read}; use std::io::{self, Read};
use utils::read_to_string; use utils::read_to_string;
use CommandResult;
pub fn run(files: &[String], verbose: bool) -> CommandResult { pub fn run(files: &[String], verbose: bool) -> CommandResult {
if files.is_empty() { if files.is_empty() {

View File

@@ -184,8 +184,8 @@ pub fn legalize_abi_value(have: Type, arg: &AbiParam) -> ValueConversion {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
use ir::AbiParam;
use ir::types; use ir::types;
use ir::AbiParam;
#[test] #[test]
fn legalize() { fn legalize() {

View File

@@ -3,8 +3,8 @@
use std::fmt::{Display, Formatter, Result, Write}; use std::fmt::{Display, Formatter, Result, Write};
use flowgraph::ControlFlowGraph; use flowgraph::ControlFlowGraph;
use ir::Function;
use ir::instructions::BranchInfo; use ir::instructions::BranchInfo;
use ir::Function;
/// A utility for pretty-printing the CFG of a `Function`. /// A utility for pretty-printing the CFG of a `Function`.
pub struct CFGPrinter<'a> { pub struct CFGPrinter<'a> {

View File

@@ -220,8 +220,8 @@ pub fn magicS64(d: i64) -> MS64 {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::{MS32, MS64, MU32, MU64};
use super::{magicS32, magicS64, magicU32, magicU64}; use super::{magicS32, magicS64, magicU32, magicU64};
use super::{MS32, MS64, MU32, MU64};
fn mkMU32(mulBy: u32, doAdd: bool, shiftBy: i32) -> MU32 { fn mkMU32(mulBy: u32, doAdd: bool, shiftBy: i32) -> MU32 {
MU32 { MU32 {

View File

@@ -1151,8 +1151,8 @@ mod tests {
#[test] #[test]
fn aliases() { fn aliases() {
use ir::InstBuilder;
use ir::condcodes::IntCC; use ir::condcodes::IntCC;
use ir::InstBuilder;
let mut func = Function::new(); let mut func = Function::new();
let ebb0 = func.dfg.make_ebb(); let ebb0 = func.dfg.make_ebb();

View File

@@ -1,7 +1,7 @@
//! Heaps. //! Heaps.
use ir::GlobalVar;
use ir::immediates::Imm64; use ir::immediates::Imm64;
use ir::GlobalVar;
use std::fmt; use std::fmt;
/// Information about a heap declaration. /// Information about a heap declaration.

View File

@@ -338,8 +338,8 @@ impl StackSlots {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
use ir::Function;
use ir::types; use ir::types;
use ir::Function;
use std::string::ToString; use std::string::ToString;
#[test] #[test]

View File

@@ -9,8 +9,8 @@ pub mod settings;
use super::super::settings as shared_settings; use super::super::settings as shared_settings;
use binemit::{emit_function, CodeSink, MemoryCodeSink}; use binemit::{emit_function, CodeSink, MemoryCodeSink};
use ir; use ir;
use isa::Builder as IsaBuilder;
use isa::enc_tables::{self as shared_enc_tables, lookup_enclist, Encodings}; use isa::enc_tables::{self as shared_enc_tables, lookup_enclist, Encodings};
use isa::Builder as IsaBuilder;
use isa::{EncInfo, RegClass, RegInfo, TargetIsa}; use isa::{EncInfo, RegClass, RegInfo, TargetIsa};
use regalloc; use regalloc;
use std::boxed::Box; use std::boxed::Box;

View File

@@ -9,8 +9,8 @@ pub mod settings;
use super::super::settings as shared_settings; use super::super::settings as shared_settings;
use binemit::{emit_function, CodeSink, MemoryCodeSink}; use binemit::{emit_function, CodeSink, MemoryCodeSink};
use ir; use ir;
use isa::Builder as IsaBuilder;
use isa::enc_tables::{lookup_enclist, Encodings}; use isa::enc_tables::{lookup_enclist, Encodings};
use isa::Builder as IsaBuilder;
use isa::{EncInfo, RegClass, RegInfo, TargetIsa}; use isa::{EncInfo, RegClass, RegInfo, TargetIsa};
use regalloc; use regalloc;
use std::boxed::Box; use std::boxed::Box;

View File

@@ -9,8 +9,8 @@ pub mod settings;
use super::super::settings as shared_settings; use super::super::settings as shared_settings;
use binemit::{emit_function, CodeSink, MemoryCodeSink}; use binemit::{emit_function, CodeSink, MemoryCodeSink};
use ir; use ir;
use isa::Builder as IsaBuilder;
use isa::enc_tables::{self as shared_enc_tables, lookup_enclist, Encodings}; use isa::enc_tables::{self as shared_enc_tables, lookup_enclist, Encodings};
use isa::Builder as IsaBuilder;
use isa::{EncInfo, RegClass, RegInfo, TargetIsa}; use isa::{EncInfo, RegClass, RegInfo, TargetIsa};
use regalloc; use regalloc;
use std::boxed::Box; use std::boxed::Box;
@@ -113,8 +113,8 @@ impl TargetIsa for Isa {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use ir::{Function, InstructionData, Opcode};
use ir::{immediates, types}; use ir::{immediates, types};
use ir::{Function, InstructionData, Opcode};
use isa; use isa;
use settings::{self, Configurable}; use settings::{self, Configurable};
use std::string::{String, ToString}; use std::string::{String, ToString};

View File

@@ -4,8 +4,8 @@
//! defined in this module expresses the low-level details of accessing a stack slot from an //! defined in this module expresses the low-level details of accessing a stack slot from an
//! encoded instruction. //! encoded instruction.
use ir::StackSlot;
use ir::stackslot::{StackOffset, StackSlotKind, StackSlots}; use ir::stackslot::{StackOffset, StackSlotKind, StackSlots};
use ir::StackSlot;
/// A method for referencing a stack slot in the current stack frame. /// A method for referencing a stack slot in the current stack frame.
/// ///

View File

@@ -9,8 +9,8 @@ pub mod settings;
use super::super::settings as shared_settings; use super::super::settings as shared_settings;
use binemit::{emit_function, CodeSink, MemoryCodeSink}; use binemit::{emit_function, CodeSink, MemoryCodeSink};
use ir; use ir;
use isa::Builder as IsaBuilder;
use isa::enc_tables::{self as shared_enc_tables, lookup_enclist, Encodings}; use isa::enc_tables::{self as shared_enc_tables, lookup_enclist, Encodings};
use isa::Builder as IsaBuilder;
use isa::{EncInfo, RegClass, RegInfo, TargetIsa}; use isa::{EncInfo, RegClass, RegInfo, TargetIsa};
use regalloc; use regalloc;
use result; use result;

View File

@@ -31,9 +31,13 @@
redundant_field_names, redundant_field_names,
useless_let_if_seq, useless_let_if_seq,
len_without_is_empty))] len_without_is_empty))]
#![cfg_attr(feature = "cargo-clippy", #![cfg_attr(
warn(float_arithmetic, mut_mut, nonminimal_bool, option_map_unwrap_or, feature = "cargo-clippy",
option_map_unwrap_or_else, print_stdout, unicode_not_nfc, use_self))] warn(
float_arithmetic, mut_mut, nonminimal_bool, option_map_unwrap_or, option_map_unwrap_or_else,
print_stdout, unicode_not_nfc, use_self
)
)]
// Turns on no_std and alloc features if std is not available. // Turns on no_std and alloc features if std is not available.
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(not(feature = "std"), feature(alloc))] #![cfg_attr(not(feature = "std"), feature(alloc))]

View File

@@ -3,12 +3,12 @@
#![allow(non_snake_case)] #![allow(non_snake_case)]
use cursor::{Cursor, FuncCursor}; use cursor::{Cursor, FuncCursor};
use divconst_magic_numbers::{MS32, MS64, MU32, MU64};
use divconst_magic_numbers::{magicS32, magicS64, magicU32, magicU64}; use divconst_magic_numbers::{magicS32, magicS64, magicU32, magicU64};
use ir::Inst; use divconst_magic_numbers::{MS32, MS64, MU32, MU64};
use ir::dfg::ValueDef; use ir::dfg::ValueDef;
use ir::instructions::Opcode; use ir::instructions::Opcode;
use ir::types::{I32, I64}; use ir::types::{I32, I64};
use ir::Inst;
use ir::{DataFlowGraph, Function, InstBuilder, InstructionData, Type, Value}; use ir::{DataFlowGraph, Function, InstBuilder, InstructionData, Type, Value};
use timing; use timing;

View File

@@ -46,16 +46,16 @@ use cursor::{Cursor, EncCursor};
use dominator_tree::DominatorTree; use dominator_tree::DominatorTree;
use ir::{AbiParam, ArgumentLoc, InstBuilder, ValueDef}; use ir::{AbiParam, ArgumentLoc, InstBuilder, ValueDef};
use ir::{Ebb, Function, Inst, Layout, SigRef, Value, ValueLoc}; use ir::{Ebb, Function, Inst, Layout, SigRef, Value, ValueLoc};
use isa::{ConstraintKind, EncInfo, OperandConstraint, RecipeConstraints, TargetIsa};
use isa::{regs_overlap, RegClass, RegInfo, RegUnit}; use isa::{regs_overlap, RegClass, RegInfo, RegUnit};
use isa::{ConstraintKind, EncInfo, OperandConstraint, RecipeConstraints, TargetIsa};
use packed_option::PackedOption; use packed_option::PackedOption;
use regalloc::RegDiversions;
use regalloc::affinity::Affinity; use regalloc::affinity::Affinity;
use regalloc::live_value_tracker::{LiveValue, LiveValueTracker}; use regalloc::live_value_tracker::{LiveValue, LiveValueTracker};
use regalloc::liveness::Liveness; use regalloc::liveness::Liveness;
use regalloc::liverange::{LiveRange, LiveRangeContext}; use regalloc::liverange::{LiveRange, LiveRangeContext};
use regalloc::register_set::RegisterSet; use regalloc::register_set::RegisterSet;
use regalloc::solver::{Solver, SolverError}; use regalloc::solver::{Solver, SolverError};
use regalloc::RegDiversions;
use std::mem; use std::mem;
use timing; use timing;

View File

@@ -1367,7 +1367,7 @@ mod tests {
mov(v15, gpr, r5, r3), mov(v15, gpr, r5, r3),
mov(v14, gpr, r4, r5), mov(v14, gpr, r4, r5),
mov(v13, gpr, r1, r4), mov(v13, gpr, r1, r4),
fill(v10, gpr, 0, r1) // Finally complete cycle 1. fill(v10, gpr, 0, r1), // Finally complete cycle 1.
] ]
); );
} }

View File

@@ -1,7 +1,7 @@
//! Computing stack layout. //! Computing stack layout.
use ir::StackSlots;
use ir::stackslot::{StackOffset, StackSize, StackSlotKind}; use ir::stackslot::{StackOffset, StackSize, StackSlotKind};
use ir::StackSlots;
use result::CtonError; use result::CtonError;
use std::cmp::{max, min}; use std::cmp::{max, min};

View File

@@ -2,8 +2,8 @@
use ir; use ir;
use isa; use isa;
use regalloc::RegDiversions;
use regalloc::liveness::Liveness; use regalloc::liveness::Liveness;
use regalloc::RegDiversions;
use timing; use timing;
use verifier::Result; use verifier::Result;

View File

@@ -1147,8 +1147,8 @@ impl<'a> Verifier<'a> {
mod tests { mod tests {
use super::{Error, Verifier}; use super::{Error, Verifier};
use entity::EntityList; use entity::EntityList;
use ir::Function;
use ir::instructions::{InstructionData, Opcode}; use ir::instructions::{InstructionData, Opcode};
use ir::Function;
use settings; use settings;
macro_rules! assert_err_with_msg { macro_rules! assert_err_with_msg {

View File

@@ -1,9 +1,9 @@
//! A double-ended iterator over entity references and entities. //! A double-ended iterator over entity references and entities.
use EntityRef;
use std::iter::Enumerate; use std::iter::Enumerate;
use std::marker::PhantomData; use std::marker::PhantomData;
use std::slice; use std::slice;
use EntityRef;
/// Iterate over all keys in order. /// Iterate over all keys in order.
pub struct Iter<'a, K: EntityRef, V> pub struct Iter<'a, K: EntityRef, V>

View File

@@ -3,8 +3,8 @@
//! When `std::iter::Step` is stablized, `Keys` could be implemented as a wrapper around //! When `std::iter::Step` is stablized, `Keys` could be implemented as a wrapper around
//! `std::ops::Range`, but for now, we implment it manually. //! `std::ops::Range`, but for now, we implment it manually.
use EntityRef;
use std::marker::PhantomData; use std::marker::PhantomData;
use EntityRef;
/// Iterate over all keys in order. /// Iterate over all keys in order.
pub struct Keys<K: EntityRef> { pub struct Keys<K: EntityRef> {

View File

@@ -34,9 +34,13 @@
#![cfg_attr(feature = "std", warn(unstable_features))] #![cfg_attr(feature = "std", warn(unstable_features))]
#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))] #![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))]
#![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))] #![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))]
#![cfg_attr(feature = "cargo-clippy", #![cfg_attr(
warn(float_arithmetic, mut_mut, nonminimal_bool, option_map_unwrap_or, feature = "cargo-clippy",
option_map_unwrap_or_else, print_stdout, unicode_not_nfc, use_self))] warn(
float_arithmetic, mut_mut, nonminimal_bool, option_map_unwrap_or, option_map_unwrap_or_else,
print_stdout, unicode_not_nfc, use_self
)
)]
// Turns on no_std and alloc features if std is not available. // Turns on no_std and alloc features if std is not available.
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(not(feature = "std"), feature(alloc))] #![cfg_attr(not(feature = "std"), feature(alloc))]

View File

@@ -1,9 +1,9 @@
//! Small lists of entity references. //! Small lists of entity references.
use EntityRef;
use std::hash::{Hash, Hasher}; use std::hash::{Hash, Hasher};
use std::marker::PhantomData; use std::marker::PhantomData;
use std::mem; use std::mem;
use std::vec::Vec; use std::vec::Vec;
use EntityRef;
/// A small list of entity references allocated from a pool. /// A small list of entity references allocated from a pool.
/// ///

View File

@@ -6,9 +6,13 @@
#![warn(unused_import_braces, unstable_features)] #![warn(unused_import_braces, unstable_features)]
#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))] #![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))]
#![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))] #![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))]
#![cfg_attr(feature = "cargo-clippy", #![cfg_attr(
warn(float_arithmetic, mut_mut, nonminimal_bool, option_map_unwrap_or, feature = "cargo-clippy",
option_map_unwrap_or_else, print_stdout, unicode_not_nfc, use_self))] warn(
float_arithmetic, mut_mut, nonminimal_bool, option_map_unwrap_or, option_map_unwrap_or_else,
print_stdout, unicode_not_nfc, use_self
)
)]
extern crate cretonne_codegen; extern crate cretonne_codegen;
extern crate cretonne_module; extern crate cretonne_module;

View File

@@ -9,9 +9,13 @@
type_complexity, type_complexity,
// Rustfmt 0.9.0 is at odds with this lint: // Rustfmt 0.9.0 is at odds with this lint:
block_in_if_condition_stmt))] block_in_if_condition_stmt))]
#![cfg_attr(feature = "cargo-clippy", #![cfg_attr(
warn(mut_mut, nonminimal_bool, option_map_unwrap_or, option_map_unwrap_or_else, feature = "cargo-clippy",
unicode_not_nfc, use_self))] warn(
mut_mut, nonminimal_bool, option_map_unwrap_or, option_map_unwrap_or_else, unicode_not_nfc,
use_self
)
)]
#[macro_use(dbg)] #[macro_use(dbg)]
extern crate cretonne_codegen; extern crate cretonne_codegen;

View File

@@ -6,8 +6,8 @@ use cretonne_codegen::print_errors::pretty_verifier_error;
use cretonne_codegen::settings::Flags; use cretonne_codegen::settings::Flags;
use cretonne_codegen::timing; use cretonne_codegen::timing;
use cretonne_codegen::verify_function; use cretonne_codegen::verify_function;
use cretonne_reader::IsaSpec;
use cretonne_reader::parse_test; use cretonne_reader::parse_test;
use cretonne_reader::IsaSpec;
use std::borrow::Cow; use std::borrow::Cow;
use std::fs; use std::fs;
use std::io::{self, Read}; use std::io::{self, Read};

View File

@@ -14,8 +14,8 @@
use cretonne_codegen::dominator_tree::{DominatorTree, DominatorTreePreorder}; use cretonne_codegen::dominator_tree::{DominatorTree, DominatorTreePreorder};
use cretonne_codegen::flowgraph::ControlFlowGraph; use cretonne_codegen::flowgraph::ControlFlowGraph;
use cretonne_codegen::ir::Function;
use cretonne_codegen::ir::entities::AnyEntity; use cretonne_codegen::ir::entities::AnyEntity;
use cretonne_codegen::ir::Function;
use cretonne_reader::TestCommand; use cretonne_reader::TestCommand;
use match_directive::match_directive; use match_directive::match_directive;
use std::borrow::{Borrow, Cow}; use std::borrow::{Borrow, Cow};

View File

@@ -607,7 +607,6 @@ where
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use Variable;
use cretonne_codegen::entity::EntityRef; use cretonne_codegen::entity::EntityRef;
use cretonne_codegen::ir::types::*; use cretonne_codegen::ir::types::*;
use cretonne_codegen::ir::{AbiParam, ExternalName, Function, InstBuilder, Signature}; use cretonne_codegen::ir::{AbiParam, ExternalName, Function, InstBuilder, Signature};
@@ -615,6 +614,7 @@ mod tests {
use cretonne_codegen::settings::CallConv; use cretonne_codegen::settings::CallConv;
use cretonne_codegen::verifier::verify_function; use cretonne_codegen::verifier::verify_function;
use frontend::{FunctionBuilder, FunctionBuilderContext}; use frontend::{FunctionBuilder, FunctionBuilderContext};
use Variable;
fn sample_function(lazy_seal: bool) { fn sample_function(lazy_seal: bool) {
let mut sig = Signature::new(CallConv::SystemV); let mut sig = Signature::new(CallConv::SystemV);

View File

@@ -131,9 +131,13 @@
#![warn(unused_import_braces)] #![warn(unused_import_braces)]
#![cfg_attr(feature = "std", warn(unstable_features))] #![cfg_attr(feature = "std", warn(unstable_features))]
#![cfg_attr(feature = "cargo-clippy", allow(new_without_default))] #![cfg_attr(feature = "cargo-clippy", allow(new_without_default))]
#![cfg_attr(feature = "cargo-clippy", #![cfg_attr(
warn(float_arithmetic, mut_mut, nonminimal_bool, option_map_unwrap_or, feature = "cargo-clippy",
option_map_unwrap_or_else, print_stdout, unicode_not_nfc, use_self))] warn(
float_arithmetic, mut_mut, nonminimal_bool, option_map_unwrap_or, option_map_unwrap_or_else,
print_stdout, unicode_not_nfc, use_self
)
)]
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(not(feature = "std"), feature(alloc))] #![cfg_attr(not(feature = "std"), feature(alloc))]

View File

@@ -712,7 +712,6 @@ where
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use Variable;
use cretonne_codegen::cursor::{Cursor, FuncCursor}; use cretonne_codegen::cursor::{Cursor, FuncCursor};
use cretonne_codegen::entity::EntityRef; use cretonne_codegen::entity::EntityRef;
use cretonne_codegen::ir::instructions::BranchInfo; use cretonne_codegen::ir::instructions::BranchInfo;
@@ -721,6 +720,7 @@ mod tests {
use cretonne_codegen::settings; use cretonne_codegen::settings;
use cretonne_codegen::verify_function; use cretonne_codegen::verify_function;
use ssa::SSABuilder; use ssa::SSABuilder;
use Variable;
#[test] #[test]
fn simple_block() { fn simple_block() {

View File

@@ -1,13 +1,13 @@
//! Defines the `Backend` trait. //! Defines the `Backend` trait.
use cretonne_codegen::isa::TargetIsa;
use cretonne_codegen::Context;
use cretonne_codegen::{binemit, ir};
use std::marker;
use DataContext; use DataContext;
use Linkage; use Linkage;
use ModuleError; use ModuleError;
use ModuleNamespace; use ModuleNamespace;
use cretonne_codegen::Context;
use cretonne_codegen::isa::TargetIsa;
use cretonne_codegen::{binemit, ir};
use std::marker;
/// A `Backend` implements the functionality needed to support a `Module`. /// A `Backend` implements the functionality needed to support a `Module`.
pub trait Backend pub trait Backend

View File

@@ -4,9 +4,13 @@
#![warn(unused_import_braces, unstable_features)] #![warn(unused_import_braces, unstable_features)]
#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))] #![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))]
#![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))] #![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))]
#![cfg_attr(feature = "cargo-clippy", #![cfg_attr(
warn(float_arithmetic, mut_mut, nonminimal_bool, option_map_unwrap_or, feature = "cargo-clippy",
option_map_unwrap_or_else, print_stdout, unicode_not_nfc, use_self))] warn(
float_arithmetic, mut_mut, nonminimal_bool, option_map_unwrap_or, option_map_unwrap_or_else,
print_stdout, unicode_not_nfc, use_self
)
)]
#[macro_use] #[macro_use]
extern crate cretonne_codegen; extern crate cretonne_codegen;

View File

@@ -5,12 +5,12 @@
// TODO: Factor out `ir::Function`'s `ext_funcs` and `global_vars` into a struct // TODO: Factor out `ir::Function`'s `ext_funcs` and `global_vars` into a struct
// shared with `DataContext`? // shared with `DataContext`?
use Backend;
use cretonne_codegen::entity::{EntityRef, PrimaryMap}; use cretonne_codegen::entity::{EntityRef, PrimaryMap};
use cretonne_codegen::result::CtonError; use cretonne_codegen::result::CtonError;
use cretonne_codegen::{binemit, ir, Context}; use cretonne_codegen::{binemit, ir, Context};
use data_context::DataContext; use data_context::DataContext;
use std::collections::HashMap; use std::collections::HashMap;
use Backend;
/// A function identifier for use in the `Module` interface. /// A function identifier for use in the `Module` interface.
#[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] #[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]

View File

@@ -5,9 +5,13 @@
#![warn(unused_import_braces, unstable_features)] #![warn(unused_import_braces, unstable_features)]
#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))] #![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))]
#![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))] #![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))]
#![cfg_attr(feature = "cargo-clippy", #![cfg_attr(
warn(float_arithmetic, mut_mut, nonminimal_bool, option_map_unwrap_or, feature = "cargo-clippy",
option_map_unwrap_or_else, print_stdout, unicode_not_nfc, use_self))] warn(
float_arithmetic, mut_mut, nonminimal_bool, option_map_unwrap_or, option_map_unwrap_or_else,
print_stdout, unicode_not_nfc, use_self
)
)]
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]
extern crate cretonne_codegen; extern crate cretonne_codegen;

View File

@@ -7,9 +7,13 @@
#![warn(unused_import_braces, unstable_features)] #![warn(unused_import_braces, unstable_features)]
#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))] #![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))]
#![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))] #![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))]
#![cfg_attr(feature = "cargo-clippy", #![cfg_attr(
warn(float_arithmetic, mut_mut, nonminimal_bool, option_map_unwrap_or, feature = "cargo-clippy",
option_map_unwrap_or_else, print_stdout, unicode_not_nfc, use_self))] warn(
float_arithmetic, mut_mut, nonminimal_bool, option_map_unwrap_or, option_map_unwrap_or_else,
print_stdout, unicode_not_nfc, use_self
)
)]
extern crate cretonne_codegen; extern crate cretonne_codegen;

View File

@@ -2237,9 +2237,9 @@ impl<'a> Parser<'a> {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
use cretonne_codegen::ir::StackSlotKind;
use cretonne_codegen::ir::entities::AnyEntity; use cretonne_codegen::ir::entities::AnyEntity;
use cretonne_codegen::ir::types; use cretonne_codegen::ir::types;
use cretonne_codegen::ir::StackSlotKind;
use cretonne_codegen::ir::{ArgumentExtension, ArgumentPurpose}; use cretonne_codegen::ir::{ArgumentExtension, ArgumentPurpose};
use cretonne_codegen::settings::CallConv; use cretonne_codegen::settings::CallConv;
use error::Error; use error::Error;

View File

@@ -4,8 +4,8 @@
//! file-based test case. //! file-based test case.
//! //!
use cretonne_codegen::ir::Function;
use cretonne_codegen::ir::entities::AnyEntity; use cretonne_codegen::ir::entities::AnyEntity;
use cretonne_codegen::ir::Function;
use error::Location; use error::Location;
use isaspec::IsaSpec; use isaspec::IsaSpec;
use sourcemap::SourceMap; use sourcemap::SourceMap;

View File

@@ -4,9 +4,13 @@
#![warn(unused_import_braces, unstable_features)] #![warn(unused_import_braces, unstable_features)]
#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))] #![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))]
#![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))] #![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))]
#![cfg_attr(feature = "cargo-clippy", #![cfg_attr(
warn(float_arithmetic, mut_mut, nonminimal_bool, option_map_unwrap_or, feature = "cargo-clippy",
option_map_unwrap_or_else, print_stdout, unicode_not_nfc, use_self))] warn(
float_arithmetic, mut_mut, nonminimal_bool, option_map_unwrap_or, option_map_unwrap_or_else,
print_stdout, unicode_not_nfc, use_self
)
)]
extern crate cretonne_codegen; extern crate cretonne_codegen;
extern crate cretonne_module; extern crate cretonne_module;

View File

@@ -4,9 +4,13 @@
#![warn(unused_import_braces, unstable_features)] #![warn(unused_import_braces, unstable_features)]
#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))] #![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))]
#![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))] #![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))]
#![cfg_attr(feature = "cargo-clippy", #![cfg_attr(
warn(float_arithmetic, mut_mut, nonminimal_bool, option_map_unwrap_or, feature = "cargo-clippy",
option_map_unwrap_or_else, print_stdout, unicode_not_nfc, use_self))] warn(
float_arithmetic, mut_mut, nonminimal_bool, option_map_unwrap_or, option_map_unwrap_or_else,
print_stdout, unicode_not_nfc, use_self
)
)]
/// Provide these crates, renamed to reduce stutter. /// Provide these crates, renamed to reduce stutter.
pub extern crate cretonne_codegen as codegen; pub extern crate cretonne_codegen as codegen;

View File

@@ -32,8 +32,8 @@ use state::{ControlStackFrame, TranslationState};
use std::collections::{hash_map, HashMap}; use std::collections::{hash_map, HashMap};
use std::vec::Vec; use std::vec::Vec;
use std::{i32, u32}; use std::{i32, u32};
use translation_utils::{f32_translation, f64_translation, num_return_values, type_to_type};
use translation_utils::{FunctionIndex, MemoryIndex, SignatureIndex, TableIndex}; use translation_utils::{FunctionIndex, MemoryIndex, SignatureIndex, TableIndex};
use translation_utils::{num_return_values, type_to_type, f32_translation, f64_translation};
use wasmparser::{MemoryImmediate, Operator}; use wasmparser::{MemoryImmediate, Operator};
// Clippy warns about "flags: _" but its important to document that the flags field is ignored // Clippy warns about "flags: _" but its important to document that the flags field is ignored

View File

@@ -14,9 +14,13 @@
#![cfg_attr(feature = "std", warn(unstable_features))] #![cfg_attr(feature = "std", warn(unstable_features))]
#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))] #![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))]
#![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))] #![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))]
#![cfg_attr(feature = "cargo-clippy", #![cfg_attr(
warn(float_arithmetic, mut_mut, nonminimal_bool, option_map_unwrap_or, feature = "cargo-clippy",
option_map_unwrap_or_else, print_stdout, unicode_not_nfc, use_self))] warn(
float_arithmetic, mut_mut, nonminimal_bool, option_map_unwrap_or, option_map_unwrap_or_else,
print_stdout, unicode_not_nfc, use_self
)
)]
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(not(feature = "std"), feature(alloc))] #![cfg_attr(not(feature = "std"), feature(alloc))]
@@ -57,7 +61,7 @@ mod std {
pub use alloc::vec; pub use alloc::vec;
pub use core::fmt; pub use core::fmt;
pub use core::option; pub use core::option;
pub use core::{cmp, str, i32, u32}; pub use core::{cmp, i32, str, u32};
pub mod collections { pub mod collections {
pub use hashmap_core::{map as hash_map, HashMap}; pub use hashmap_core::{map as hash_map, HashMap};
} }