For bit_set, allow + and - to be aliases for | and &~, respectively

This commit is contained in:
gingerBill
2021-03-23 23:34:01 +00:00
parent 082381284c
commit fc1a352285
3 changed files with 31 additions and 2 deletions
+9
View File
@@ -4621,6 +4621,15 @@ irValue *ir_emit_arith(irProcedure *proc, TokenKind op, irValue *left, irValue *
}
handle_op:
// NOTE(bill): Bit Set Aliases for + and -
if (is_type_bit_set(type)) {
switch (op) {
case Token_Add: op = Token_Or; break;
case Token_Sub: op = Token_AndNot; break;
}
}
switch (op) {
case Token_Shl:
{