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
@@ -37,9 +37,9 @@ fn AddressOfLiteral() {
fn AddressOfOperator() {
// CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+3]]:3: ERROR: Cannot take the address of non-reference expression.
// CHECK:STDERR: &(1 + 1);
// CHECK:STDERR: &(true and false);
// CHECK:STDERR: ^
&(1 + 1);
&(true and false);
// CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+3]]:3: ERROR: Cannot take the address of a temporary object.
// CHECK:STDERR: &H().a;
// CHECK:STDERR: ^
@@ -133,10 +133,17 @@ fn AddressOfParam(param: i32) {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @AddressOfOperator() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc42_5: i32 = int_literal 1
// CHECK:STDOUT: %.loc42_9: i32 = int_literal 1
// CHECK:STDOUT: %.loc42_7: i32 = add %.loc42_5, %.loc42_9
// CHECK:STDOUT: %.loc42_3: i32* = address_of %.loc42_7
// CHECK:STDOUT: %.loc42_5: bool = bool_literal true
// CHECK:STDOUT: %.loc42_10.1: bool = bool_literal false
// CHECK:STDOUT: if %.loc42_5 br !and.rhs else br !and.result(%.loc42_10.1)
// CHECK:STDOUT:
// CHECK:STDOUT: !and.rhs:
// CHECK:STDOUT: %.loc42_14: bool = bool_literal false
// CHECK:STDOUT: br !and.result(%.loc42_14)
// CHECK:STDOUT:
// CHECK:STDOUT: !and.result:
// CHECK:STDOUT: %.loc42_10.2: bool = block_arg !and.result
// CHECK:STDOUT: %.loc42_3: bool* = address_of %.loc42_10.2
// CHECK:STDOUT: %H.ref: <function> = name_ref H, file.%H
// CHECK:STDOUT: %.loc46_5.1: init {.a: i32} = call %H.ref()
// CHECK:STDOUT: %.loc46_5.2: ref {.a: i32} = temporary_storage