Remove BinaryOperatorAdd (#3469)

BinaryOperatorAdd had been added early on as a proof-of-concept for
toolchain design for parsing -> checking flow. However, it doesn't
reflect the interface direction for operators, and now other portions of
the toolchain demonstrate the relevant logic. Instead, it's just a bit
of an outlier versus other instructions which have evolved over time.
This commit is contained in:
Jon Ross-Perkins
2023-12-08 01:06:19 +00:00
committed by GitHub
parent 226b653e11
commit 8ace1dcb78
20 changed files with 232 additions and 230 deletions
-13
View File
@@ -14,19 +14,6 @@ auto HandleInfixOperator(Context& context, Parse::NodeId parse_node) -> bool {
// Figure out the operator for the token.
auto token = context.parse_tree().node_token(parse_node);
switch (auto token_kind = context.tokens().GetKind(token)) {
case Lex::TokenKind::Plus:
// TODO: This should search for a compatible interface. For now, it's a
// very trivial check of validity on the operation.
lhs_id = ConvertToValueOfType(context, parse_node, lhs_id,
context.insts().Get(rhs_id).type_id());
rhs_id = ConvertToValueExpr(context, rhs_id);
context.AddInstAndPush(
parse_node, SemIR::BinaryOperatorAdd{
parse_node, context.insts().Get(lhs_id).type_id(),
lhs_id, rhs_id});
return true;
case Lex::TokenKind::And:
case Lex::TokenKind::Or: {
// The first operand is wrapped in a ShortCircuitOperand, which we