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