mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-15 02:12:22 -07:00
For bit_set, allow + and - to be aliases for | and &~, respectively
This commit is contained in:
@@ -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:
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user