Summary
Title: BinaryOp handling "=" overlaps with VariableAssignment
Description:
While exploring assignment handling in IRx, I found that the "=" operator is currently handled inside BinaryOp:
This logic:
- evaluates RHS expression
- looks up the variable from
named_values
- emits a
store instruction
- pushes the result to
result_stack
A very similar flow exists in visit(VariableAssignment):
This results in duplicated assignment logic across two different paths.
From the recent discussion, it seems BinaryOp is not expected to handle "=". If that is the case, this behavior may need to be adjusted so that assignment is handled only through VariableAssignment.
Questions:
- Should assignment logic be removed from
BinaryOp entirely?
- Should the common assignment logic be centralized/shared?
I’d be happy to work on aligning this with the intended design.
OS / Environment
Steps to Reproduce
.
File Upload (optional)
.
Expected Results
.
Actual Results
IRx version
Code of Conduct
Summary
Title: BinaryOp handling "=" overlaps with VariableAssignment
Description:
While exploring assignment handling in IRx, I found that the "=" operator is currently handled inside
BinaryOp:llvmliteir.pyThis logic:
named_valuesstoreinstructionresult_stackA very similar flow exists in
visit(VariableAssignment):llvmliteir.pyThis results in duplicated assignment logic across two different paths.
From the recent discussion, it seems
BinaryOpis not expected to handle "=". If that is the case, this behavior may need to be adjusted so that assignment is handled only throughVariableAssignment.Questions:
BinaryOpentirely?I’d be happy to work on aligning this with the intended design.
OS / Environment
.Steps to Reproduce
.
File Upload (optional)
.
Expected Results
.
Actual Results
.IRx version
.Code of Conduct