Commit Graph

12 Commits

Author SHA1 Message Date
Timm Bäder ce4d5ae9dc [clang][Interp] Implement bitwise Or operations
Analogous to the bitAnd implementation, do the same for bitwise or.

Differential Revision: https://reviews.llvm.org/D135361
2022-10-14 14:15:08 +02:00
Timm Bäder 62a58050ba [clang][Interp] Implement bitwise and operations
Differential Revision: https://reviews.llvm.org/D135012
2022-10-14 14:00:07 +02:00
Timm Bäder 77aaf469a7 [clang][Interp] Implement ConditionalOperators
Differential Revision: https://reviews.llvm.org/D134801
2022-10-14 13:16:10 +02:00
Timm Bäder d704ba26b9 [clang][Interp] Implement div opcode
Implement an opcode for division of two integrals.

Differential Revision: https://reviews.llvm.org/D134749
2022-10-14 12:57:57 +02:00
Timm Bäder c9ad877844 [clang][Interp] Implement rem opcode
Implement an opcode to get the remainder of the divison between LHS and
RHS.

Differential Revision: https://reviews.llvm.org/D134744
2022-10-14 12:57:57 +02:00
Timm Bäder 542123465f [clang][Interp] Implement bitwise not operations
Differential Revision: https://reviews.llvm.org/D134804
2022-10-14 12:57:57 +02:00
Timm Bäder ee2e414d66 [clang][Interp] Handle sizeof()
Implement visiting UnaryExprOrTypeTraitExprs to handle sizeof()
expressions.

Differential Revision: https://reviews.llvm.org/D133934
2022-09-29 12:50:55 +02:00
Timm Bäder 95e6a407d9 [clang][Interp] Implement IntegralToBoolean casts
Redo how we do IntegralCasts and implement IntegralToBoolean casts using
the already existing cast op.

Differential Revision: https://reviews.llvm.org/D132739
2022-09-08 07:31:07 +02:00
Timm Bäder 5777c05d16 [clang] Perform implicit lvalue-to-rvalue cast with new interpreter
The EvaluateAsRValue() documentation mentions that an implicit
lvalue-to-rvalue cast is being performed if the result is an lvalue.
However, that was not being done if the new constant interpreter was in
use.

Just always do it.

Differential Revision: https://reviews.llvm.org/D132136
2022-09-08 07:31:07 +02:00
Timm Bäder fdfc0dfa8e [clang][Interp] Implement pointer (de)ref operators
Implement pointer references, dereferences and assignments.

Differential Revision: https://reviews.llvm.org/D132111
2022-08-25 14:20:32 +02:00
Timm Bäder 80bbc05436 [clang][Interp] Implement inv and neg unary operations
Implement negating and inverting values. Also implement
IntegralToBoolean casts so the operations are easier to test.

Differential Revision: https://reviews.llvm.org/D132098
2022-08-19 16:05:00 +02:00
Timm Bäder a2a5470fc2 [clang][Interp] Implement boolean and nullptr literals
Handle CXX bool literals as well as nullptr literals and add a few tests
for each.

Differential Revision: https://reviews.llvm.org/D131942
2022-08-18 07:11:48 +02:00