summaryrefslogtreecommitdiff
path: root/src/mir/mir.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mir/mir.hpp')
-rw-r--r--src/mir/mir.hpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/mir/mir.hpp b/src/mir/mir.hpp
index 750a1ec9..59e2b316 100644
--- a/src/mir/mir.hpp
+++ b/src/mir/mir.hpp
@@ -17,7 +17,7 @@ typedef unsigned int RegionId;
typedef unsigned int BasicBlockId;
// "LVALUE" - Assignable values
-TAGGED_UNION(LValue, Variable,
+TAGGED_UNION_EX(LValue, (), Variable, (
// User-named variable
(Variable, unsigned int),
// Temporary with no user-defined name
@@ -36,13 +36,22 @@ TAGGED_UNION(LValue, Variable,
::std::unique_ptr<LValue> val;
unsigned int field_index;
}),
+ // Dereference a value
(Deref, struct {
::std::unique_ptr<LValue> val;
}),
+ // Index an array or slice (typeof(val) == [T; n] or [T])
+ (Index, struct {
+ ::std::unique_ptr<LValue> val;
+ ::std::unique_ptr<LValue> idx;
+ }),
(Downcast, struct {
::std::unique_ptr<LValue> val;
unsigned int variant_index;
})
+ ), (),(), (
+ LValue clone() const;
+ )
);
enum class eBinOp
@@ -53,6 +62,13 @@ enum class eBinOp
DIV, DIV_OV,
MOD, MOD_OV,
+ BIT_OR,
+ BIT_AND,
+ BIT_XOR,
+
+ BIT_SHR,
+ BIT_SHL,
+
EQ, NE,
GT, GE,
LT, LE,