Upgrade to Rust 1.17.
- Remove some uses of 'static in const and static globals that are no longer needed. - Use the new struct initialization shorthand.
This commit is contained in:
@@ -451,7 +451,7 @@ def emit_recipe_names(isa, fmt):
|
|||||||
This is used for pretty-printing encodings.
|
This is used for pretty-printing encodings.
|
||||||
"""
|
"""
|
||||||
with fmt.indented(
|
with fmt.indented(
|
||||||
'static RECIPE_NAMES: [&\'static str; {}] = ['
|
'static RECIPE_NAMES: [&str; {}] = ['
|
||||||
.format(len(isa.all_recipes)), '];'):
|
.format(len(isa.all_recipes)), '];'):
|
||||||
for r in isa.all_recipes:
|
for r in isa.all_recipes:
|
||||||
fmt.line('"{}",'.format(r.name))
|
fmt.line('"{}",'.format(r.name))
|
||||||
|
|||||||
@@ -470,7 +470,7 @@ def gen_format_constructor(iform, fmt):
|
|||||||
# Generate the instruction data.
|
# Generate the instruction data.
|
||||||
with fmt.indented(
|
with fmt.indented(
|
||||||
'let data = InstructionData::{} {{'.format(iform.name), '};'):
|
'let data = InstructionData::{} {{'.format(iform.name), '};'):
|
||||||
fmt.line('opcode: opcode,')
|
fmt.line('opcode,')
|
||||||
gen_member_inits(iform, fmt)
|
gen_member_inits(iform, fmt)
|
||||||
|
|
||||||
fmt.line('self.build(data, ctrl_typevar)')
|
fmt.line('self.build(data, ctrl_typevar)')
|
||||||
@@ -489,7 +489,7 @@ def gen_member_inits(iform, fmt):
|
|||||||
|
|
||||||
# Value operands.
|
# Value operands.
|
||||||
if iform.has_value_list:
|
if iform.has_value_list:
|
||||||
fmt.line('args: args,')
|
fmt.line('args,')
|
||||||
elif iform.num_value_operands == 1:
|
elif iform.num_value_operands == 1:
|
||||||
fmt.line('arg: arg0,')
|
fmt.line('arg: arg0,')
|
||||||
elif iform.num_value_operands > 1:
|
elif iform.num_value_operands > 1:
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ def gen_descriptors(sgrp, fmt):
|
|||||||
raise AssertionError("Unknown setting kind")
|
raise AssertionError("Unknown setting kind")
|
||||||
|
|
||||||
with fmt.indented(
|
with fmt.indented(
|
||||||
'static ENUMERATORS: [&\'static str; {}] = ['
|
'static ENUMERATORS: [&str; {}] = ['
|
||||||
.format(len(enums.table)),
|
.format(len(enums.table)),
|
||||||
'];'):
|
'];'):
|
||||||
for txt in enums.table:
|
for txt in enums.table:
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ impl<'c, 'fc, 'fd> InsertBuilder<'c, 'fc, 'fd> {
|
|||||||
pub fn new(dfg: &'fd mut DataFlowGraph,
|
pub fn new(dfg: &'fd mut DataFlowGraph,
|
||||||
pos: &'c mut Cursor<'fc>)
|
pos: &'c mut Cursor<'fc>)
|
||||||
-> InsertBuilder<'c, 'fc, 'fd> {
|
-> InsertBuilder<'c, 'fc, 'fd> {
|
||||||
InsertBuilder { dfg: dfg, pos: pos }
|
InsertBuilder { dfg, pos }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Reuse result values in `reuse`.
|
/// Reuse result values in `reuse`.
|
||||||
@@ -72,7 +72,7 @@ impl<'c, 'fc, 'fd> InsertBuilder<'c, 'fc, 'fd> {
|
|||||||
InsertReuseBuilder {
|
InsertReuseBuilder {
|
||||||
dfg: self.dfg,
|
dfg: self.dfg,
|
||||||
pos: self.pos,
|
pos: self.pos,
|
||||||
reuse: reuse,
|
reuse,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -154,10 +154,7 @@ pub struct ReplaceBuilder<'f> {
|
|||||||
impl<'f> ReplaceBuilder<'f> {
|
impl<'f> ReplaceBuilder<'f> {
|
||||||
/// Create a `ReplaceBuilder` that will overwrite `inst`.
|
/// Create a `ReplaceBuilder` that will overwrite `inst`.
|
||||||
pub fn new(dfg: &'f mut DataFlowGraph, inst: Inst) -> ReplaceBuilder {
|
pub fn new(dfg: &'f mut DataFlowGraph, inst: Inst) -> ReplaceBuilder {
|
||||||
ReplaceBuilder {
|
ReplaceBuilder { dfg, inst }
|
||||||
dfg: dfg,
|
|
||||||
inst: inst,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -240,10 +240,7 @@ impl DataFlowGraph {
|
|||||||
self.value_type(dest),
|
self.value_type(dest),
|
||||||
ty);
|
ty);
|
||||||
|
|
||||||
self.values[dest] = ValueData::Alias {
|
self.values[dest] = ValueData::Alias { ty, original };
|
||||||
ty: ty,
|
|
||||||
original: original,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create a new value alias.
|
/// Create a new value alias.
|
||||||
@@ -252,10 +249,7 @@ impl DataFlowGraph {
|
|||||||
pub fn make_value_alias(&mut self, src: Value) -> Value {
|
pub fn make_value_alias(&mut self, src: Value) -> Value {
|
||||||
let ty = self.value_type(src);
|
let ty = self.value_type(src);
|
||||||
|
|
||||||
let data = ValueData::Alias {
|
let data = ValueData::Alias { ty, original: src };
|
||||||
ty: ty,
|
|
||||||
original: src,
|
|
||||||
};
|
|
||||||
self.make_value(data)
|
self.make_value(data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -462,9 +456,9 @@ impl DataFlowGraph {
|
|||||||
assert!(num <= u16::MAX as usize, "Too many result values");
|
assert!(num <= u16::MAX as usize, "Too many result values");
|
||||||
let ty = self.value_type(res);
|
let ty = self.value_type(res);
|
||||||
self.values[res] = ValueData::Inst {
|
self.values[res] = ValueData::Inst {
|
||||||
ty: ty,
|
ty,
|
||||||
num: num as u16,
|
num: num as u16,
|
||||||
inst: inst,
|
inst,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -474,8 +468,8 @@ impl DataFlowGraph {
|
|||||||
let num = self.results[inst].push(res, &mut self.value_lists);
|
let num = self.results[inst].push(res, &mut self.value_lists);
|
||||||
assert!(num <= u16::MAX as usize, "Too many result values");
|
assert!(num <= u16::MAX as usize, "Too many result values");
|
||||||
self.make_value(ValueData::Inst {
|
self.make_value(ValueData::Inst {
|
||||||
ty: ty,
|
ty,
|
||||||
inst: inst,
|
inst,
|
||||||
num: num as u16,
|
num: num as u16,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -594,9 +588,9 @@ impl DataFlowGraph {
|
|||||||
let num = self.ebbs[ebb].args.push(arg, &mut self.value_lists);
|
let num = self.ebbs[ebb].args.push(arg, &mut self.value_lists);
|
||||||
assert!(num <= u16::MAX as usize, "Too many arguments to EBB");
|
assert!(num <= u16::MAX as usize, "Too many arguments to EBB");
|
||||||
self.make_value(ValueData::Arg {
|
self.make_value(ValueData::Arg {
|
||||||
ty: ty,
|
ty,
|
||||||
num: num as u16,
|
num: num as u16,
|
||||||
ebb: ebb,
|
ebb,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -611,9 +605,9 @@ impl DataFlowGraph {
|
|||||||
assert!(num <= u16::MAX as usize, "Too many arguments to EBB");
|
assert!(num <= u16::MAX as usize, "Too many arguments to EBB");
|
||||||
let ty = self.value_type(arg);
|
let ty = self.value_type(arg);
|
||||||
self.values[arg] = ValueData::Arg {
|
self.values[arg] = ValueData::Arg {
|
||||||
ty: ty,
|
ty,
|
||||||
num: num as u16,
|
num: num as u16,
|
||||||
ebb: ebb,
|
ebb,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -635,8 +629,8 @@ impl DataFlowGraph {
|
|||||||
};
|
};
|
||||||
let new_arg = self.make_value(ValueData::Arg {
|
let new_arg = self.make_value(ValueData::Arg {
|
||||||
ty: new_type,
|
ty: new_type,
|
||||||
num: num,
|
num,
|
||||||
ebb: ebb,
|
ebb,
|
||||||
});
|
});
|
||||||
|
|
||||||
self.ebbs[ebb].args.as_mut_slice(&mut self.value_lists)[num as usize] = new_arg;
|
self.ebbs[ebb].args.as_mut_slice(&mut self.value_lists)[num as usize] = new_arg;
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ impl ArgumentType {
|
|||||||
ArgumentType {
|
ArgumentType {
|
||||||
value_type: vt,
|
value_type: vt,
|
||||||
extension: ArgumentExtension::None,
|
extension: ArgumentExtension::None,
|
||||||
purpose: purpose,
|
purpose,
|
||||||
location: ArgumentLoc::Reg(regunit),
|
location: ArgumentLoc::Reg(regunit),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -239,7 +239,7 @@ pub enum ArgumentPurpose {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Text format names of the `ArgumentPurpose` variants.
|
/// Text format names of the `ArgumentPurpose` variants.
|
||||||
static PURPOSE_NAMES: [&'static str; 5] = ["normal", "sret", "link", "fp", "csr"];
|
static PURPOSE_NAMES: [&str; 5] = ["normal", "sret", "link", "fp", "csr"];
|
||||||
|
|
||||||
impl fmt::Display for ArgumentPurpose {
|
impl fmt::Display for ArgumentPurpose {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ impl Function {
|
|||||||
/// Create a function with the given name and signature.
|
/// Create a function with the given name and signature.
|
||||||
pub fn with_name_signature(name: FunctionName, sig: Signature) -> Function {
|
pub fn with_name_signature(name: FunctionName, sig: Signature) -> Function {
|
||||||
Function {
|
Function {
|
||||||
name: name,
|
name,
|
||||||
signature: sig,
|
signature: sig,
|
||||||
stack_slots: EntityMap::new(),
|
stack_slots: EntityMap::new(),
|
||||||
jump_tables: EntityMap::new(),
|
jump_tables: EntityMap::new(),
|
||||||
|
|||||||
@@ -647,7 +647,7 @@ impl<'f> Cursor<'f> {
|
|||||||
/// The cursor holds a mutable reference to `layout` for its entire lifetime.
|
/// The cursor holds a mutable reference to `layout` for its entire lifetime.
|
||||||
pub fn new(layout: &'f mut Layout) -> Cursor {
|
pub fn new(layout: &'f mut Layout) -> Cursor {
|
||||||
Cursor {
|
Cursor {
|
||||||
layout: layout,
|
layout,
|
||||||
pos: CursorPosition::Nowhere,
|
pos: CursorPosition::Nowhere,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ enum FlagBit {
|
|||||||
Aligned,
|
Aligned,
|
||||||
}
|
}
|
||||||
|
|
||||||
const NAMES: [&'static str; 2] = ["notrap", "aligned"];
|
const NAMES: [&str; 2] = ["notrap", "aligned"];
|
||||||
|
|
||||||
/// Flags for memory operations like load/store.
|
/// Flags for memory operations like load/store.
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ fn isa_constructor(shared_flags: shared_settings::Flags,
|
|||||||
};
|
};
|
||||||
Box::new(Isa {
|
Box::new(Isa {
|
||||||
isa_flags: settings::Flags::new(&shared_flags, builder),
|
isa_flags: settings::Flags::new(&shared_flags, builder),
|
||||||
shared_flags: shared_flags,
|
shared_flags,
|
||||||
cpumode: level1,
|
cpumode: level1,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ fn isa_constructor(shared_flags: shared_settings::Flags,
|
|||||||
-> Box<TargetIsa> {
|
-> Box<TargetIsa> {
|
||||||
Box::new(Isa {
|
Box::new(Isa {
|
||||||
isa_flags: settings::Flags::new(&shared_flags, builder),
|
isa_flags: settings::Flags::new(&shared_flags, builder),
|
||||||
shared_flags: shared_flags,
|
shared_flags,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,10 +19,7 @@ pub struct Encoding {
|
|||||||
impl Encoding {
|
impl Encoding {
|
||||||
/// Create a new `Encoding` containing `(recipe, bits)`.
|
/// Create a new `Encoding` containing `(recipe, bits)`.
|
||||||
pub fn new(recipe: u16, bits: u16) -> Encoding {
|
pub fn new(recipe: u16, bits: u16) -> Encoding {
|
||||||
Encoding {
|
Encoding { recipe, bits }
|
||||||
recipe: recipe,
|
|
||||||
bits: bits,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get the recipe number in this encoding.
|
/// Get the recipe number in this encoding.
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ fn isa_constructor(shared_flags: shared_settings::Flags,
|
|||||||
};
|
};
|
||||||
Box::new(Isa {
|
Box::new(Isa {
|
||||||
isa_flags: settings::Flags::new(&shared_flags, builder),
|
isa_flags: settings::Flags::new(&shared_flags, builder),
|
||||||
shared_flags: shared_flags,
|
shared_flags,
|
||||||
cpumode: level1,
|
cpumode: level1,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ impl RegInfo {
|
|||||||
/// Make a temporary object that can display a register unit.
|
/// Make a temporary object that can display a register unit.
|
||||||
pub fn display_regunit(&self, regunit: RegUnit) -> DisplayRegUnit {
|
pub fn display_regunit(&self, regunit: RegUnit) -> DisplayRegUnit {
|
||||||
DisplayRegUnit {
|
DisplayRegUnit {
|
||||||
regunit: regunit,
|
regunit,
|
||||||
reginfo: self,
|
reginfo: self,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ fn isa_constructor(shared_flags: shared_settings::Flags,
|
|||||||
};
|
};
|
||||||
Box::new(Isa {
|
Box::new(Isa {
|
||||||
isa_flags: settings::Flags::new(&shared_flags, builder),
|
isa_flags: settings::Flags::new(&shared_flags, builder),
|
||||||
shared_flags: shared_flags,
|
shared_flags,
|
||||||
cpumode: level1,
|
cpumode: level1,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,10 +8,7 @@ pub trait IteratorExtras: Iterator {
|
|||||||
Self::Item: Clone
|
Self::Item: Clone
|
||||||
{
|
{
|
||||||
let elem = self.next();
|
let elem = self.next();
|
||||||
AdjacentPairs {
|
AdjacentPairs { iter: self, elem }
|
||||||
iter: self,
|
|
||||||
elem: elem,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -261,11 +261,11 @@ fn add_repair(concat: Opcode,
|
|||||||
hi_num: usize,
|
hi_num: usize,
|
||||||
repairs: &mut Vec<Repair>) {
|
repairs: &mut Vec<Repair>) {
|
||||||
repairs.push(Repair {
|
repairs.push(Repair {
|
||||||
concat: concat,
|
concat,
|
||||||
split_type: split_type,
|
split_type,
|
||||||
ebb: ebb,
|
ebb,
|
||||||
num: num,
|
num,
|
||||||
hi_num: hi_num,
|
hi_num,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -99,8 +99,8 @@ impl Coloring {
|
|||||||
let mut ctx = Context {
|
let mut ctx = Context {
|
||||||
reginfo: isa.register_info(),
|
reginfo: isa.register_info(),
|
||||||
encinfo: isa.encoding_info(),
|
encinfo: isa.encoding_info(),
|
||||||
domtree: domtree,
|
domtree,
|
||||||
liveness: liveness,
|
liveness,
|
||||||
usable_regs: isa.allocatable_registers(func),
|
usable_regs: isa.allocatable_registers(func),
|
||||||
};
|
};
|
||||||
ctx.run(self, func, tracker)
|
ctx.run(self, func, tracker)
|
||||||
|
|||||||
@@ -70,9 +70,9 @@ impl LiveValueVec {
|
|||||||
fn push(&mut self, value: Value, endpoint: Inst, affinity: Affinity) {
|
fn push(&mut self, value: Value, endpoint: Inst, affinity: Affinity) {
|
||||||
self.values
|
self.values
|
||||||
.push(LiveValue {
|
.push(LiveValue {
|
||||||
value: value,
|
value,
|
||||||
endpoint: endpoint,
|
endpoint,
|
||||||
affinity: affinity,
|
affinity,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -208,8 +208,8 @@ impl LiveRange {
|
|||||||
/// The live range will be created as dead, but it can be extended with `extend_in_ebb()`.
|
/// The live range will be created as dead, but it can be extended with `extend_in_ebb()`.
|
||||||
pub fn new(value: Value, def: ProgramPoint, affinity: Affinity) -> LiveRange {
|
pub fn new(value: Value, def: ProgramPoint, affinity: Affinity) -> LiveRange {
|
||||||
LiveRange {
|
LiveRange {
|
||||||
value: value,
|
value,
|
||||||
affinity: affinity,
|
affinity,
|
||||||
def_begin: def,
|
def_begin: def,
|
||||||
def_end: def,
|
def_end: def,
|
||||||
liveins: Vec::new(),
|
liveins: Vec::new(),
|
||||||
|
|||||||
@@ -27,10 +27,10 @@ pub fn verify_liveness(isa: &TargetIsa,
|
|||||||
liveness: &Liveness)
|
liveness: &Liveness)
|
||||||
-> Result {
|
-> Result {
|
||||||
let verifier = LivenessVerifier {
|
let verifier = LivenessVerifier {
|
||||||
isa: isa,
|
isa,
|
||||||
func: func,
|
func,
|
||||||
cfg: cfg,
|
cfg,
|
||||||
liveness: liveness,
|
liveness,
|
||||||
};
|
};
|
||||||
verifier.check_ebbs()?;
|
verifier.check_ebbs()?;
|
||||||
verifier.check_insts()?;
|
verifier.check_insts()?;
|
||||||
|
|||||||
@@ -139,10 +139,10 @@ impl<'a> Verifier<'a> {
|
|||||||
let cfg = ControlFlowGraph::with_function(func);
|
let cfg = ControlFlowGraph::with_function(func);
|
||||||
let domtree = DominatorTree::with_function(func, &cfg);
|
let domtree = DominatorTree::with_function(func, &cfg);
|
||||||
Verifier {
|
Verifier {
|
||||||
func: func,
|
func,
|
||||||
cfg: cfg,
|
cfg,
|
||||||
domtree: domtree,
|
domtree,
|
||||||
isa: isa,
|
isa,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ enum Directive {
|
|||||||
// 1. Keyword.
|
// 1. Keyword.
|
||||||
// 2. Rest of line / pattern.
|
// 2. Rest of line / pattern.
|
||||||
//
|
//
|
||||||
const DIRECTIVE_RX: &'static str = r"\b(check|sameln|nextln|unordered|not|regex):\s+(.*)";
|
const DIRECTIVE_RX: &str = r"\b(check|sameln|nextln|unordered|not|regex):\s+(.*)";
|
||||||
|
|
||||||
impl Directive {
|
impl Directive {
|
||||||
/// Create a new directive from a `DIRECTIVE_RX` match.
|
/// Create a new directive from a `DIRECTIVE_RX` match.
|
||||||
@@ -264,9 +264,9 @@ struct State<'a> {
|
|||||||
impl<'a> State<'a> {
|
impl<'a> State<'a> {
|
||||||
fn new(text: &'a str, env_vars: &'a VariableMap, recorder: &'a mut Recorder) -> State<'a> {
|
fn new(text: &'a str, env_vars: &'a VariableMap, recorder: &'a mut Recorder) -> State<'a> {
|
||||||
State {
|
State {
|
||||||
text: text,
|
text,
|
||||||
env_vars: env_vars,
|
env_vars,
|
||||||
recorder: recorder,
|
recorder,
|
||||||
vars: HashMap::new(),
|
vars: HashMap::new(),
|
||||||
last_ordered: 0,
|
last_ordered: 0,
|
||||||
max_match: 0,
|
max_match: 0,
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ pub struct Explainer<'a> {
|
|||||||
impl<'a> Explainer<'a> {
|
impl<'a> Explainer<'a> {
|
||||||
pub fn new(text: &'a str) -> Explainer {
|
pub fn new(text: &'a str) -> Explainer {
|
||||||
Explainer {
|
Explainer {
|
||||||
text: text,
|
text,
|
||||||
directive: 0,
|
directive: 0,
|
||||||
matches: Vec::new(),
|
matches: Vec::new(),
|
||||||
vardefs: Vec::new(),
|
vardefs: Vec::new(),
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ pub struct LocatedToken<'a> {
|
|||||||
/// Wrap up a `Token` with the given location.
|
/// Wrap up a `Token` with the given location.
|
||||||
fn token<'a>(token: Token<'a>, loc: Location) -> Result<LocatedToken<'a>, LocatedError> {
|
fn token<'a>(token: Token<'a>, loc: Location) -> Result<LocatedToken<'a>, LocatedError> {
|
||||||
Ok(LocatedToken {
|
Ok(LocatedToken {
|
||||||
token: token,
|
token,
|
||||||
location: loc,
|
location: loc,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -76,7 +76,7 @@ pub struct LocatedError {
|
|||||||
/// Wrap up an `Error` with the given location.
|
/// Wrap up an `Error` with the given location.
|
||||||
fn error<'a>(error: Error, loc: Location) -> Result<LocatedToken<'a>, LocatedError> {
|
fn error<'a>(error: Error, loc: Location) -> Result<LocatedToken<'a>, LocatedError> {
|
||||||
Err(LocatedError {
|
Err(LocatedError {
|
||||||
error: error,
|
error,
|
||||||
location: loc,
|
location: loc,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,10 +51,10 @@ pub fn parse_test<'a>(text: &'a str) -> Result<TestFile<'a>> {
|
|||||||
let functions = parser.parse_function_list(isa_spec.unique_isa())?;
|
let functions = parser.parse_function_list(isa_spec.unique_isa())?;
|
||||||
|
|
||||||
Ok(TestFile {
|
Ok(TestFile {
|
||||||
commands: commands,
|
commands,
|
||||||
isa_spec: isa_spec,
|
isa_spec,
|
||||||
preamble_comments: preamble_comments,
|
preamble_comments,
|
||||||
functions: functions,
|
functions,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,7 +100,7 @@ impl<'a> Context<'a> {
|
|||||||
function: f,
|
function: f,
|
||||||
map: SourceMap::new(),
|
map: SourceMap::new(),
|
||||||
aliases: HashMap::new(),
|
aliases: HashMap::new(),
|
||||||
unique_isa: unique_isa,
|
unique_isa,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -272,11 +272,7 @@ impl<'a> Parser<'a> {
|
|||||||
Token::Comment(text) => {
|
Token::Comment(text) => {
|
||||||
// Gather comments, associate them with `comment_entity`.
|
// Gather comments, associate them with `comment_entity`.
|
||||||
if let Some(entity) = self.comment_entity {
|
if let Some(entity) = self.comment_entity {
|
||||||
self.comments
|
self.comments.push(Comment { entity, text });
|
||||||
.push(Comment {
|
|
||||||
entity: entity,
|
|
||||||
text: text,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => self.lookahead = Some(token),
|
_ => self.lookahead = Some(token),
|
||||||
@@ -676,7 +672,7 @@ impl<'a> Parser<'a> {
|
|||||||
ctx.rewrite_references()?;
|
ctx.rewrite_references()?;
|
||||||
|
|
||||||
let details = Details {
|
let details = Details {
|
||||||
location: location,
|
location,
|
||||||
comments: self.take_comments(),
|
comments: self.take_comments(),
|
||||||
map: ctx.map,
|
map: ctx.map,
|
||||||
};
|
};
|
||||||
@@ -924,7 +920,7 @@ impl<'a> Parser<'a> {
|
|||||||
.def_entity(sigref.into(), &loc)
|
.def_entity(sigref.into(), &loc)
|
||||||
.expect("duplicate SigRef entities created");
|
.expect("duplicate SigRef entities created");
|
||||||
ExtFuncData {
|
ExtFuncData {
|
||||||
name: name,
|
name,
|
||||||
signature: sigref,
|
signature: sigref,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -933,7 +929,7 @@ impl<'a> Parser<'a> {
|
|||||||
self.consume();
|
self.consume();
|
||||||
let name = self.parse_function_name()?;
|
let name = self.parse_function_name()?;
|
||||||
ExtFuncData {
|
ExtFuncData {
|
||||||
name: name,
|
name,
|
||||||
signature: sig,
|
signature: sig,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1416,28 +1412,28 @@ impl<'a> Parser<'a> {
|
|||||||
opcode: Opcode)
|
opcode: Opcode)
|
||||||
-> Result<InstructionData> {
|
-> Result<InstructionData> {
|
||||||
let idata = match opcode.format() {
|
let idata = match opcode.format() {
|
||||||
InstructionFormat::Nullary => InstructionData::Nullary { opcode: opcode },
|
InstructionFormat::Nullary => InstructionData::Nullary { opcode },
|
||||||
InstructionFormat::Unary => {
|
InstructionFormat::Unary => {
|
||||||
InstructionData::Unary {
|
InstructionData::Unary {
|
||||||
opcode: opcode,
|
opcode,
|
||||||
arg: self.match_value("expected SSA value operand")?,
|
arg: self.match_value("expected SSA value operand")?,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
InstructionFormat::UnaryImm => {
|
InstructionFormat::UnaryImm => {
|
||||||
InstructionData::UnaryImm {
|
InstructionData::UnaryImm {
|
||||||
opcode: opcode,
|
opcode,
|
||||||
imm: self.match_imm64("expected immediate integer operand")?,
|
imm: self.match_imm64("expected immediate integer operand")?,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
InstructionFormat::UnaryIeee32 => {
|
InstructionFormat::UnaryIeee32 => {
|
||||||
InstructionData::UnaryIeee32 {
|
InstructionData::UnaryIeee32 {
|
||||||
opcode: opcode,
|
opcode,
|
||||||
imm: self.match_ieee32("expected immediate 32-bit float operand")?,
|
imm: self.match_ieee32("expected immediate 32-bit float operand")?,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
InstructionFormat::UnaryIeee64 => {
|
InstructionFormat::UnaryIeee64 => {
|
||||||
InstructionData::UnaryIeee64 {
|
InstructionData::UnaryIeee64 {
|
||||||
opcode: opcode,
|
opcode,
|
||||||
imm: self.match_ieee64("expected immediate 64-bit float operand")?,
|
imm: self.match_ieee64("expected immediate 64-bit float operand")?,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1446,7 +1442,7 @@ impl<'a> Parser<'a> {
|
|||||||
self.match_token(Token::Comma, "expected ',' between operands")?;
|
self.match_token(Token::Comma, "expected ',' between operands")?;
|
||||||
let rhs = self.match_value("expected SSA value second operand")?;
|
let rhs = self.match_value("expected SSA value second operand")?;
|
||||||
InstructionData::Binary {
|
InstructionData::Binary {
|
||||||
opcode: opcode,
|
opcode,
|
||||||
args: [lhs, rhs],
|
args: [lhs, rhs],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1455,7 +1451,7 @@ impl<'a> Parser<'a> {
|
|||||||
self.match_token(Token::Comma, "expected ',' between operands")?;
|
self.match_token(Token::Comma, "expected ',' between operands")?;
|
||||||
let rhs = self.match_imm64("expected immediate integer second operand")?;
|
let rhs = self.match_imm64("expected immediate integer second operand")?;
|
||||||
InstructionData::BinaryImm {
|
InstructionData::BinaryImm {
|
||||||
opcode: opcode,
|
opcode,
|
||||||
arg: lhs,
|
arg: lhs,
|
||||||
imm: rhs,
|
imm: rhs,
|
||||||
}
|
}
|
||||||
@@ -1469,14 +1465,14 @@ impl<'a> Parser<'a> {
|
|||||||
self.match_token(Token::Comma, "expected ',' between operands")?;
|
self.match_token(Token::Comma, "expected ',' between operands")?;
|
||||||
let false_arg = self.match_value("expected SSA value false operand")?;
|
let false_arg = self.match_value("expected SSA value false operand")?;
|
||||||
InstructionData::Ternary {
|
InstructionData::Ternary {
|
||||||
opcode: opcode,
|
opcode,
|
||||||
args: [ctrl_arg, true_arg, false_arg],
|
args: [ctrl_arg, true_arg, false_arg],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
InstructionFormat::MultiAry => {
|
InstructionFormat::MultiAry => {
|
||||||
let args = self.parse_value_list()?;
|
let args = self.parse_value_list()?;
|
||||||
InstructionData::MultiAry {
|
InstructionData::MultiAry {
|
||||||
opcode: opcode,
|
opcode,
|
||||||
args: args.into_value_list(&[], &mut ctx.function.dfg.value_lists),
|
args: args.into_value_list(&[], &mut ctx.function.dfg.value_lists),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1485,7 +1481,7 @@ impl<'a> Parser<'a> {
|
|||||||
let ebb_num = self.match_ebb("expected jump destination EBB")?;
|
let ebb_num = self.match_ebb("expected jump destination EBB")?;
|
||||||
let args = self.parse_opt_value_list()?;
|
let args = self.parse_opt_value_list()?;
|
||||||
InstructionData::Jump {
|
InstructionData::Jump {
|
||||||
opcode: opcode,
|
opcode,
|
||||||
destination: ebb_num,
|
destination: ebb_num,
|
||||||
args: args.into_value_list(&[], &mut ctx.function.dfg.value_lists),
|
args: args.into_value_list(&[], &mut ctx.function.dfg.value_lists),
|
||||||
}
|
}
|
||||||
@@ -1496,7 +1492,7 @@ impl<'a> Parser<'a> {
|
|||||||
let ebb_num = self.match_ebb("expected branch destination EBB")?;
|
let ebb_num = self.match_ebb("expected branch destination EBB")?;
|
||||||
let args = self.parse_opt_value_list()?;
|
let args = self.parse_opt_value_list()?;
|
||||||
InstructionData::Branch {
|
InstructionData::Branch {
|
||||||
opcode: opcode,
|
opcode,
|
||||||
destination: ebb_num,
|
destination: ebb_num,
|
||||||
args: args.into_value_list(&[ctrl_arg], &mut ctx.function.dfg.value_lists),
|
args: args.into_value_list(&[ctrl_arg], &mut ctx.function.dfg.value_lists),
|
||||||
}
|
}
|
||||||
@@ -1510,8 +1506,8 @@ impl<'a> Parser<'a> {
|
|||||||
let ebb_num = self.match_ebb("expected branch destination EBB")?;
|
let ebb_num = self.match_ebb("expected branch destination EBB")?;
|
||||||
let args = self.parse_opt_value_list()?;
|
let args = self.parse_opt_value_list()?;
|
||||||
InstructionData::BranchIcmp {
|
InstructionData::BranchIcmp {
|
||||||
opcode: opcode,
|
opcode,
|
||||||
cond: cond,
|
cond,
|
||||||
destination: ebb_num,
|
destination: ebb_num,
|
||||||
args: args.into_value_list(&[lhs, rhs], &mut ctx.function.dfg.value_lists),
|
args: args.into_value_list(&[lhs, rhs], &mut ctx.function.dfg.value_lists),
|
||||||
}
|
}
|
||||||
@@ -1523,8 +1519,8 @@ impl<'a> Parser<'a> {
|
|||||||
self.match_token(Token::Comma, "expected ',' between operands")?;
|
self.match_token(Token::Comma, "expected ',' between operands")?;
|
||||||
let rhs = self.match_value("expected SSA value last operand")?;
|
let rhs = self.match_value("expected SSA value last operand")?;
|
||||||
InstructionData::InsertLane {
|
InstructionData::InsertLane {
|
||||||
opcode: opcode,
|
opcode,
|
||||||
lane: lane,
|
lane,
|
||||||
args: [lhs, rhs],
|
args: [lhs, rhs],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1532,11 +1528,7 @@ impl<'a> Parser<'a> {
|
|||||||
let arg = self.match_value("expected SSA value last operand")?;
|
let arg = self.match_value("expected SSA value last operand")?;
|
||||||
self.match_token(Token::Comma, "expected ',' between operands")?;
|
self.match_token(Token::Comma, "expected ',' between operands")?;
|
||||||
let lane = self.match_uimm8("expected lane number")?;
|
let lane = self.match_uimm8("expected lane number")?;
|
||||||
InstructionData::ExtractLane {
|
InstructionData::ExtractLane { opcode, lane, arg }
|
||||||
opcode: opcode,
|
|
||||||
lane: lane,
|
|
||||||
arg: arg,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
InstructionFormat::IntCompare => {
|
InstructionFormat::IntCompare => {
|
||||||
let cond = self.match_enum("expected intcc condition code")?;
|
let cond = self.match_enum("expected intcc condition code")?;
|
||||||
@@ -1544,8 +1536,8 @@ impl<'a> Parser<'a> {
|
|||||||
self.match_token(Token::Comma, "expected ',' between operands")?;
|
self.match_token(Token::Comma, "expected ',' between operands")?;
|
||||||
let rhs = self.match_value("expected SSA value second operand")?;
|
let rhs = self.match_value("expected SSA value second operand")?;
|
||||||
InstructionData::IntCompare {
|
InstructionData::IntCompare {
|
||||||
opcode: opcode,
|
opcode,
|
||||||
cond: cond,
|
cond,
|
||||||
args: [lhs, rhs],
|
args: [lhs, rhs],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1555,8 +1547,8 @@ impl<'a> Parser<'a> {
|
|||||||
self.match_token(Token::Comma, "expected ',' between operands")?;
|
self.match_token(Token::Comma, "expected ',' between operands")?;
|
||||||
let rhs = self.match_imm64("expected immediate second operand")?;
|
let rhs = self.match_imm64("expected immediate second operand")?;
|
||||||
InstructionData::IntCompareImm {
|
InstructionData::IntCompareImm {
|
||||||
opcode: opcode,
|
opcode,
|
||||||
cond: cond,
|
cond,
|
||||||
arg: lhs,
|
arg: lhs,
|
||||||
imm: rhs,
|
imm: rhs,
|
||||||
}
|
}
|
||||||
@@ -1567,8 +1559,8 @@ impl<'a> Parser<'a> {
|
|||||||
self.match_token(Token::Comma, "expected ',' between operands")?;
|
self.match_token(Token::Comma, "expected ',' between operands")?;
|
||||||
let rhs = self.match_value("expected SSA value second operand")?;
|
let rhs = self.match_value("expected SSA value second operand")?;
|
||||||
InstructionData::FloatCompare {
|
InstructionData::FloatCompare {
|
||||||
opcode: opcode,
|
opcode,
|
||||||
cond: cond,
|
cond,
|
||||||
args: [lhs, rhs],
|
args: [lhs, rhs],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1579,8 +1571,8 @@ impl<'a> Parser<'a> {
|
|||||||
let args = self.parse_value_list()?;
|
let args = self.parse_value_list()?;
|
||||||
self.match_token(Token::RPar, "expected ')' after arguments")?;
|
self.match_token(Token::RPar, "expected ')' after arguments")?;
|
||||||
InstructionData::Call {
|
InstructionData::Call {
|
||||||
opcode: opcode,
|
opcode,
|
||||||
func_ref: func_ref,
|
func_ref,
|
||||||
args: args.into_value_list(&[], &mut ctx.function.dfg.value_lists),
|
args: args.into_value_list(&[], &mut ctx.function.dfg.value_lists),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1593,8 +1585,8 @@ impl<'a> Parser<'a> {
|
|||||||
let args = self.parse_value_list()?;
|
let args = self.parse_value_list()?;
|
||||||
self.match_token(Token::RPar, "expected ')' after arguments")?;
|
self.match_token(Token::RPar, "expected ')' after arguments")?;
|
||||||
InstructionData::IndirectCall {
|
InstructionData::IndirectCall {
|
||||||
opcode: opcode,
|
opcode,
|
||||||
sig_ref: sig_ref,
|
sig_ref,
|
||||||
args: args.into_value_list(&[callee], &mut ctx.function.dfg.value_lists),
|
args: args.into_value_list(&[callee], &mut ctx.function.dfg.value_lists),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1603,20 +1595,16 @@ impl<'a> Parser<'a> {
|
|||||||
self.match_token(Token::Comma, "expected ',' between operands")?;
|
self.match_token(Token::Comma, "expected ',' between operands")?;
|
||||||
let table = self.match_jt()
|
let table = self.match_jt()
|
||||||
.and_then(|num| ctx.get_jt(num, &self.loc))?;
|
.and_then(|num| ctx.get_jt(num, &self.loc))?;
|
||||||
InstructionData::BranchTable {
|
InstructionData::BranchTable { opcode, arg, table }
|
||||||
opcode: opcode,
|
|
||||||
arg: arg,
|
|
||||||
table: table,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
InstructionFormat::StackLoad => {
|
InstructionFormat::StackLoad => {
|
||||||
let ss = self.match_ss("expected stack slot number: ss«n»")
|
let ss = self.match_ss("expected stack slot number: ss«n»")
|
||||||
.and_then(|num| ctx.get_ss(num, &self.loc))?;
|
.and_then(|num| ctx.get_ss(num, &self.loc))?;
|
||||||
let offset = self.optional_offset32()?;
|
let offset = self.optional_offset32()?;
|
||||||
InstructionData::StackLoad {
|
InstructionData::StackLoad {
|
||||||
opcode: opcode,
|
opcode,
|
||||||
stack_slot: ss,
|
stack_slot: ss,
|
||||||
offset: offset,
|
offset,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
InstructionFormat::StackStore => {
|
InstructionFormat::StackStore => {
|
||||||
@@ -1626,19 +1614,19 @@ impl<'a> Parser<'a> {
|
|||||||
.and_then(|num| ctx.get_ss(num, &self.loc))?;
|
.and_then(|num| ctx.get_ss(num, &self.loc))?;
|
||||||
let offset = self.optional_offset32()?;
|
let offset = self.optional_offset32()?;
|
||||||
InstructionData::StackStore {
|
InstructionData::StackStore {
|
||||||
opcode: opcode,
|
opcode,
|
||||||
arg: arg,
|
arg,
|
||||||
stack_slot: ss,
|
stack_slot: ss,
|
||||||
offset: offset,
|
offset,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
InstructionFormat::HeapLoad => {
|
InstructionFormat::HeapLoad => {
|
||||||
let addr = self.match_value("expected SSA value address")?;
|
let addr = self.match_value("expected SSA value address")?;
|
||||||
let offset = self.optional_uoffset32()?;
|
let offset = self.optional_uoffset32()?;
|
||||||
InstructionData::HeapLoad {
|
InstructionData::HeapLoad {
|
||||||
opcode: opcode,
|
opcode,
|
||||||
arg: addr,
|
arg: addr,
|
||||||
offset: offset,
|
offset,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
InstructionFormat::HeapStore => {
|
InstructionFormat::HeapStore => {
|
||||||
@@ -1647,9 +1635,9 @@ impl<'a> Parser<'a> {
|
|||||||
let addr = self.match_value("expected SSA value address")?;
|
let addr = self.match_value("expected SSA value address")?;
|
||||||
let offset = self.optional_uoffset32()?;
|
let offset = self.optional_uoffset32()?;
|
||||||
InstructionData::HeapStore {
|
InstructionData::HeapStore {
|
||||||
opcode: opcode,
|
opcode,
|
||||||
args: [arg, addr],
|
args: [arg, addr],
|
||||||
offset: offset,
|
offset,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
InstructionFormat::Load => {
|
InstructionFormat::Load => {
|
||||||
@@ -1657,10 +1645,10 @@ impl<'a> Parser<'a> {
|
|||||||
let addr = self.match_value("expected SSA value address")?;
|
let addr = self.match_value("expected SSA value address")?;
|
||||||
let offset = self.optional_offset32()?;
|
let offset = self.optional_offset32()?;
|
||||||
InstructionData::Load {
|
InstructionData::Load {
|
||||||
opcode: opcode,
|
opcode,
|
||||||
flags: flags,
|
flags,
|
||||||
arg: addr,
|
arg: addr,
|
||||||
offset: offset,
|
offset,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
InstructionFormat::Store => {
|
InstructionFormat::Store => {
|
||||||
@@ -1670,10 +1658,10 @@ impl<'a> Parser<'a> {
|
|||||||
let addr = self.match_value("expected SSA value address")?;
|
let addr = self.match_value("expected SSA value address")?;
|
||||||
let offset = self.optional_offset32()?;
|
let offset = self.optional_offset32()?;
|
||||||
InstructionData::Store {
|
InstructionData::Store {
|
||||||
opcode: opcode,
|
opcode,
|
||||||
flags: flags,
|
flags,
|
||||||
args: [arg, addr],
|
args: [arg, addr],
|
||||||
offset: offset,
|
offset,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ mod cat;
|
|||||||
mod print_cfg;
|
mod print_cfg;
|
||||||
mod rsfilecheck;
|
mod rsfilecheck;
|
||||||
|
|
||||||
const USAGE: &'static str = "
|
const USAGE: &str = "
|
||||||
Cretonne code generator utility
|
Cretonne code generator utility
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
|
|||||||
@@ -51,8 +51,8 @@ impl ConcurrentRunner {
|
|||||||
|
|
||||||
ConcurrentRunner {
|
ConcurrentRunner {
|
||||||
request_tx: Some(request_tx),
|
request_tx: Some(request_tx),
|
||||||
reply_rx: reply_rx,
|
reply_rx,
|
||||||
handles: handles,
|
handles,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,10 +120,7 @@ fn worker_thread(thread_num: usize,
|
|||||||
// Tell them we're starting this job.
|
// Tell them we're starting this job.
|
||||||
// The receiver should always be present for this as long as we have jobs.
|
// The receiver should always be present for this as long as we have jobs.
|
||||||
replies
|
replies
|
||||||
.send(Reply::Starting {
|
.send(Reply::Starting { jobid, thread_num })
|
||||||
jobid: jobid,
|
|
||||||
thread_num: thread_num,
|
|
||||||
})
|
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let result = catch_unwind(|| runone::run(path.as_path())).unwrap_or_else(|e| {
|
let result = catch_unwind(|| runone::run(path.as_path())).unwrap_or_else(|e| {
|
||||||
@@ -142,12 +139,7 @@ fn worker_thread(thread_num: usize,
|
|||||||
dbg!("FAIL: {}", msg);
|
dbg!("FAIL: {}", msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
replies
|
replies.send(Reply::Done { jobid, result }).unwrap();
|
||||||
.send(Reply::Done {
|
|
||||||
jobid: jobid,
|
|
||||||
result: result,
|
|
||||||
})
|
|
||||||
.unwrap();
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.unwrap()
|
.unwrap()
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ impl TestRunner {
|
|||||||
/// Create a new blank TrstRunner.
|
/// Create a new blank TrstRunner.
|
||||||
pub fn new(verbose: bool) -> TestRunner {
|
pub fn new(verbose: bool) -> TestRunner {
|
||||||
TestRunner {
|
TestRunner {
|
||||||
verbose: verbose,
|
verbose,
|
||||||
dir_stack: Vec::new(),
|
dir_stack: Vec::new(),
|
||||||
tests: Vec::new(),
|
tests: Vec::new(),
|
||||||
new_tests: 0,
|
new_tests: 0,
|
||||||
|
|||||||
@@ -55,9 +55,9 @@ pub fn run(path: &Path) -> TestResult {
|
|||||||
for (func, details) in testfile.functions {
|
for (func, details) in testfile.functions {
|
||||||
let mut context = Context {
|
let mut context = Context {
|
||||||
preamble_comments: &testfile.preamble_comments,
|
preamble_comments: &testfile.preamble_comments,
|
||||||
details: details,
|
details,
|
||||||
verified: false,
|
verified: false,
|
||||||
flags: flags,
|
flags,
|
||||||
isa: None,
|
isa: None,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ struct CFGPrinter<'a> {
|
|||||||
impl<'a> CFGPrinter<'a> {
|
impl<'a> CFGPrinter<'a> {
|
||||||
pub fn new(func: &'a Function) -> CFGPrinter<'a> {
|
pub fn new(func: &'a Function) -> CFGPrinter<'a> {
|
||||||
CFGPrinter {
|
CFGPrinter {
|
||||||
func: func,
|
func,
|
||||||
cfg: ControlFlowGraph::with_function(func),
|
cfg: ControlFlowGraph::with_function(func),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user