From a9edb2841402e12ea6594f51a19a9727ee4303a4 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 17 Apr 2018 09:43:05 -0700 Subject: [PATCH] Rename InstructionFormat::IndirectCall for consistency with Opcode::CallIndirect. --- lib/codegen/meta/base/entities.py | 2 +- lib/codegen/meta/base/formats.py | 2 +- lib/codegen/meta/isa/riscv/recipes.py | 8 ++++---- lib/codegen/meta/isa/x86/recipes.py | 4 ++-- lib/codegen/src/ir/instructions.rs | 2 +- lib/codegen/src/legalizer/call.rs | 2 +- lib/codegen/src/verifier/mod.rs | 2 +- lib/codegen/src/write.rs | 2 +- lib/reader/src/parser.rs | 4 ++-- lib/wasm/src/environ/dummy.rs | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/codegen/meta/base/entities.py b/lib/codegen/meta/base/entities.py index 614b4d6284..996913471b 100644 --- a/lib/codegen/meta/base/entities.py +++ b/lib/codegen/meta/base/entities.py @@ -20,7 +20,7 @@ stack_slot = EntityRefKind('stack_slot', 'A stack slot.') global_var = EntityRefKind('global_var', 'A global variable.') #: A reference to a function sugnature declared in the function preamble. -#: Tbis is used to provide the call signature in an indirect call instruction. +#: This is used to provide the call signature in a call_indirect instruction. sig_ref = EntityRefKind('sig_ref', 'A function signature.') #: A reference to an external function declared in the function preamble. diff --git a/lib/codegen/meta/base/formats.py b/lib/codegen/meta/base/formats.py index 595f09b9fa..89ef30881f 100644 --- a/lib/codegen/meta/base/formats.py +++ b/lib/codegen/meta/base/formats.py @@ -53,7 +53,7 @@ BranchIcmp = InstructionFormat(intcc, VALUE, VALUE, ebb, VARIABLE_ARGS) BranchTable = InstructionFormat(VALUE, entities.jump_table) Call = InstructionFormat(func_ref, VARIABLE_ARGS) -IndirectCall = InstructionFormat(sig_ref, VALUE, VARIABLE_ARGS) +CallIndirect = InstructionFormat(sig_ref, VALUE, VARIABLE_ARGS) FuncAddr = InstructionFormat(func_ref) Load = InstructionFormat(memflags, VALUE, offset32) diff --git a/lib/codegen/meta/isa/riscv/recipes.py b/lib/codegen/meta/isa/riscv/recipes.py index c657c7de47..170dd914d3 100644 --- a/lib/codegen/meta/isa/riscv/recipes.py +++ b/lib/codegen/meta/isa/riscv/recipes.py @@ -14,7 +14,7 @@ from cdsl.predicates import IsSignedInt from cdsl.registers import Stack from base.formats import Binary, BinaryImm, MultiAry, IntCompare, IntCompareImm from base.formats import Unary, UnaryImm, BranchIcmp, Branch, Jump -from base.formats import Call, IndirectCall, RegMove +from base.formats import Call, CallIndirect, RegMove from .registers import GPR # The low 7 bits of a RISC-V instruction is the base opcode. All 32-bit @@ -140,11 +140,11 @@ Iret = EncRecipe( ); ''') -# I-type encoding for `jalr` as an indirect call. +# I-type encoding for `jalr` as a call_indirect. Icall = EncRecipe( - 'Icall', IndirectCall, size=4, ins=GPR, outs=(), + 'Icall', CallIndirect, size=4, ins=GPR, outs=(), emit=''' - // Indirect instructions are jalr with rd=%x1. + // call_indirect instructions are jalr with rd=%x1. put_i( bits, in_reg0, diff --git a/lib/codegen/meta/isa/x86/recipes.py b/lib/codegen/meta/isa/x86/recipes.py index 5d0b045ead..ea0da832b7 100644 --- a/lib/codegen/meta/isa/x86/recipes.py +++ b/lib/codegen/meta/isa/x86/recipes.py @@ -7,7 +7,7 @@ from cdsl.predicates import IsSignedInt, IsEqual, Or from cdsl.registers import RegClass from base.formats import Unary, UnaryImm, UnaryBool, Binary, BinaryImm from base.formats import MultiAry, NullAry -from base.formats import Trap, Call, IndirectCall, Store, Load +from base.formats import Trap, Call, CallIndirect, Store, Load from base.formats import IntCompare, IntCompareImm, FloatCompare from base.formats import IntCond, FloatCond from base.formats import IntSelect, IntCondTrap, FloatCondTrap @@ -1055,7 +1055,7 @@ call_plt_id = TailRecipe( ''') call_r = TailRecipe( - 'call_r', IndirectCall, size=1, ins=GPR, outs=(), + 'call_r', CallIndirect, size=1, ins=GPR, outs=(), emit=''' PUT_OP(bits, rex1(in_reg0), sink); modrm_r_bits(in_reg0, bits, sink); diff --git a/lib/codegen/src/ir/instructions.rs b/lib/codegen/src/ir/instructions.rs index ff415af22b..d4ca4a1396 100644 --- a/lib/codegen/src/ir/instructions.rs +++ b/lib/codegen/src/ir/instructions.rs @@ -248,7 +248,7 @@ impl InstructionData { InstructionData::Call { func_ref, ref args, .. } => { CallInfo::Direct(func_ref, args.as_slice(pool)) } - InstructionData::IndirectCall { sig_ref, ref args, .. } => { + InstructionData::CallIndirect { sig_ref, ref args, .. } => { CallInfo::Indirect(sig_ref, &args.as_slice(pool)[1..]) } _ => { diff --git a/lib/codegen/src/legalizer/call.rs b/lib/codegen/src/legalizer/call.rs index d1d8bcba08..ed499f53f3 100644 --- a/lib/codegen/src/legalizer/call.rs +++ b/lib/codegen/src/legalizer/call.rs @@ -51,7 +51,7 @@ pub fn expand_call( ); } - func.dfg.replace(inst).IndirectCall( + func.dfg.replace(inst).CallIndirect( ir::Opcode::CallIndirect, ptr_ty, sig, diff --git a/lib/codegen/src/verifier/mod.rs b/lib/codegen/src/verifier/mod.rs index abda326c03..692a435545 100644 --- a/lib/codegen/src/verifier/mod.rs +++ b/lib/codegen/src/verifier/mod.rs @@ -319,7 +319,7 @@ impl<'a> Verifier<'a> { self.verify_func_ref(inst, func_ref)?; self.verify_value_list(inst, args)?; } - IndirectCall { sig_ref, ref args, .. } => { + CallIndirect { sig_ref, ref args, .. } => { self.verify_sig_ref(inst, sig_ref)?; self.verify_value_list(inst, args)?; } diff --git a/lib/codegen/src/write.rs b/lib/codegen/src/write.rs index 22d78bdb82..073ae22f11 100644 --- a/lib/codegen/src/write.rs +++ b/lib/codegen/src/write.rs @@ -349,7 +349,7 @@ pub fn write_operands( Call { func_ref, ref args, .. } => { write!(w, " {}({})", func_ref, DisplayValues(args.as_slice(pool))) } - IndirectCall { sig_ref, ref args, .. } => { + CallIndirect { sig_ref, ref args, .. } => { let args = args.as_slice(pool); write!( w, diff --git a/lib/reader/src/parser.rs b/lib/reader/src/parser.rs index 1c767b6759..e96e415afc 100644 --- a/lib/reader/src/parser.rs +++ b/lib/reader/src/parser.rs @@ -2179,7 +2179,7 @@ impl<'a> Parser<'a> { args: args.into_value_list(&[], &mut ctx.function.dfg.value_lists), } } - InstructionFormat::IndirectCall => { + InstructionFormat::CallIndirect => { let sig_ref = self.match_sig("expected signature reference")?; ctx.check_sig(sig_ref, &self.loc)?; self.match_token( @@ -2196,7 +2196,7 @@ impl<'a> Parser<'a> { Token::RPar, "expected ')' after arguments", )?; - InstructionData::IndirectCall { + InstructionData::CallIndirect { opcode, sig_ref, args: args.into_value_list(&[callee], &mut ctx.function.dfg.value_lists), diff --git a/lib/wasm/src/environ/dummy.rs b/lib/wasm/src/environ/dummy.rs index cdbb43e5d4..c2eea8219f 100644 --- a/lib/wasm/src/environ/dummy.rs +++ b/lib/wasm/src/environ/dummy.rs @@ -226,7 +226,7 @@ impl<'dummy_environment> FuncEnvironment for DummyFuncEnvironment<'dummy_environ args.push(vmctx, &mut pos.func.dfg.value_lists); pos.ins() - .IndirectCall(ir::Opcode::CallIndirect, ir::types::VOID, sig_ref, args) + .CallIndirect(ir::Opcode::CallIndirect, ir::types::VOID, sig_ref, args) .0 }