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.hpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/mir/mir.hpp b/src/mir/mir.hpp
index c0c94807..c0ee0d21 100644
--- a/src/mir/mir.hpp
+++ b/src/mir/mir.hpp
@@ -109,22 +109,28 @@ TAGGED_UNION(RValue, Use,
::HIR::BorrowType type;
LValue val;
}),
+ // Cast on primitives
(Cast, struct {
LValue val;
::HIR::TypeRef type;
}),
+ // Binary operation on primitives
(BinOp, struct {
LValue val_l;
eBinOp op;
LValue val_r;
}),
+ // Unary operation on primitives
(UniOp, struct {
LValue val;
eUniOp op;
}),
+ // Extract the metadata from a DST pointer
+ // NOTE: If used on an array, this yields the array size (for generics)
(DstMeta, struct {
LValue val;
}),
+ // Construct a DST pointer from a thin pointer and metadata
(MakeDst, struct {
LValue ptr_val;
LValue meta_val;
@@ -132,14 +138,17 @@ TAGGED_UNION(RValue, Use,
(Tuple, struct {
::std::vector<LValue> vals;
}),
+ // Array literal
(Array, struct {
::std::vector<LValue> vals;
}),
- //(Variant, struct {
- // ::HIR::GenericPath path;
- // unsigned int index;
- // LValue val;
- // }),
+ // Create a new instance of a union (and eventually enum)
+ (Variant, struct {
+ ::HIR::GenericPath path;
+ unsigned int index;
+ LValue val;
+ }),
+ // Create a new instance of a struct (or enum)
(Struct, struct {
::HIR::GenericPath path;
::std::vector<LValue> vals;