Skip to content

Commit

Permalink
Use anchored import paths
Browse files Browse the repository at this point in the history
Not sure how this was compiling before?
  • Loading branch information
fitzgen committed Feb 14, 2019
1 parent a6407da commit f8a5fa3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions src/ir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ pub enum ExtendedLoad {
impl LoadKind {
/// Returns the number of bytes loaded
pub fn width(&self) -> u32 {
use LoadKind::*;
use self::LoadKind::*;
match self {
I32_8 { .. } | I64_8 { .. } => 1,
I32_16 { .. } | I64_16 { .. } => 2,
Expand All @@ -744,7 +744,7 @@ impl LoadKind {

/// Returns if this is an atomic load
pub fn atomic(&self) -> bool {
use LoadKind::*;
use self::LoadKind::*;
match self {
I32_8 { kind }
| I32_16 { kind }
Expand Down Expand Up @@ -786,7 +786,7 @@ pub enum StoreKind {
impl StoreKind {
/// Returns the number of bytes stored
pub fn width(&self) -> u32 {
use StoreKind::*;
use self::StoreKind::*;
match self {
I32_8 { .. } | I64_8 { .. } => 1,
I32_16 { .. } | I64_16 { .. } => 2,
Expand All @@ -798,7 +798,7 @@ impl StoreKind {

/// Returns whether this is an atomic store
pub fn atomic(&self) -> bool {
use StoreKind::*;
use self::StoreKind::*;

match self {
I32 { atomic }
Expand Down Expand Up @@ -851,7 +851,7 @@ pub enum AtomicWidth {
impl AtomicWidth {
/// Returns the size, in bytes, of this atomic operation
pub fn bytes(&self) -> u32 {
use AtomicWidth::*;
use self::AtomicWidth::*;
match self {
I32_8 | I64_8 => 1,
I32_16 | I64_16 => 2,
Expand Down
16 changes: 8 additions & 8 deletions src/module/functions/local_function/emit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ impl Emit<'_, '_> {
}

Binop(e) => {
use BinaryOp::*;
use crate::ir::BinaryOp::*;

self.visit(e.lhs);
self.visit(e.rhs);
Expand Down Expand Up @@ -229,7 +229,7 @@ impl Emit<'_, '_> {
}

Unop(e) => {
use UnaryOp::*;
use crate::ir::UnaryOp::*;

self.visit(e.expr);
let opcode = match e.op {
Expand Down Expand Up @@ -381,8 +381,8 @@ impl Emit<'_, '_> {
}

Load(e) => {
use ExtendedLoad::*;
use LoadKind::*;
use crate::ir::ExtendedLoad::*;
use crate::ir::LoadKind::*;
self.visit(e.address);
match e.kind {
I32 { atomic: false } => self.encoder.byte(0x28), // i32.load
Expand Down Expand Up @@ -422,7 +422,7 @@ impl Emit<'_, '_> {
}

Store(e) => {
use StoreKind::*;
use crate::ir::StoreKind::*;
self.visit(e.address);
self.visit(e.value);
match e.kind {
Expand All @@ -448,8 +448,8 @@ impl Emit<'_, '_> {
}

AtomicRmw(e) => {
use AtomicOp::*;
use AtomicWidth::*;
use crate::ir::AtomicOp::*;
use crate::ir::AtomicWidth::*;

self.visit(e.address);
self.visit(e.value);
Expand Down Expand Up @@ -509,7 +509,7 @@ impl Emit<'_, '_> {
}

Cmpxchg(e) => {
use AtomicWidth::*;
use crate::ir::AtomicWidth::*;

self.visit(e.address);
self.visit(e.expected);
Expand Down
4 changes: 2 additions & 2 deletions src/module/functions/local_function/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ impl DotExpr<'_, '_> {
}

fn validate_instruction(ctx: &mut FunctionContext, inst: Operator) -> Result<()> {
use ExtendedLoad::*;
use ValType::*;
use crate::ir::ExtendedLoad::*;
use crate::ValType::*;

let const_ = |ctx: &mut FunctionContext, ty, value| {
let expr = ctx.func.alloc(Const { value });
Expand Down

0 comments on commit f8a5fa3

Please sign in to comment.