Skip to content

Commit a12aa2b

Browse files
aidenfoxiveyk0kubun
authored andcommitted
ZJIT: Since Param is unit struct, elide destructuring
1 parent ac57a5c commit a12aa2b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

zjit/src/hir.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ impl Insn {
841841
fn has_effects(&self) -> bool {
842842
match self {
843843
Insn::Const { .. } => false,
844-
Insn::Param { .. } => false,
844+
Insn::Param => false,
845845
Insn::StringCopy { .. } => false,
846846
Insn::NewArray { .. } => false,
847847
// NewHash's operands may be hashed and compared for equality, which could have
@@ -1469,7 +1469,7 @@ impl Function {
14691469

14701470
// Add an instruction to an SSA block
14711471
pub fn push_insn(&mut self, block: BlockId, insn: Insn) -> InsnId {
1472-
let is_param = matches!(insn, Insn::Param { .. });
1472+
let is_param = matches!(insn, Insn::Param);
14731473
let id = self.new_insn(insn);
14741474
if is_param {
14751475
self.blocks[block.0].params.push(id);
@@ -1576,7 +1576,7 @@ impl Function {
15761576
use Insn::*;
15771577
match &self.insns[insn_id.0] {
15781578
result@(Const {..}
1579-
| Param {..}
1579+
| Param
15801580
| GetConstantPath {..}
15811581
| IsBlockGiven
15821582
| PatchPoint {..}
@@ -1771,7 +1771,7 @@ impl Function {
17711771
fn infer_type(&self, insn: InsnId) -> Type {
17721772
assert!(self.insns[insn.0].has_output());
17731773
match &self.insns[insn.0] {
1774-
Insn::Param { .. } => unimplemented!("params should not be present in block.insns"),
1774+
Insn::Param => unimplemented!("params should not be present in block.insns"),
17751775
Insn::SetGlobal { .. } | Insn::Jump(_) | Insn::EntryPoint { .. }
17761776
| Insn::IfTrue { .. } | Insn::IfFalse { .. } | Insn::Return { .. } | Insn::Throw { .. }
17771777
| Insn::PatchPoint { .. } | Insn::SetIvar { .. } | Insn::SetClassVar { .. } | Insn::ArrayExtend { .. }
@@ -1847,7 +1847,7 @@ impl Function {
18471847
Insn::Defined { pushval, .. } => Type::from_value(*pushval).union(types::NilClass),
18481848
Insn::DefinedIvar { pushval, .. } => Type::from_value(*pushval).union(types::NilClass),
18491849
Insn::GetConstantPath { .. } => types::BasicObject,
1850-
Insn::IsBlockGiven { .. } => types::BoolExact,
1850+
Insn::IsBlockGiven => types::BoolExact,
18511851
Insn::ArrayMax { .. } => types::BasicObject,
18521852
Insn::GetGlobal { .. } => types::BasicObject,
18531853
Insn::GetIvar { .. } => types::BasicObject,
@@ -3024,7 +3024,7 @@ impl Function {
30243024
fn worklist_traverse_single_insn(&self, insn: &Insn, worklist: &mut VecDeque<InsnId>) {
30253025
match insn {
30263026
&Insn::Const { .. }
3027-
| &Insn::Param { .. }
3027+
| &Insn::Param
30283028
| &Insn::EntryPoint { .. }
30293029
| &Insn::LoadPC
30303030
| &Insn::LoadSelf

0 commit comments

Comments
 (0)