Re-export common types in the cretonne::ir module.
Clients should not have to navigate the ir sub-modules to find commonly used types.
This commit is contained in:
@@ -22,8 +22,7 @@
|
||||
//! Here Ebb1 and Ebb2 would each have a single predecessor denoted as (Ebb0, `brz vx, Ebb1`)
|
||||
//! and (Ebb0, `jmp Ebb2`) respectively.
|
||||
|
||||
use ir::Function;
|
||||
use ir::entities::{Inst, Ebb};
|
||||
use ir::{Function, Inst, Ebb};
|
||||
use ir::instructions::BranchInfo;
|
||||
use entity_map::{EntityMap, Keys};
|
||||
use std::collections::HashSet;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/// ! A Dominator Tree represented as mappings of Ebbs to their immediate dominator.
|
||||
|
||||
use cfg::*;
|
||||
use ir::entities::Ebb;
|
||||
use ir::Ebb;
|
||||
use entity_map::{EntityMap, Keys};
|
||||
|
||||
pub struct DominatorTree {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
//! Data flow graph tracking Instructions, Values, and EBBs.
|
||||
|
||||
use entity_map::{EntityMap, PrimaryEntityData};
|
||||
use ir::entities::{Ebb, Inst, Value, NO_VALUE, ExpandedValue};
|
||||
use ir::{Ebb, Inst, Value, Type};
|
||||
use ir::entities::{NO_VALUE, ExpandedValue};
|
||||
use ir::instructions::InstructionData;
|
||||
use ir::types::Type;
|
||||
use entity_map::{EntityMap, PrimaryEntityData};
|
||||
|
||||
use std::ops::{Index, IndexMut};
|
||||
use std::u16;
|
||||
|
||||
@@ -359,7 +360,7 @@ impl EbbData {
|
||||
mod tests {
|
||||
use super::*;
|
||||
use ir::types;
|
||||
use ir::instructions::{Opcode, InstructionData};
|
||||
use ir::{Opcode, InstructionData};
|
||||
|
||||
#[test]
|
||||
fn make_inst() {
|
||||
|
||||
@@ -10,10 +10,11 @@ use std::fmt::{self, Display, Formatter};
|
||||
use std::str::FromStr;
|
||||
use std::ops::{Deref, DerefMut};
|
||||
|
||||
use ir::entities::*;
|
||||
use ir::immediates::*;
|
||||
use ir::{Value, Type, Ebb, JumpTable};
|
||||
use ir::entities::NO_VALUE;
|
||||
use ir::immediates::{Imm64, Ieee32, Ieee64};
|
||||
use ir::condcodes::*;
|
||||
use ir::types::{self, Type};
|
||||
use ir::types;
|
||||
|
||||
// Include code generated by `meta/gen_instr.py`. This file contains:
|
||||
//
|
||||
|
||||
@@ -120,7 +120,7 @@ impl Display for JumpTableData {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::JumpTableData;
|
||||
use ir::entities::Ebb;
|
||||
use ir::Ebb;
|
||||
use entity_map::EntityRef;
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -248,7 +248,7 @@ impl<'a> Iterator for Insts<'a> {
|
||||
mod tests {
|
||||
use super::Layout;
|
||||
use entity_map::EntityRef;
|
||||
use ir::entities::{Ebb, Inst};
|
||||
use ir::{Ebb, Inst};
|
||||
|
||||
#[test]
|
||||
fn append_ebb() {
|
||||
|
||||
@@ -9,14 +9,16 @@ pub mod jumptable;
|
||||
pub mod dfg;
|
||||
pub mod layout;
|
||||
|
||||
use ir::types::{FunctionName, Signature};
|
||||
use entity_map::{EntityRef, EntityMap, PrimaryEntityData};
|
||||
use ir::entities::{StackSlot, JumpTable};
|
||||
pub use ir::types::{Type, FunctionName, Signature};
|
||||
pub use ir::entities::{Ebb, Inst, Value, StackSlot, JumpTable};
|
||||
pub use ir::instructions::{Opcode, InstructionData};
|
||||
pub use ir::dfg::DataFlowGraph;
|
||||
pub use ir::layout::Layout;
|
||||
|
||||
use ir::jumptable::JumpTableData;
|
||||
use ir::dfg::DataFlowGraph;
|
||||
use ir::layout::Layout;
|
||||
use std::fmt::{self, Debug, Display, Formatter};
|
||||
use std::ops::Index;
|
||||
use entity_map::{EntityRef, EntityMap, PrimaryEntityData};
|
||||
|
||||
/// A function.
|
||||
pub struct Function {
|
||||
|
||||
@@ -43,8 +43,7 @@
|
||||
pub mod riscv;
|
||||
|
||||
use settings;
|
||||
use ir::dfg::DataFlowGraph;
|
||||
use ir::entities::Inst;
|
||||
use ir::{Inst, DataFlowGraph};
|
||||
|
||||
/// Look for a supported ISA with the given `name`.
|
||||
/// Return a builder that can create a corresponding `TargetIsa`.
|
||||
|
||||
@@ -5,8 +5,7 @@ pub mod settings;
|
||||
use super::super::settings as shared_settings;
|
||||
use super::Builder as IsaBuilder;
|
||||
use super::{TargetIsa, Encoding};
|
||||
use ir::dfg::DataFlowGraph;
|
||||
use ir::entities::Inst;
|
||||
use ir::{Inst, DataFlowGraph};
|
||||
|
||||
#[allow(dead_code)]
|
||||
struct Isa {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
//! Helper functions for generating dummy instructions.
|
||||
|
||||
use ir::Function;
|
||||
use ir::entities::{Ebb, Inst, NO_VALUE};
|
||||
use ir::instructions::{InstructionData, Opcode, VariableArgs, JumpData, BranchData};
|
||||
use ir::{Function, Ebb, Inst, Opcode};
|
||||
use ir::entities::NO_VALUE;
|
||||
use ir::instructions::{InstructionData, VariableArgs, JumpData, BranchData};
|
||||
use ir::types;
|
||||
|
||||
pub fn jump(func: &mut Function, dest: Ebb) -> Inst {
|
||||
|
||||
@@ -4,10 +4,8 @@
|
||||
//! equivalent textual representation. This textual representation can be read back by the
|
||||
//! `cretonne-reader` crate.
|
||||
|
||||
use ir::{Function, Ebb, Inst, Value, Type};
|
||||
use std::io::{self, Write};
|
||||
use ir::Function;
|
||||
use ir::entities::{Inst, Ebb, Value};
|
||||
use ir::types::Type;
|
||||
|
||||
pub type Result = io::Result<()>;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
use std::str::CharIndices;
|
||||
use cretonne::ir::types;
|
||||
use cretonne::ir::entities::{Value, Ebb};
|
||||
use cretonne::ir::{Value, Ebb};
|
||||
|
||||
/// The location of a `Token` or `Error`.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
@@ -374,7 +374,7 @@ impl<'a> Lexer<'a> {
|
||||
mod tests {
|
||||
use super::*;
|
||||
use cretonne::ir::types;
|
||||
use cretonne::ir::entities::{Value, Ebb};
|
||||
use cretonne::ir::{Value, Ebb};
|
||||
|
||||
fn token<'a>(token: Token<'a>, line: usize) -> Option<Result<LocatedToken<'a>, LocatedError>> {
|
||||
Some(super::token(token, Location { line_number: line }))
|
||||
|
||||
@@ -11,12 +11,13 @@ use std::fmt::{self, Display, Formatter};
|
||||
use std::str::FromStr;
|
||||
use std::u32;
|
||||
use lexer::{self, Lexer, Token};
|
||||
use cretonne::ir::types::{Type, VOID, FunctionName, Signature, ArgumentType, ArgumentExtension};
|
||||
use cretonne::ir::{Function, Ebb, Inst, Opcode, Value, Type, FunctionName, StackSlotData,
|
||||
JumpTable, StackSlot};
|
||||
use cretonne::ir::types::{VOID, Signature, ArgumentType, ArgumentExtension};
|
||||
use cretonne::ir::immediates::{Imm64, Ieee32, Ieee64};
|
||||
use cretonne::ir::entities::*;
|
||||
use cretonne::ir::instructions::{Opcode, InstructionFormat, InstructionData, VariableArgs,
|
||||
JumpData, BranchData, ReturnData};
|
||||
use cretonne::ir::{Function, StackSlotData};
|
||||
use cretonne::ir::entities::{NO_EBB, NO_VALUE};
|
||||
use cretonne::ir::instructions::{InstructionFormat, InstructionData, VariableArgs, JumpData,
|
||||
BranchData, ReturnData};
|
||||
use cretonne::ir::jumptable::JumpTableData;
|
||||
|
||||
pub use lexer::Location;
|
||||
|
||||
@@ -2,7 +2,7 @@ extern crate cretonne;
|
||||
extern crate cton_reader;
|
||||
|
||||
use self::cton_reader::parser::Parser;
|
||||
use self::cretonne::ir::entities::Ebb;
|
||||
use self::cretonne::ir::Ebb;
|
||||
use self::cretonne::cfg::ControlFlowGraph;
|
||||
use self::cretonne::entity_map::EntityMap;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ extern crate cretonne;
|
||||
extern crate cton_reader;
|
||||
|
||||
use self::cton_reader::parser::Parser;
|
||||
use self::cretonne::ir::entities::Ebb;
|
||||
use self::cretonne::ir::Ebb;
|
||||
use self::cretonne::cfg::ControlFlowGraph;
|
||||
use self::cretonne::dominator_tree::DominatorTree;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user