diff options
author | John Hodge <tpg@mutabah.net> | 2016-08-09 23:17:00 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-08-09 23:17:00 +0800 |
commit | 12f999b58b452223b9cf58bc85be3d83bb661e7c (patch) | |
tree | 443b8fbd21e1dc9957387efec030c45a75e3ad47 /src/mir/mir.hpp | |
parent | 772cf236fe8e2634ca40f2399cf0eb31bc0c396a (diff) | |
download | mrust-12f999b58b452223b9cf58bc85be3d83bb661e7c.tar.gz |
MIR - Construction code completed, but untested (and some stubs)
Diffstat (limited to 'src/mir/mir.hpp')
-rw-r--r-- | src/mir/mir.hpp | 18 |
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, |