Format with stable rustfmt-preview, then with rustfmt-0.9 again.

This commit is contained in:
Dan Gohman
2018-03-30 13:17:15 -07:00
parent d7c66a8ec1
commit 8d5fecd324
127 changed files with 381 additions and 479 deletions

View File

@@ -6,9 +6,9 @@
//! 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 cretonne::settings::{Flags, Configurable, Error as SetError};
use cretonne::settings::{Configurable, Error as SetError, Flags};
use cretonne::isa::TargetIsa;
use error::{Result, Location};
use error::{Location, Result};
use testcommand::TestOption;
/// The ISA specifications in a `.cton` file.

View File

@@ -5,7 +5,7 @@ use std::u16;
#[allow(unused_imports)]
use std::ascii::AsciiExt;
use cretonne::ir::types;
use cretonne::ir::{Value, Ebb};
use cretonne::ir::{Ebb, Value};
use error::Location;
/// A Token returned from the `Lexer`.
@@ -458,7 +458,7 @@ mod tests {
use super::trailing_digits;
use super::*;
use cretonne::ir::types;
use cretonne::ir::{Value, Ebb};
use cretonne::ir::{Ebb, Value};
use error::Location;
#[test]
@@ -556,7 +556,7 @@ mod tests {
fn lex_identifiers() {
let mut lex = Lexer::new(
"v0 v00 vx01 ebb1234567890 ebb5234567890 v1x vx1 vxvx4 \
function0 function b1 i32x4 f32x5 \
function0 function b1 i32x4 f32x5 \
iflags fflags iflagss",
);
assert_eq!(

View File

@@ -3,17 +3,15 @@
//! The `cton_reader` library supports reading .cton files. This functionality is needed for testing
//! Cretonne, but is not essential for a JIT compiler.
#![deny(missing_docs,
trivial_numeric_casts,
unused_extern_crates)]
#![deny(missing_docs, trivial_numeric_casts, unused_extern_crates)]
extern crate cretonne;
pub use error::{Location, Result, Error};
pub use error::{Error, Location, Result};
pub use parser::{parse_functions, parse_test};
pub use testcommand::{TestCommand, TestOption};
pub use testfile::{TestFile, Details, Comment};
pub use isaspec::{IsaSpec, parse_options};
pub use testfile::{Comment, Details, TestFile};
pub use isaspec::{parse_options, IsaSpec};
pub use sourcemap::SourceMap;
mod error;

View File

@@ -3,22 +3,21 @@
use std::str::FromStr;
use std::{u16, u32};
use std::mem;
use cretonne::ir::{Function, Ebb, Opcode, Value, Type, ExternalName, CallConv, StackSlotData,
StackSlotKind, JumpTable, JumpTableData, Signature, AbiParam,
ArgumentExtension, ExtFuncData, SigRef, FuncRef, StackSlot, ValueLoc,
ArgumentLoc, MemFlags, GlobalVar, GlobalVarData, Heap, HeapData, HeapStyle,
HeapBase};
use cretonne::ir::{AbiParam, ArgumentExtension, ArgumentLoc, CallConv, Ebb, ExtFuncData,
ExternalName, FuncRef, Function, GlobalVar, GlobalVarData, Heap, HeapBase,
HeapData, HeapStyle, JumpTable, JumpTableData, MemFlags, Opcode, SigRef,
Signature, StackSlot, StackSlotData, StackSlotKind, Type, Value, ValueLoc};
use cretonne::ir;
use cretonne::ir::types::VOID;
use cretonne::ir::immediates::{Imm64, Uimm32, Offset32, Ieee32, Ieee64};
use cretonne::ir::immediates::{Ieee32, Ieee64, Imm64, Offset32, Uimm32};
use cretonne::ir::entities::AnyEntity;
use cretonne::ir::instructions::{InstructionFormat, InstructionData, VariableArgs};
use cretonne::isa::{self, TargetIsa, Encoding, RegUnit};
use cretonne::ir::instructions::{InstructionData, InstructionFormat, VariableArgs};
use cretonne::isa::{self, Encoding, RegUnit, TargetIsa};
use cretonne::{settings, timing};
use cretonne::entity::EntityRef;
use cretonne::packed_option::ReservedValue;
use testfile::{TestFile, Details, Comment};
use error::{Location, Error, Result};
use testfile::{Comment, Details, TestFile};
use error::{Error, Location, Result};
use lexer::{self, Lexer, Token};
use testcommand::TestCommand;
use isaspec;
@@ -1189,12 +1188,12 @@ impl<'a> Parser<'a> {
}
"bound" => {
data.style = match style_name {
"dynamic" => {
HeapStyle::Dynamic { bound_gv: self.match_gv("expected gv bound")? }
}
"static" => {
HeapStyle::Static { bound: self.match_imm64("expected integer bound")? }
}
"dynamic" => HeapStyle::Dynamic {
bound_gv: self.match_gv("expected gv bound")?,
},
"static" => HeapStyle::Static {
bound: self.match_imm64("expected integer bound")?,
},
t => return err!(self.loc, "unknown heap style '{}'", t),
};
}
@@ -1736,7 +1735,7 @@ impl<'a> Parser<'a> {
return err!(
self.loc,
"instruction produces {} result values, but {} locations were \
specified",
specified",
results.len(),
result_locations.len()
);
@@ -1791,7 +1790,7 @@ impl<'a> Parser<'a> {
return err!(
self.loc,
"type variable required for polymorphic opcode, e.g. '{}.{}'; \
can't infer from {} which is not yet defined",
can't infer from {} which is not yet defined",
opcode,
constraints.ctrl_typeset().unwrap().example(),
ctrl_src_value
@@ -1801,7 +1800,7 @@ impl<'a> Parser<'a> {
return err!(
self.loc,
"type variable required for polymorphic opcode, e.g. '{}.{}'; \
can't infer from {} which is not yet resolved",
can't infer from {} which is not yet resolved",
opcode,
constraints.ctrl_typeset().unwrap().example(),
ctrl_src_value
@@ -1890,36 +1889,26 @@ impl<'a> Parser<'a> {
opcode: Opcode,
) -> Result<InstructionData> {
let idata = match opcode.format() {
InstructionFormat::Unary => {
InstructionData::Unary {
opcode,
arg: self.match_value("expected SSA value operand")?,
}
}
InstructionFormat::UnaryImm => {
InstructionData::UnaryImm {
opcode,
imm: self.match_imm64("expected immediate integer operand")?,
}
}
InstructionFormat::UnaryIeee32 => {
InstructionData::UnaryIeee32 {
opcode,
imm: self.match_ieee32("expected immediate 32-bit float operand")?,
}
}
InstructionFormat::UnaryIeee64 => {
InstructionData::UnaryIeee64 {
opcode,
imm: self.match_ieee64("expected immediate 64-bit float operand")?,
}
}
InstructionFormat::UnaryBool => {
InstructionData::UnaryBool {
opcode,
imm: self.match_bool("expected immediate boolean operand")?,
}
}
InstructionFormat::Unary => InstructionData::Unary {
opcode,
arg: self.match_value("expected SSA value operand")?,
},
InstructionFormat::UnaryImm => InstructionData::UnaryImm {
opcode,
imm: self.match_imm64("expected immediate integer operand")?,
},
InstructionFormat::UnaryIeee32 => InstructionData::UnaryIeee32 {
opcode,
imm: self.match_ieee32("expected immediate 32-bit float operand")?,
},
InstructionFormat::UnaryIeee64 => InstructionData::UnaryIeee64 {
opcode,
imm: self.match_ieee64("expected immediate 64-bit float operand")?,
},
InstructionFormat::UnaryBool => InstructionData::UnaryBool {
opcode,
imm: self.match_bool("expected immediate boolean operand")?,
},
InstructionFormat::UnaryGlobalVar => {
let gv = self.match_gv("expected global variable")?;
ctx.check_gv(gv, &self.loc)?;
@@ -2406,11 +2395,11 @@ impl<'a> Parser<'a> {
#[cfg(test)]
mod tests {
use super::*;
use cretonne::ir::{CallConv, ArgumentExtension, ArgumentPurpose};
use cretonne::ir::{ArgumentExtension, ArgumentPurpose, CallConv};
use cretonne::ir::types;
use cretonne::ir::StackSlotKind;
use cretonne::ir::entities::AnyEntity;
use testfile::{Details, Comment};
use testfile::{Comment, Details};
use isaspec::IsaSpec;
use error::Error;

View File

@@ -7,8 +7,8 @@
//! to parser clients.
use cretonne::ir::entities::AnyEntity;
use cretonne::ir::{StackSlot, GlobalVar, Heap, JumpTable, Ebb, Value, SigRef, FuncRef};
use error::{Result, Location};
use cretonne::ir::{Ebb, FuncRef, GlobalVar, Heap, JumpTable, SigRef, StackSlot, Value};
use error::{Location, Result};
use lexer::split_entity_name;
use std::collections::HashMap;