Skip to content

Commit

Permalink
Rename: get_operand() -> operand().
Browse files Browse the repository at this point in the history
  • Loading branch information
vext01 committed Dec 20, 2023
1 parent c8466d7 commit 80279ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ykrt/src/compile/jitc_yk/aot_ir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ pub(crate) struct Instruction {

impl Instruction {
/// Returns the operand at the specified index. Panics if the index is out of bounds.
pub(crate) fn get_operand(&self, index: usize) -> &Operand {
pub(crate) fn operand(&self, index: usize) -> &Operand {
&self.operands[index]
}

Expand Down
8 changes: 4 additions & 4 deletions ykrt/src/compile/jitc_yk/trace_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ impl<'a> TraceBuilder<'a> {
let mut input = Vec::new();
for inst in blk.instrs.iter().rev() {
if inst.is_control_point(self.aot_mod) {
trace_input = Some(inst.get_operand(CTRL_POINT_ARGIDX_INPUTS));
trace_input = Some(inst.operand(CTRL_POINT_ARGIDX_INPUTS));
}
if inst.is_store() {
last_store = Some(inst);
}
if inst.is_gep() {
let op = inst.get_operand(0);
let op = inst.operand(0);
// unwrap safe: we know the AOT code was produced by ykllvm.
if trace_input
.unwrap()
Expand All @@ -73,7 +73,7 @@ impl<'a> TraceBuilder<'a> {
{
// Found a trace input.
// unwrap safe: we know the AOT code was produced by ykllvm.
let inp = last_store.unwrap().get_operand(0);
let inp = last_store.unwrap().operand(0);
input.insert(0, inp.to_instr(self.aot_mod));
let load_arg = jit_ir::Instruction::create_loadarg();
self.local_map
Expand Down Expand Up @@ -113,7 +113,7 @@ impl<'a> TraceBuilder<'a> {

// Translate a `Load` instruction.
fn handle_load(&self, inst: &aot_ir::Instruction) -> jit_ir::Instruction {
let aot_op = inst.get_operand(0);
let aot_op = inst.operand(0);
let jit_op = match aot_op {
aot_ir::Operand::LocalVariable(aot_iid) => self.local_map[aot_iid],
_ => todo!("{}", aot_op.to_str(self.aot_mod)),
Expand Down

0 comments on commit 80279ae

Please sign in to comment.