Rustfmt
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
//! `TargetIsa::legalize_signature()` method.
|
||||
|
||||
use crate::ir::{AbiParam, ArgumentExtension, ArgumentLoc, Type};
|
||||
use core::cmp::Ordering;
|
||||
use alloc::vec::Vec;
|
||||
use core::cmp::Ordering;
|
||||
|
||||
/// Legalization action to perform on a single argument or return value when converting a
|
||||
/// signature.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! The `CFGPrinter` utility.
|
||||
|
||||
use core::fmt::{Display, Formatter, Result, Write};
|
||||
use alloc::vec::Vec;
|
||||
use core::fmt::{Display, Formatter, Result, Write};
|
||||
|
||||
use crate::entity::SecondaryMap;
|
||||
use crate::flowgraph::{BasicBlock, ControlFlowGraph};
|
||||
|
||||
@@ -33,8 +33,8 @@ use crate::timing;
|
||||
use crate::unreachable_code::eliminate_unreachable_code;
|
||||
use crate::value_label::{build_value_labels_ranges, ComparableSourceLoc, ValueLabelsRanges};
|
||||
use crate::verifier::{verify_context, verify_locations, VerifierErrors, VerifierResult};
|
||||
use log::debug;
|
||||
use alloc::vec::Vec;
|
||||
use log::debug;
|
||||
|
||||
/// Persistent data structures and compilation pipeline.
|
||||
pub struct Context {
|
||||
|
||||
@@ -6,10 +6,10 @@ use crate::ir::instructions::BranchInfo;
|
||||
use crate::ir::{Ebb, ExpandedProgramPoint, Function, Inst, Layout, ProgramOrder, Value};
|
||||
use crate::packed_option::PackedOption;
|
||||
use crate::timing;
|
||||
use alloc::vec::Vec;
|
||||
use core::cmp;
|
||||
use core::cmp::Ordering;
|
||||
use core::mem;
|
||||
use alloc::vec::Vec;
|
||||
|
||||
/// RPO numbers are not first assigned in a contiguous way but as multiples of STRIDE, to leave
|
||||
/// room for modifications of the dominator tree.
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
|
||||
use crate::ir::Constant;
|
||||
use crate::HashMap;
|
||||
use cranelift_entity::EntityRef;
|
||||
use alloc::collections::BTreeMap;
|
||||
use alloc::vec::Vec;
|
||||
use cranelift_entity::EntityRef;
|
||||
|
||||
/// This type describes the actual constant data.
|
||||
pub type ConstantData = Vec<u8>;
|
||||
|
||||
@@ -14,12 +14,12 @@ use crate::isa::TargetIsa;
|
||||
use crate::packed_option::ReservedValue;
|
||||
use crate::write::write_operands;
|
||||
use crate::HashMap;
|
||||
use alloc::vec::Vec;
|
||||
use core::fmt;
|
||||
use core::iter;
|
||||
use core::mem;
|
||||
use core::ops::{Index, IndexMut};
|
||||
use core::u16;
|
||||
use alloc::vec::Vec;
|
||||
|
||||
/// A data flow graph defines all instructions and extended basic blocks in a function as well as
|
||||
/// the data flow dependencies between them. The DFG also tracks values which can be either
|
||||
|
||||
@@ -455,8 +455,8 @@ impl From<Table> for AnyEntity {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use core::u32;
|
||||
use alloc::string::ToString;
|
||||
use core::u32;
|
||||
|
||||
#[test]
|
||||
fn value_with_number() {
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
|
||||
use crate::ir::{ArgumentLoc, ExternalName, SigRef, Type};
|
||||
use crate::isa::{CallConv, RegInfo, RegUnit};
|
||||
use alloc::vec::Vec;
|
||||
use core::fmt;
|
||||
use core::str::FromStr;
|
||||
use alloc::vec::Vec;
|
||||
|
||||
/// Function signature.
|
||||
///
|
||||
|
||||
@@ -120,8 +120,8 @@ impl FromStr for ExternalName {
|
||||
mod tests {
|
||||
use super::ExternalName;
|
||||
use crate::ir::LibCall;
|
||||
use core::u32;
|
||||
use alloc::string::ToString;
|
||||
use core::u32;
|
||||
|
||||
#[test]
|
||||
fn display_testcase() {
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
//! Each type here should have a corresponding definition in the
|
||||
//! `cranelift-codegen/meta/src/shared/immediates` crate in the meta language.
|
||||
|
||||
use alloc::vec::Vec;
|
||||
use core::fmt::{self, Display, Formatter};
|
||||
use core::iter::FromIterator;
|
||||
use core::str::{from_utf8, FromStr};
|
||||
use core::{i32, u32};
|
||||
use alloc::vec::Vec;
|
||||
|
||||
/// Convert a type into a vector of bytes; all implementors in this file must use little-endian
|
||||
/// orderings of bytes to match WebAssembly's little-endianness.
|
||||
@@ -936,11 +936,11 @@ impl IntoBytes for Ieee64 {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use alloc::string::ToString;
|
||||
use core::fmt::Display;
|
||||
use core::mem;
|
||||
use core::str::FromStr;
|
||||
use core::{f32, f64};
|
||||
use alloc::string::ToString;
|
||||
|
||||
#[test]
|
||||
fn format_imm64() {
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
//! A large part of this module is auto-generated from the instruction descriptions in the meta
|
||||
//! directory.
|
||||
|
||||
use alloc::vec::Vec;
|
||||
use core::fmt::{self, Display, Formatter};
|
||||
use core::ops::{Deref, DerefMut};
|
||||
use core::str::FromStr;
|
||||
use alloc::vec::Vec;
|
||||
|
||||
use crate::ir;
|
||||
use crate::ir::types;
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
//! The actual table of destinations is stored in a `JumpTableData` struct defined in this module.
|
||||
|
||||
use crate::ir::entities::Ebb;
|
||||
use alloc::vec::Vec;
|
||||
use core::fmt::{self, Display, Formatter};
|
||||
use core::slice::{Iter, IterMut};
|
||||
use alloc::vec::Vec;
|
||||
|
||||
/// Contents of a jump table.
|
||||
///
|
||||
|
||||
@@ -750,8 +750,8 @@ mod tests {
|
||||
use crate::cursor::{Cursor, CursorPosition};
|
||||
use crate::entity::EntityRef;
|
||||
use crate::ir::{Ebb, Inst, ProgramOrder, SourceLoc};
|
||||
use core::cmp::Ordering;
|
||||
use alloc::vec::Vec;
|
||||
use core::cmp::Ordering;
|
||||
|
||||
struct LayoutCursor<'f> {
|
||||
/// Borrowed function layout. Public so it can be re-borrowed from this cursor.
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
use crate::entity::{Iter, IterMut, Keys, PrimaryMap};
|
||||
use crate::ir::{StackSlot, Type};
|
||||
use crate::packed_option::PackedOption;
|
||||
use alloc::vec::Vec;
|
||||
use core::cmp;
|
||||
use core::fmt;
|
||||
use core::ops::{Index, IndexMut};
|
||||
use core::slice;
|
||||
use core::str::FromStr;
|
||||
use alloc::vec::Vec;
|
||||
|
||||
#[cfg(feature = "enable-serde")]
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
@@ -15,8 +15,8 @@ use crate::isa::enc_tables::{self as shared_enc_tables, lookup_enclist, Encoding
|
||||
use crate::isa::Builder as IsaBuilder;
|
||||
use crate::isa::{EncInfo, RegClass, RegInfo, TargetIsa};
|
||||
use crate::regalloc;
|
||||
use core::fmt;
|
||||
use alloc::boxed::Box;
|
||||
use core::fmt;
|
||||
use target_lexicon::{Architecture, Triple};
|
||||
|
||||
#[allow(dead_code)]
|
||||
|
||||
@@ -15,8 +15,8 @@ use crate::isa::enc_tables::{lookup_enclist, Encodings};
|
||||
use crate::isa::Builder as IsaBuilder;
|
||||
use crate::isa::{EncInfo, RegClass, RegInfo, TargetIsa};
|
||||
use crate::regalloc;
|
||||
use core::fmt;
|
||||
use alloc::boxed::Box;
|
||||
use core::fmt;
|
||||
use target_lexicon::Triple;
|
||||
|
||||
#[allow(dead_code)]
|
||||
|
||||
@@ -63,9 +63,9 @@ use crate::result::CodegenResult;
|
||||
use crate::settings;
|
||||
use crate::settings::SetResult;
|
||||
use crate::timing;
|
||||
use alloc::boxed::Box;
|
||||
use core::fmt;
|
||||
use failure_derive::Fail;
|
||||
use alloc::boxed::Box;
|
||||
use target_lexicon::{triple, Architecture, PointerWidth, Triple};
|
||||
|
||||
#[cfg(feature = "riscv")]
|
||||
|
||||
@@ -15,8 +15,8 @@ use crate::isa::enc_tables::{self as shared_enc_tables, lookup_enclist, Encoding
|
||||
use crate::isa::Builder as IsaBuilder;
|
||||
use crate::isa::{EncInfo, RegClass, RegInfo, TargetIsa};
|
||||
use crate::regalloc;
|
||||
use core::fmt;
|
||||
use alloc::boxed::Box;
|
||||
use core::fmt;
|
||||
use target_lexicon::{PointerWidth, Triple};
|
||||
|
||||
#[allow(dead_code)]
|
||||
@@ -137,8 +137,8 @@ mod tests {
|
||||
use crate::ir::{Function, InstructionData, Opcode};
|
||||
use crate::isa;
|
||||
use crate::settings::{self, Configurable};
|
||||
use core::str::FromStr;
|
||||
use alloc::string::{String, ToString};
|
||||
use core::str::FromStr;
|
||||
use target_lexicon::triple;
|
||||
|
||||
fn encstr(isa: &dyn isa::TargetIsa, enc: Result<isa::Encoding, isa::Legalize>) -> String {
|
||||
|
||||
@@ -17,8 +17,8 @@ use crate::isa::{EncInfo, RegClass, RegInfo, TargetIsa};
|
||||
use crate::regalloc;
|
||||
use crate::result::CodegenResult;
|
||||
use crate::timing;
|
||||
use core::fmt;
|
||||
use alloc::boxed::Box;
|
||||
use core::fmt;
|
||||
use target_lexicon::{PointerWidth, Triple};
|
||||
|
||||
#[allow(dead_code)]
|
||||
|
||||
@@ -27,8 +27,8 @@ use crate::ir::{
|
||||
};
|
||||
use crate::isa::TargetIsa;
|
||||
use crate::legalizer::split::{isplit, vsplit};
|
||||
use log::debug;
|
||||
use alloc::vec::Vec;
|
||||
use log::debug;
|
||||
|
||||
/// Legalize all the function signatures in `func`.
|
||||
///
|
||||
|
||||
@@ -67,9 +67,9 @@
|
||||
use crate::cursor::{Cursor, CursorPosition, FuncCursor};
|
||||
use crate::flowgraph::{BasicBlock, ControlFlowGraph};
|
||||
use crate::ir::{self, Ebb, Inst, InstBuilder, InstructionData, Opcode, Type, Value, ValueDef};
|
||||
use alloc::vec::Vec;
|
||||
use core::iter;
|
||||
use smallvec::SmallVec;
|
||||
use alloc::vec::Vec;
|
||||
|
||||
/// Split `value` into two values using the `isplit` semantics. Do this by reusing existing values
|
||||
/// if possible.
|
||||
|
||||
@@ -8,11 +8,11 @@ use crate::isa::TargetIsa;
|
||||
use crate::result::CodegenError;
|
||||
use crate::verifier::{VerifierError, VerifierErrors};
|
||||
use crate::write::{decorate_function, FuncWriter, PlainWriter};
|
||||
use core::fmt;
|
||||
use core::fmt::Write;
|
||||
use alloc::boxed::Box;
|
||||
use alloc::string::{String, ToString};
|
||||
use alloc::vec::Vec;
|
||||
use core::fmt;
|
||||
use core::fmt::Write;
|
||||
|
||||
/// Pretty-print a verifier error.
|
||||
pub fn pretty_verifier_error<'a>(
|
||||
|
||||
@@ -12,9 +12,9 @@ use crate::ir::{
|
||||
};
|
||||
use crate::isa::{RegInfo, RegUnit, TargetIsa};
|
||||
use crate::regalloc::RegDiversions;
|
||||
use alloc::vec::Vec;
|
||||
use core::convert::TryInto;
|
||||
use cranelift_entity::{PrimaryMap, SecondaryMap};
|
||||
use alloc::vec::Vec;
|
||||
|
||||
// =============================================================================================
|
||||
// A description of the redundant-fill-removal algorithm
|
||||
|
||||
@@ -17,12 +17,12 @@ use crate::regalloc::affinity::Affinity;
|
||||
use crate::regalloc::liveness::Liveness;
|
||||
use crate::regalloc::virtregs::{VirtReg, VirtRegs};
|
||||
use crate::timing;
|
||||
use alloc::vec::Vec;
|
||||
use core::cmp;
|
||||
use core::fmt;
|
||||
use core::iter;
|
||||
use core::slice;
|
||||
use log::debug;
|
||||
use alloc::vec::Vec;
|
||||
|
||||
// # Implementation
|
||||
//
|
||||
|
||||
@@ -183,9 +183,9 @@ use crate::isa::{EncInfo, OperandConstraint, TargetIsa};
|
||||
use crate::regalloc::affinity::Affinity;
|
||||
use crate::regalloc::liverange::LiveRange;
|
||||
use crate::timing;
|
||||
use alloc::vec::Vec;
|
||||
use core::mem;
|
||||
use core::ops::Index;
|
||||
use alloc::vec::Vec;
|
||||
|
||||
/// A set of live ranges, indexed by value number.
|
||||
type LiveRangeSet = SparseMap<Value, LiveRange>;
|
||||
|
||||
@@ -476,8 +476,8 @@ mod tests {
|
||||
use crate::entity::EntityRef;
|
||||
use crate::ir::{Ebb, Inst, Value};
|
||||
use crate::ir::{ExpandedProgramPoint, ProgramOrder};
|
||||
use core::cmp::Ordering;
|
||||
use alloc::vec::Vec;
|
||||
use core::cmp::Ordering;
|
||||
|
||||
// Dummy program order which simply compares indexes.
|
||||
// It is assumed that EBBs have indexes that are multiples of 10, and instructions have indexes
|
||||
|
||||
@@ -275,9 +275,9 @@ mod tests {
|
||||
use super::Pressure;
|
||||
use crate::isa::{RegClass, TargetIsa};
|
||||
use crate::regalloc::RegisterSet;
|
||||
use alloc::boxed::Box;
|
||||
use core::borrow::Borrow;
|
||||
use core::str::FromStr;
|
||||
use alloc::boxed::Box;
|
||||
use target_lexicon::triple;
|
||||
|
||||
// Make an arm32 `TargetIsa`, if possible.
|
||||
|
||||
@@ -21,8 +21,8 @@ use crate::regalloc::live_value_tracker::{LiveValue, LiveValueTracker};
|
||||
use crate::regalloc::liveness::Liveness;
|
||||
use crate::timing;
|
||||
use crate::topo_order::TopoOrder;
|
||||
use log::debug;
|
||||
use alloc::vec::Vec;
|
||||
use log::debug;
|
||||
|
||||
/// Reusable data structures for the reload pass.
|
||||
pub struct Reload {
|
||||
|
||||
@@ -104,12 +104,12 @@ use crate::entity::{SparseMap, SparseMapValue};
|
||||
use crate::ir::Value;
|
||||
use crate::isa::{RegClass, RegUnit};
|
||||
use crate::regalloc::register_set::RegSetIter;
|
||||
use alloc::vec::Vec;
|
||||
use core::cmp;
|
||||
use core::fmt;
|
||||
use core::mem;
|
||||
use core::u16;
|
||||
use log::debug;
|
||||
use alloc::vec::Vec;
|
||||
|
||||
/// A variable in the constraint problem.
|
||||
///
|
||||
@@ -1159,8 +1159,8 @@ mod tests {
|
||||
use crate::ir::Value;
|
||||
use crate::isa::{RegClass, RegInfo, RegUnit, TargetIsa};
|
||||
use crate::regalloc::RegisterSet;
|
||||
use core::str::FromStr;
|
||||
use alloc::boxed::Box;
|
||||
use core::str::FromStr;
|
||||
use target_lexicon::triple;
|
||||
|
||||
// Make an arm32 `TargetIsa`, if possible.
|
||||
|
||||
@@ -27,9 +27,9 @@ use crate::regalloc::pressure::Pressure;
|
||||
use crate::regalloc::virtregs::VirtRegs;
|
||||
use crate::timing;
|
||||
use crate::topo_order::TopoOrder;
|
||||
use alloc::vec::Vec;
|
||||
use core::fmt;
|
||||
use log::debug;
|
||||
use alloc::vec::Vec;
|
||||
|
||||
/// Return a top-level register class which contains `unit`.
|
||||
fn toprc_containing_regunit(unit: RegUnit, reginfo: &RegInfo) -> RegClass {
|
||||
|
||||
@@ -18,11 +18,11 @@ use crate::entity::{EntityList, ListPool};
|
||||
use crate::entity::{Keys, PrimaryMap, SecondaryMap};
|
||||
use crate::ir::{Function, Value};
|
||||
use crate::packed_option::PackedOption;
|
||||
use alloc::vec::Vec;
|
||||
use core::cmp::Ordering;
|
||||
use core::fmt;
|
||||
use core::slice;
|
||||
use smallvec::SmallVec;
|
||||
use alloc::vec::Vec;
|
||||
|
||||
/// A virtual register reference.
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
|
||||
use crate::constant_hash::{probe, simple_hash};
|
||||
use crate::isa::TargetIsa;
|
||||
use alloc::boxed::Box;
|
||||
use alloc::string::{String, ToString};
|
||||
use core::fmt;
|
||||
use core::str;
|
||||
use failure_derive::Fail;
|
||||
use alloc::boxed::Box;
|
||||
use alloc::string::{String, ToString};
|
||||
|
||||
/// A string-based configurator for settings groups.
|
||||
///
|
||||
|
||||
@@ -5,9 +5,9 @@ use crate::dominator_tree::DominatorTree;
|
||||
use crate::ir::{Function, Inst, InstructionData, Opcode, Type};
|
||||
use crate::scoped_hash_map::ScopedHashMap;
|
||||
use crate::timing;
|
||||
use alloc::vec::Vec;
|
||||
use core::cell::{Ref, RefCell};
|
||||
use core::hash::{Hash, Hasher};
|
||||
use alloc::vec::Vec;
|
||||
|
||||
/// Test whether the given opcode is unsafe to even consider for GVN.
|
||||
fn trivially_unsafe_for_gvn(opcode: Opcode) -> bool {
|
||||
|
||||
@@ -2,12 +2,12 @@ use crate::ir::{Function, SourceLoc, Value, ValueLabel, ValueLabelAssignments, V
|
||||
use crate::isa::TargetIsa;
|
||||
use crate::regalloc::{Context, RegDiversions};
|
||||
use crate::HashMap;
|
||||
use alloc::collections::BTreeMap;
|
||||
use alloc::vec::Vec;
|
||||
use core::cmp::Ordering;
|
||||
use core::iter::Iterator;
|
||||
use core::ops::Bound::*;
|
||||
use core::ops::Deref;
|
||||
use alloc::collections::BTreeMap;
|
||||
use alloc::vec::Vec;
|
||||
|
||||
#[cfg(feature = "enable-serde")]
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
@@ -72,12 +72,12 @@ use crate::isa::TargetIsa;
|
||||
use crate::iterators::IteratorExtras;
|
||||
use crate::settings::FlagsOrIsa;
|
||||
use crate::timing;
|
||||
use core::cmp::Ordering;
|
||||
use core::fmt::{self, Display, Formatter, Write};
|
||||
use failure_derive::Fail;
|
||||
use alloc::collections::BTreeSet;
|
||||
use alloc::string::String;
|
||||
use alloc::vec::Vec;
|
||||
use core::cmp::Ordering;
|
||||
use core::fmt::{self, Display, Formatter, Write};
|
||||
use failure_derive::Fail;
|
||||
|
||||
pub use self::cssa::verify_cssa;
|
||||
pub use self::liveness::verify_liveness;
|
||||
|
||||
@@ -14,9 +14,9 @@ use crate::isa::{RegInfo, TargetIsa};
|
||||
use crate::packed_option::ReservedValue;
|
||||
use crate::value_label::ValueLabelsRanges;
|
||||
use crate::HashSet;
|
||||
use core::fmt::{self, Write};
|
||||
use alloc::string::String;
|
||||
use alloc::vec::Vec;
|
||||
use core::fmt::{self, Write};
|
||||
|
||||
/// A `FuncWriter` used to decorate functions during printing.
|
||||
pub trait FuncWriter {
|
||||
|
||||
Reference in New Issue
Block a user