Try to depend only on the ir module being in scope.
Generated code should used qualified names assuming that `ir` is in scope, not everything else.
This commit is contained in:
@@ -39,7 +39,7 @@ class ValueType(object):
|
|||||||
|
|
||||||
def rust_name(self):
|
def rust_name(self):
|
||||||
# type: () -> str
|
# type: () -> str
|
||||||
return 'types::' + self.name.upper()
|
return 'ir::types::' + self.name.upper()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def by_name(name):
|
def by_name(name):
|
||||||
|
|||||||
@@ -653,7 +653,7 @@ def emit_level2_hashtables(level2_hashtables, offt, level2_doc, fmt):
|
|||||||
if entry:
|
if entry:
|
||||||
fmt.line(
|
fmt.line(
|
||||||
'Level2Entry ' +
|
'Level2Entry ' +
|
||||||
'{{ opcode: Some(Opcode::{}), offset: {:#08x} }},'
|
'{{ opcode: Some(ir::Opcode::{}), offset: {:#08x} }},'
|
||||||
.format(entry.inst.camel_name, entry.offset))
|
.format(entry.inst.camel_name, entry.offset))
|
||||||
else:
|
else:
|
||||||
fmt.line(
|
fmt.line(
|
||||||
@@ -678,7 +678,7 @@ def emit_level1_hashtable(cpumode, level1, offt, fmt):
|
|||||||
# Empty hash table entry. Include the default legalization action.
|
# Empty hash table entry. Include the default legalization action.
|
||||||
if not level2:
|
if not level2:
|
||||||
fmt.format(
|
fmt.format(
|
||||||
'Level1Entry {{ ty: types::VOID, log2len: !0, '
|
'Level1Entry {{ ty: ir::types::VOID, log2len: !0, '
|
||||||
'offset: 0, legalize: {} }},',
|
'offset: 0, legalize: {} }},',
|
||||||
level1.legalize_code)
|
level1.legalize_code)
|
||||||
continue
|
continue
|
||||||
@@ -686,7 +686,7 @@ def emit_level1_hashtable(cpumode, level1, offt, fmt):
|
|||||||
if level2.ty is not None:
|
if level2.ty is not None:
|
||||||
tyname = level2.ty.rust_name()
|
tyname = level2.ty.rust_name()
|
||||||
else:
|
else:
|
||||||
tyname = 'types::VOID'
|
tyname = 'ir::types::VOID'
|
||||||
|
|
||||||
lcode = cpumode.isa.legalize_code(level2.legalize)
|
lcode = cpumode.isa.legalize_code(level2.legalize)
|
||||||
|
|
||||||
|
|||||||
@@ -350,10 +350,10 @@ def gen_typesets_table(fmt, type_sets):
|
|||||||
fmt.comment('Table of value type sets.')
|
fmt.comment('Table of value type sets.')
|
||||||
assert len(type_sets.table) <= typeset_limit, "Too many type sets"
|
assert len(type_sets.table) <= typeset_limit, "Too many type sets"
|
||||||
with fmt.indented(
|
with fmt.indented(
|
||||||
'const TYPE_SETS : [ValueTypeSet; {}] = ['
|
'const TYPE_SETS : [ir::instructions::ValueTypeSet; {}] = ['
|
||||||
.format(len(type_sets.table)), '];'):
|
.format(len(type_sets.table)), '];'):
|
||||||
for ts in type_sets.table:
|
for ts in type_sets.table:
|
||||||
with fmt.indented('ValueTypeSet {', '},'):
|
with fmt.indented('ir::instructions::ValueTypeSet {', '},'):
|
||||||
ts.emit_fields(fmt)
|
ts.emit_fields(fmt)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ 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;
|
||||||
use ir::{Value, Type, Ebb, JumpTable, SigRef, FuncRef, StackSlot, MemFlags};
|
use ir::{Value, Type, Ebb, JumpTable, SigRef, FuncRef, StackSlot, MemFlags};
|
||||||
use ir::immediates::{Imm64, Uimm8, Ieee32, Ieee64, Offset32, Uoffset32};
|
use ir::immediates::{Imm64, Uimm8, Ieee32, Ieee64, Offset32, Uoffset32};
|
||||||
use ir::condcodes::*;
|
use ir::condcodes::*;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
//! Encoding tables for ARM32 ISA.
|
//! Encoding tables for ARM32 ISA.
|
||||||
|
|
||||||
use ir::types;
|
use ir;
|
||||||
use isa;
|
use isa;
|
||||||
use isa::constraints::*;
|
use isa::constraints::*;
|
||||||
use isa::enc_tables::*;
|
use isa::enc_tables::*;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
//! Encoding tables for ARM64 ISA.
|
//! Encoding tables for ARM64 ISA.
|
||||||
|
|
||||||
use ir::types;
|
use ir;
|
||||||
use isa;
|
use isa;
|
||||||
use isa::constraints::*;
|
use isa::constraints::*;
|
||||||
use isa::enc_tables::*;
|
use isa::enc_tables::*;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
//! Encoding tables for Intel ISAs.
|
//! Encoding tables for Intel ISAs.
|
||||||
|
|
||||||
use ir::{self, types, Opcode};
|
use ir;
|
||||||
use isa;
|
use isa;
|
||||||
use isa::constraints::*;
|
use isa::constraints::*;
|
||||||
use isa::enc_tables::*;
|
use isa::enc_tables::*;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
//! Encoding tables for RISC-V.
|
//! Encoding tables for RISC-V.
|
||||||
|
|
||||||
use ir::condcodes::IntCC;
|
use ir::condcodes::IntCC;
|
||||||
use ir::{self, types, Opcode};
|
use ir;
|
||||||
use isa;
|
use isa;
|
||||||
use isa::constraints::*;
|
use isa::constraints::*;
|
||||||
use isa::enc_tables::*;
|
use isa::enc_tables::*;
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ use ir::{self, Function, Cursor};
|
|||||||
use ir::condcodes::IntCC;
|
use ir::condcodes::IntCC;
|
||||||
use isa::TargetIsa;
|
use isa::TargetIsa;
|
||||||
use bitset::BitSet;
|
use bitset::BitSet;
|
||||||
use ir::instructions::ValueTypeSet;
|
|
||||||
|
|
||||||
mod boundary;
|
mod boundary;
|
||||||
mod split;
|
mod split;
|
||||||
|
|||||||
Reference in New Issue
Block a user