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
@@ -7,6 +7,7 @@ license = "Apache-2.0 WITH LLVM-exception"
|
||||
documentation = "https://cranelift.readthedocs.io/"
|
||||
repository = "https://github.com/CraneStation/cranelift"
|
||||
readme = "README.md"
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
cranelift-codegen = { path = "../codegen", version = "0.26.0" }
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
//! If a test case file contains `isa` commands, the tests will only be run against the specified
|
||||
//! ISAs. If the file contains no `isa` commands, the tests will be run against all supported ISAs.
|
||||
|
||||
use crate::error::{Location, ParseResult};
|
||||
use crate::testcommand::TestOption;
|
||||
use cranelift_codegen::isa::TargetIsa;
|
||||
use cranelift_codegen::settings::{Configurable, Flags, SetError};
|
||||
use error::{Location, ParseResult};
|
||||
use testcommand::TestOption;
|
||||
|
||||
/// The ISA specifications in a `.clif` file.
|
||||
pub enum IsaSpec {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
//! Lexical analysis for .clif files.
|
||||
|
||||
use crate::error::Location;
|
||||
use cranelift_codegen::ir::types;
|
||||
use cranelift_codegen::ir::{Ebb, Value};
|
||||
use error::Location;
|
||||
#[allow(unused_imports, deprecated)]
|
||||
use std::ascii::AsciiExt;
|
||||
use std::str::CharIndices;
|
||||
@@ -481,9 +481,9 @@ impl<'a> Lexer<'a> {
|
||||
mod tests {
|
||||
use super::trailing_digits;
|
||||
use super::*;
|
||||
use crate::error::Location;
|
||||
use cranelift_codegen::ir::types;
|
||||
use cranelift_codegen::ir::{Ebb, Value};
|
||||
use error::Location;
|
||||
|
||||
#[test]
|
||||
fn digits() {
|
||||
|
||||
@@ -29,15 +29,12 @@
|
||||
)
|
||||
)]
|
||||
|
||||
extern crate cranelift_codegen;
|
||||
extern crate target_lexicon;
|
||||
|
||||
pub use error::{Location, ParseError, ParseResult};
|
||||
pub use isaspec::{parse_options, IsaSpec};
|
||||
pub use parser::{parse_functions, parse_test};
|
||||
pub use sourcemap::SourceMap;
|
||||
pub use testcommand::{TestCommand, TestOption};
|
||||
pub use testfile::{Comment, Details, TestFile};
|
||||
pub use crate::error::{Location, ParseError, ParseResult};
|
||||
pub use crate::isaspec::{parse_options, IsaSpec};
|
||||
pub use crate::parser::{parse_functions, parse_test};
|
||||
pub use crate::sourcemap::SourceMap;
|
||||
pub use crate::testcommand::{TestCommand, TestOption};
|
||||
pub use crate::testfile::{Comment, Details, TestFile};
|
||||
|
||||
mod error;
|
||||
mod isaspec;
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
//! Parser for .clif files.
|
||||
|
||||
use crate::error::{Location, ParseError, ParseResult};
|
||||
use crate::isaspec;
|
||||
use crate::lexer::{LexError, Lexer, LocatedError, LocatedToken, Token};
|
||||
use crate::sourcemap::SourceMap;
|
||||
use crate::testcommand::TestCommand;
|
||||
use crate::testfile::{Comment, Details, TestFile};
|
||||
use cranelift_codegen::entity::EntityRef;
|
||||
use cranelift_codegen::ir;
|
||||
use cranelift_codegen::ir::entities::AnyEntity;
|
||||
@@ -15,16 +21,10 @@ use cranelift_codegen::ir::{
|
||||
use cranelift_codegen::isa::{self, CallConv, Encoding, RegUnit, TargetIsa};
|
||||
use cranelift_codegen::packed_option::ReservedValue;
|
||||
use cranelift_codegen::{settings, timing};
|
||||
use error::{Location, ParseError, ParseResult};
|
||||
use isaspec;
|
||||
use lexer::{LexError, Lexer, LocatedError, LocatedToken, Token};
|
||||
use sourcemap::SourceMap;
|
||||
use std::mem;
|
||||
use std::str::FromStr;
|
||||
use std::{u16, u32};
|
||||
use target_lexicon::Triple;
|
||||
use testcommand::TestCommand;
|
||||
use testfile::{Comment, Details, TestFile};
|
||||
|
||||
/// Parse the entire `text` into a list of functions.
|
||||
///
|
||||
@@ -793,7 +793,7 @@ impl<'a> Parser<'a> {
|
||||
Ok(triple) => triple,
|
||||
Err(err) => return err!(loc, err),
|
||||
};
|
||||
let mut isa_builder = match isa::lookup(triple) {
|
||||
let isa_builder = match isa::lookup(triple) {
|
||||
Err(isa::LookupError::SupportDisabled) => {
|
||||
return err!(loc, "support disabled target '{}'", targ)
|
||||
}
|
||||
@@ -2571,14 +2571,14 @@ impl<'a> Parser<'a> {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::error::ParseError;
|
||||
use crate::isaspec::IsaSpec;
|
||||
use crate::testfile::{Comment, Details};
|
||||
use cranelift_codegen::ir::entities::AnyEntity;
|
||||
use cranelift_codegen::ir::types;
|
||||
use cranelift_codegen::ir::StackSlotKind;
|
||||
use cranelift_codegen::ir::{ArgumentExtension, ArgumentPurpose};
|
||||
use cranelift_codegen::isa::CallConv;
|
||||
use error::ParseError;
|
||||
use isaspec::IsaSpec;
|
||||
use testfile::{Comment, Details};
|
||||
|
||||
#[test]
|
||||
fn argument_type() {
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
//! The `SourceMap` struct defined in this module makes this mapping available
|
||||
//! to parser clients.
|
||||
|
||||
use crate::error::{Location, ParseResult};
|
||||
use crate::lexer::split_entity_name;
|
||||
use cranelift_codegen::ir::entities::AnyEntity;
|
||||
use cranelift_codegen::ir::{
|
||||
Ebb, FuncRef, GlobalValue, Heap, JumpTable, SigRef, StackSlot, Table, Value,
|
||||
};
|
||||
use error::{Location, ParseResult};
|
||||
use lexer::split_entity_name;
|
||||
use std::collections::HashMap;
|
||||
|
||||
/// Mapping from entity names to source locations.
|
||||
@@ -211,7 +211,7 @@ impl SourceMap {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use parse_test;
|
||||
use crate::parse_test;
|
||||
|
||||
#[test]
|
||||
fn details() {
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
//! file-based test case.
|
||||
//!
|
||||
|
||||
use crate::error::Location;
|
||||
use crate::isaspec::IsaSpec;
|
||||
use crate::sourcemap::SourceMap;
|
||||
use crate::testcommand::TestCommand;
|
||||
use cranelift_codegen::ir::entities::AnyEntity;
|
||||
use cranelift_codegen::ir::Function;
|
||||
use error::Location;
|
||||
use isaspec::IsaSpec;
|
||||
use sourcemap::SourceMap;
|
||||
use testcommand::TestCommand;
|
||||
|
||||
/// A parsed test case.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user