mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user