Skip to content

Commit c56e695

Browse files
authored
Merge pull request #9 from Amanieu/remove_is_call
Remove Function::is_call
2 parents 7724dc6 + a243c4e commit c56e695

File tree

4 files changed

+3
-16
lines changed

4 files changed

+3
-16
lines changed

doc/DESIGN.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,8 @@ successors.
4949

5050
Instructions are opaque to the allocator except for a few important
5151
bits: (1) `is_ret` (is a return instruction); (2) `is_branch` (is a
52-
branch instruction); (3) `is_call` (is a call instruction, for
53-
heuristic purposes only), (4) `is_move` (is a move between registers),
54-
and (5) a vector of Operands, covered below. Every block must end in a
52+
branch instruction); (3) `is_move` (is a move between registers), and
53+
(4) a vector of Operands, covered below. Every block must end in a
5554
return or branch.
5655

5756
Both instructions and blocks are named by indices in contiguous index

src/fuzzing/func.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ use arbitrary::{Arbitrary, Unstructured};
1515
pub enum InstOpcode {
1616
Phi,
1717
Op,
18-
Call,
1918
Ret,
2019
Branch,
2120
}
@@ -104,10 +103,6 @@ impl Function for Func {
104103
&self.block_params[block.index()][..]
105104
}
106105

107-
fn is_call(&self, insn: Inst) -> bool {
108-
self.insts[insn.index()].op == InstOpcode::Call
109-
}
110-
111106
fn is_ret(&self, insn: Inst) -> bool {
112107
self.insts[insn.index()].op == InstOpcode::Ret
113108
}
@@ -500,11 +495,10 @@ impl Func {
500495
.all(|op| !builder.f.reftype_vregs.contains(&op.vreg()))
501496
&& bool::arbitrary(u)?;
502497

503-
let op = *u.choose(&[InstOpcode::Op, InstOpcode::Call])?;
504498
builder.add_inst(
505499
Block::new(block),
506500
InstData {
507-
op,
501+
op: InstOpcode::Op,
508502
operands,
509503
clobbers,
510504
is_safepoint,

src/ion/dump.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,6 @@ impl<'a, F: Function> Env<'a, F> {
103103
.collect::<Vec<_>>();
104104
let opname = if self.func.is_branch(inst) {
105105
"br"
106-
} else if self.func.is_call(inst) {
107-
"call"
108106
} else if self.func.is_ret(inst) {
109107
"ret"
110108
} else {

src/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -847,10 +847,6 @@ pub trait Function {
847847
/// Get the block parameters for a given block.
848848
fn block_params(&self, block: Block) -> &[VReg];
849849

850-
/// Determine whether an instruction is a call instruction. This is used
851-
/// only for splitting heuristics.
852-
fn is_call(&self, insn: Inst) -> bool;
853-
854850
/// Determine whether an instruction is a return instruction.
855851
fn is_ret(&self, insn: Inst) -> bool;
856852

0 commit comments

Comments
 (0)