Update to Rust 2018 edition (#632)
* initial cargo fix run * Upgrade cranelift-entity crate * Upgrade bforest crate * Upgrade the codegen crate * Upgrade the faerie crate * Upgrade the filetests crate * Upgrade the codegen-meta crate * Upgrade the frontend crate * Upgrade the cranelift-module crate * Upgrade the cranelift-native crate * Upgrade the cranelift-preopt crate * Upgrade the cranelift-reader crate * Upgrade the cranelift-serde crate * Upgrade the cranelift-simplejit crate * Upgrade the cranelift or cranelift-umbrella crate * Upgrade the cranelift-wasm crate * Upgrade cranelift-tools crate * Use new import style on remaining files * run format-all.sh * run test-all.sh, update Readme and travis ci configuration fixed an AssertionError also * Remove deprecated functions
This commit is contained in:
committed by
Dan Gohman
parent
e3db942b0c
commit
effe6c04e4
@@ -3,11 +3,11 @@
|
||||
//! A `Builder` provides a convenient interface for inserting instructions into a Cranelift
|
||||
//! function. Many of its methods are generated from the meta language instruction definitions.
|
||||
|
||||
use ir;
|
||||
use ir::types;
|
||||
use ir::{DataFlowGraph, InstructionData};
|
||||
use ir::{Inst, Opcode, Type, Value};
|
||||
use isa;
|
||||
use crate::ir;
|
||||
use crate::ir::types;
|
||||
use crate::ir::{DataFlowGraph, InstructionData};
|
||||
use crate::ir::{Inst, Opcode, Type, Value};
|
||||
use crate::isa;
|
||||
|
||||
/// Base trait for instruction builders.
|
||||
///
|
||||
@@ -215,10 +215,10 @@ impl<'f> InstBuilderBase<'f> for ReplaceBuilder<'f> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use cursor::{Cursor, FuncCursor};
|
||||
use ir::condcodes::*;
|
||||
use ir::types::*;
|
||||
use ir::{Function, InstBuilder, ValueDef};
|
||||
use crate::cursor::{Cursor, FuncCursor};
|
||||
use crate::ir::condcodes::*;
|
||||
use crate::ir::types::*;
|
||||
use crate::ir::{Function, InstBuilder, ValueDef};
|
||||
|
||||
#[test]
|
||||
fn types() {
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
//! Data flow graph tracking Instructions, Values, and EBBs.
|
||||
|
||||
use entity::{self, PrimaryMap, SecondaryMap};
|
||||
use ir;
|
||||
use ir::builder::ReplaceBuilder;
|
||||
use ir::extfunc::ExtFuncData;
|
||||
use ir::instructions::{BranchInfo, CallInfo, InstructionData};
|
||||
use ir::types;
|
||||
use ir::{Ebb, FuncRef, Inst, SigRef, Signature, Type, Value, ValueList, ValueListPool};
|
||||
use isa::TargetIsa;
|
||||
use packed_option::ReservedValue;
|
||||
use crate::entity::{self, PrimaryMap, SecondaryMap};
|
||||
use crate::ir;
|
||||
use crate::ir::builder::ReplaceBuilder;
|
||||
use crate::ir::extfunc::ExtFuncData;
|
||||
use crate::ir::instructions::{BranchInfo, CallInfo, InstructionData};
|
||||
use crate::ir::types;
|
||||
use crate::ir::{Ebb, FuncRef, Inst, SigRef, Signature, Type, Value, ValueList, ValueListPool};
|
||||
use crate::isa::TargetIsa;
|
||||
use crate::packed_option::ReservedValue;
|
||||
use crate::write::write_operands;
|
||||
use std::fmt;
|
||||
use std::iter;
|
||||
use std::mem;
|
||||
use std::ops::{Index, IndexMut};
|
||||
use std::u16;
|
||||
use write::write_operands;
|
||||
|
||||
/// 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
|
||||
@@ -1063,9 +1063,9 @@ impl DataFlowGraph {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use cursor::{Cursor, FuncCursor};
|
||||
use ir::types;
|
||||
use ir::{Function, InstructionData, Opcode, TrapCode};
|
||||
use crate::cursor::{Cursor, FuncCursor};
|
||||
use crate::ir::types;
|
||||
use crate::ir::{Function, InstructionData, Opcode, TrapCode};
|
||||
use std::string::ToString;
|
||||
|
||||
#[test]
|
||||
@@ -1218,8 +1218,8 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn aliases() {
|
||||
use ir::condcodes::IntCC;
|
||||
use ir::InstBuilder;
|
||||
use crate::ir::condcodes::IntCC;
|
||||
use crate::ir::InstBuilder;
|
||||
|
||||
let mut func = Function::new();
|
||||
let ebb0 = func.dfg.make_ebb();
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
//! The entity references all implement the `Display` trait in a way that matches the textual IR
|
||||
//! format.
|
||||
|
||||
use crate::entity::entity_impl;
|
||||
use std::fmt;
|
||||
use std::u32;
|
||||
|
||||
@@ -318,7 +319,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn memory() {
|
||||
use packed_option::PackedOption;
|
||||
use crate::packed_option::PackedOption;
|
||||
use std::mem;
|
||||
// This is the whole point of `PackedOption`.
|
||||
assert_eq!(
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
//!
|
||||
//! This module declares the data types used to represent external functions and call signatures.
|
||||
|
||||
use ir::{ArgumentLoc, ExternalName, SigRef, Type};
|
||||
use isa::{CallConv, RegInfo, RegUnit};
|
||||
use crate::ir::{ArgumentLoc, ExternalName, SigRef, Type};
|
||||
use crate::isa::{CallConv, RegInfo, RegUnit};
|
||||
use std::fmt;
|
||||
use std::str::FromStr;
|
||||
use std::vec::Vec;
|
||||
@@ -334,7 +334,7 @@ impl fmt::Display for ExtFuncData {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use ir::types::{B8, F32, I32};
|
||||
use crate::ir::types::{B8, F32, I32};
|
||||
use std::string::ToString;
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
//! function. The name of an external declaration doesn't have any meaning to
|
||||
//! Cranelift, which compiles functions independently.
|
||||
|
||||
use ir::LibCall;
|
||||
use crate::ir::LibCall;
|
||||
use std::cmp;
|
||||
use std::fmt::{self, Write};
|
||||
use std::str::FromStr;
|
||||
@@ -119,7 +119,7 @@ impl FromStr for ExternalName {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::ExternalName;
|
||||
use ir::LibCall;
|
||||
use crate::ir::LibCall;
|
||||
use std::string::ToString;
|
||||
use std::u32;
|
||||
|
||||
|
||||
@@ -3,20 +3,20 @@
|
||||
//! The `Function` struct defined in this module owns all of its extended basic blocks and
|
||||
//! instructions.
|
||||
|
||||
use binemit::CodeOffset;
|
||||
use entity::{PrimaryMap, SecondaryMap};
|
||||
use ir;
|
||||
use ir::{DataFlowGraph, ExternalName, Layout, Signature};
|
||||
use ir::{
|
||||
use crate::binemit::CodeOffset;
|
||||
use crate::entity::{PrimaryMap, SecondaryMap};
|
||||
use crate::ir;
|
||||
use crate::ir::{DataFlowGraph, ExternalName, Layout, Signature};
|
||||
use crate::ir::{
|
||||
Ebb, ExtFuncData, FuncRef, GlobalValue, GlobalValueData, Heap, HeapData, JumpTable,
|
||||
JumpTableData, SigRef, StackSlot, StackSlotData, Table, TableData,
|
||||
};
|
||||
use ir::{EbbOffsets, InstEncodings, SourceLocs, StackSlots, ValueLocations};
|
||||
use ir::{JumpTableOffsets, JumpTables};
|
||||
use isa::{CallConv, EncInfo, Encoding, Legalize, TargetIsa};
|
||||
use regalloc::RegDiversions;
|
||||
use crate::ir::{EbbOffsets, InstEncodings, SourceLocs, StackSlots, ValueLocations};
|
||||
use crate::ir::{JumpTableOffsets, JumpTables};
|
||||
use crate::isa::{CallConv, EncInfo, Encoding, Legalize, TargetIsa};
|
||||
use crate::regalloc::RegDiversions;
|
||||
use crate::write::write_function;
|
||||
use std::fmt;
|
||||
use write::write_function;
|
||||
|
||||
/// A function.
|
||||
///
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
//! Global values.
|
||||
|
||||
use ir::immediates::{Imm64, Offset32};
|
||||
use ir::{ExternalName, GlobalValue, Type};
|
||||
use isa::TargetIsa;
|
||||
use crate::ir::immediates::{Imm64, Offset32};
|
||||
use crate::ir::{ExternalName, GlobalValue, Type};
|
||||
use crate::isa::TargetIsa;
|
||||
use std::fmt;
|
||||
|
||||
/// Information about a global value declaration.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Heaps.
|
||||
|
||||
use ir::immediates::Uimm64;
|
||||
use ir::{GlobalValue, Type};
|
||||
use crate::ir::immediates::Uimm64;
|
||||
use crate::ir::{GlobalValue, Type};
|
||||
use std::fmt;
|
||||
|
||||
/// Information about a heap declaration.
|
||||
|
||||
@@ -11,14 +11,14 @@ use std::ops::{Deref, DerefMut};
|
||||
use std::str::FromStr;
|
||||
use std::vec::Vec;
|
||||
|
||||
use ir;
|
||||
use ir::types;
|
||||
use ir::{Ebb, FuncRef, JumpTable, SigRef, Type, Value};
|
||||
use isa;
|
||||
use crate::ir;
|
||||
use crate::ir::types;
|
||||
use crate::ir::{Ebb, FuncRef, JumpTable, SigRef, Type, Value};
|
||||
use crate::isa;
|
||||
|
||||
use bitset::BitSet;
|
||||
use entity;
|
||||
use ref_slice::{ref_slice, ref_slice_mut};
|
||||
use crate::bitset::BitSet;
|
||||
use crate::entity;
|
||||
use crate::ref_slice::{ref_slice, ref_slice_mut};
|
||||
|
||||
/// Some instructions use an external list of argument values because there is not enough space in
|
||||
/// the 16-byte `InstructionData` struct. These value lists are stored in a memory pool in
|
||||
@@ -73,7 +73,7 @@ impl FromStr for Opcode {
|
||||
|
||||
/// Parse an Opcode name from a string.
|
||||
fn from_str(s: &str) -> Result<Self, &'static str> {
|
||||
use constant_hash::{probe, simple_hash, Table};
|
||||
use crate::constant_hash::{probe, simple_hash, Table};
|
||||
|
||||
impl<'a> Table<&'a str> for [Option<Opcode>] {
|
||||
fn len(&self) -> usize {
|
||||
@@ -645,7 +645,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn value_set() {
|
||||
use ir::types::*;
|
||||
use crate::ir::types::*;
|
||||
|
||||
let vts = ValueTypeSet {
|
||||
lanes: BitSet16::from_range(0, 8),
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//! Jump tables are declared in the preamble and assigned an `ir::entities::JumpTable` reference.
|
||||
//! The actual table of destinations is stored in a `JumpTableData` struct defined in this module.
|
||||
|
||||
use ir::entities::Ebb;
|
||||
use crate::ir::entities::Ebb;
|
||||
use std::fmt::{self, Display, Formatter};
|
||||
use std::slice::{Iter, IterMut};
|
||||
use std::vec::Vec;
|
||||
@@ -83,8 +83,8 @@ impl Display for JumpTableData {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::JumpTableData;
|
||||
use entity::EntityRef;
|
||||
use ir::Ebb;
|
||||
use crate::entity::EntityRef;
|
||||
use crate::ir::Ebb;
|
||||
use std::string::ToString;
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -3,13 +3,14 @@
|
||||
//! The order of extended basic blocks in a function and the order of instructions in an EBB is
|
||||
//! determined by the `Layout` data structure defined in this module.
|
||||
|
||||
use entity::SecondaryMap;
|
||||
use ir::progpoint::{ExpandedProgramPoint, ProgramOrder};
|
||||
use ir::{Ebb, Inst};
|
||||
use packed_option::PackedOption;
|
||||
use crate::entity::SecondaryMap;
|
||||
use crate::ir::progpoint::{ExpandedProgramPoint, ProgramOrder};
|
||||
use crate::ir::{Ebb, Inst};
|
||||
use crate::packed_option::PackedOption;
|
||||
use crate::timing;
|
||||
use log::debug;
|
||||
use std::cmp;
|
||||
use std::iter::{IntoIterator, Iterator};
|
||||
use timing;
|
||||
|
||||
/// The `Layout` struct determines the layout of EBBs and instructions in a function. It does not
|
||||
/// contain definitions of instructions or EBBs, but depends on `Inst` and `Ebb` entity references
|
||||
@@ -741,9 +742,9 @@ impl<'f> DoubleEndedIterator for Insts<'f> {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::Layout;
|
||||
use cursor::{Cursor, CursorPosition};
|
||||
use entity::EntityRef;
|
||||
use ir::{Ebb, Inst, ProgramOrder, SourceLoc};
|
||||
use crate::cursor::{Cursor, CursorPosition};
|
||||
use crate::entity::EntityRef;
|
||||
use crate::ir::{Ebb, Inst, ProgramOrder, SourceLoc};
|
||||
use std::cmp::Ordering;
|
||||
use std::vec::Vec;
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
//! Naming well-known routines in the runtime library.
|
||||
|
||||
use ir::{
|
||||
use crate::ir::{
|
||||
types, AbiParam, ArgumentPurpose, ExtFuncData, ExternalName, FuncRef, Function, Inst, Opcode,
|
||||
Signature, Type,
|
||||
};
|
||||
use isa::{CallConv, RegUnit, TargetIsa};
|
||||
use crate::isa::{CallConv, RegUnit, TargetIsa};
|
||||
use std::fmt;
|
||||
use std::str::FromStr;
|
||||
|
||||
|
||||
@@ -23,32 +23,36 @@ mod trapcode;
|
||||
pub mod types;
|
||||
mod valueloc;
|
||||
|
||||
pub use ir::builder::{InsertBuilder, InstBuilder, InstBuilderBase, InstInserterBase};
|
||||
pub use ir::dfg::{DataFlowGraph, ValueDef};
|
||||
pub use ir::entities::{
|
||||
pub use crate::ir::builder::{InsertBuilder, InstBuilder, InstBuilderBase, InstInserterBase};
|
||||
pub use crate::ir::dfg::{DataFlowGraph, ValueDef};
|
||||
pub use crate::ir::entities::{
|
||||
Ebb, FuncRef, GlobalValue, Heap, Inst, JumpTable, SigRef, StackSlot, Table, Value,
|
||||
};
|
||||
pub use ir::extfunc::{AbiParam, ArgumentExtension, ArgumentPurpose, ExtFuncData, Signature};
|
||||
pub use ir::extname::ExternalName;
|
||||
pub use ir::function::Function;
|
||||
pub use ir::globalvalue::GlobalValueData;
|
||||
pub use ir::heap::{HeapData, HeapStyle};
|
||||
pub use ir::instructions::{InstructionData, Opcode, ValueList, ValueListPool, VariableArgs};
|
||||
pub use ir::jumptable::JumpTableData;
|
||||
pub use ir::layout::Layout;
|
||||
pub use ir::libcall::{get_libcall_funcref, get_probestack_funcref, LibCall};
|
||||
pub use ir::memflags::MemFlags;
|
||||
pub use ir::progpoint::{ExpandedProgramPoint, ProgramOrder, ProgramPoint};
|
||||
pub use ir::sourceloc::SourceLoc;
|
||||
pub use ir::stackslot::{StackSlotData, StackSlotKind, StackSlots};
|
||||
pub use ir::table::TableData;
|
||||
pub use ir::trapcode::TrapCode;
|
||||
pub use ir::types::Type;
|
||||
pub use ir::valueloc::{ArgumentLoc, ValueLoc};
|
||||
pub use crate::ir::extfunc::{
|
||||
AbiParam, ArgumentExtension, ArgumentPurpose, ExtFuncData, Signature,
|
||||
};
|
||||
pub use crate::ir::extname::ExternalName;
|
||||
pub use crate::ir::function::Function;
|
||||
pub use crate::ir::globalvalue::GlobalValueData;
|
||||
pub use crate::ir::heap::{HeapData, HeapStyle};
|
||||
pub use crate::ir::instructions::{
|
||||
InstructionData, Opcode, ValueList, ValueListPool, VariableArgs,
|
||||
};
|
||||
pub use crate::ir::jumptable::JumpTableData;
|
||||
pub use crate::ir::layout::Layout;
|
||||
pub use crate::ir::libcall::{get_libcall_funcref, get_probestack_funcref, LibCall};
|
||||
pub use crate::ir::memflags::MemFlags;
|
||||
pub use crate::ir::progpoint::{ExpandedProgramPoint, ProgramOrder, ProgramPoint};
|
||||
pub use crate::ir::sourceloc::SourceLoc;
|
||||
pub use crate::ir::stackslot::{StackSlotData, StackSlotKind, StackSlots};
|
||||
pub use crate::ir::table::TableData;
|
||||
pub use crate::ir::trapcode::TrapCode;
|
||||
pub use crate::ir::types::Type;
|
||||
pub use crate::ir::valueloc::{ArgumentLoc, ValueLoc};
|
||||
|
||||
use binemit;
|
||||
use entity::{PrimaryMap, SecondaryMap};
|
||||
use isa;
|
||||
use crate::binemit;
|
||||
use crate::entity::{PrimaryMap, SecondaryMap};
|
||||
use crate::isa;
|
||||
|
||||
/// Map of value locations.
|
||||
pub type ValueLocations = SecondaryMap<Value, ValueLoc>;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Program points.
|
||||
|
||||
use entity::EntityRef;
|
||||
use ir::{Ebb, Inst, ValueDef};
|
||||
use crate::entity::EntityRef;
|
||||
use crate::ir::{Ebb, Inst, ValueDef};
|
||||
use std::cmp;
|
||||
use std::fmt;
|
||||
use std::u32;
|
||||
@@ -146,8 +146,8 @@ pub trait ProgramOrder {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use entity::EntityRef;
|
||||
use ir::{Ebb, Inst};
|
||||
use crate::entity::EntityRef;
|
||||
use crate::ir::{Ebb, Inst};
|
||||
use std::string::ToString;
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -50,7 +50,7 @@ impl fmt::Display for SourceLoc {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use ir::SourceLoc;
|
||||
use crate::ir::SourceLoc;
|
||||
use std::string::ToString;
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
//! The `StackSlotData` struct keeps track of a single stack slot in a function.
|
||||
//!
|
||||
|
||||
use entity::{Iter, IterMut, Keys, PrimaryMap};
|
||||
use ir::{StackSlot, Type};
|
||||
use packed_option::PackedOption;
|
||||
use crate::entity::{Iter, IterMut, Keys, PrimaryMap};
|
||||
use crate::ir::{StackSlot, Type};
|
||||
use crate::packed_option::PackedOption;
|
||||
use std::cmp;
|
||||
use std::fmt;
|
||||
use std::ops::{Index, IndexMut};
|
||||
@@ -340,8 +340,8 @@ impl StackSlots {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use ir::types;
|
||||
use ir::Function;
|
||||
use crate::ir::types;
|
||||
use crate::ir::Function;
|
||||
use std::string::ToString;
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Tables.
|
||||
|
||||
use ir::immediates::Uimm64;
|
||||
use ir::{GlobalValue, Type};
|
||||
use crate::ir::immediates::Uimm64;
|
||||
use crate::ir::{GlobalValue, Type};
|
||||
use std::fmt;
|
||||
|
||||
/// Information about a table declaration.
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
//! The register allocator assigns every SSA value to either a register or a stack slot. This
|
||||
//! assignment is represented by a `ValueLoc` object.
|
||||
|
||||
use ir::StackSlot;
|
||||
use isa::{RegInfo, RegUnit};
|
||||
use crate::ir::StackSlot;
|
||||
use crate::isa::{RegInfo, RegUnit};
|
||||
use std::fmt;
|
||||
|
||||
/// Value location.
|
||||
|
||||
Reference in New Issue
Block a user