diff options
| author | gingerBill <bill@gingerbill.org> | 2021-03-23 23:34:01 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-03-23 23:34:01 +0000 |
| commit | fc1a352285bab119752ff32edd44f8fe4260c352 (patch) | |
| tree | d080e93bef2c4011a8ce7f37d185acc27e71494f /src/llvm_backend.cpp | |
| parent | 082381284c36c605431d023ed9ae797678d65731 (diff) | |
For `bit_set`, allow `+` and `-` to be aliases for `|` and `&~`, respectively
Diffstat (limited to 'src/llvm_backend.cpp')
| -rw-r--r-- | src/llvm_backend.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/llvm_backend.cpp b/src/llvm_backend.cpp index acb60a88e..736af41c1 100644 --- a/src/llvm_backend.cpp +++ b/src/llvm_backend.cpp @@ -6311,6 +6311,13 @@ handle_op: lbValue res = {}; res.type = type; + // 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_Add: |