Skip to content
← Back

src/ir/values/store/indirect.ghul

1
namespace IR.Values.Store is
2
use Semantic.Types.Type
3
4
// Store a value through a managed pointer: the address-providing
5
// LHS evaluates to a `T ref` whose stored value IS the address of
6
// the pointee.
7
class INDIRECT: Value is
8
type: Type
9
address: Value
10
value: Value
11
12
init(
13
address: Value,
14
value: Value,
15
type: Type
16
) is
17
super.init()
18
19
self.address = address
20
self.value = value
21
self.type = type
22
si
23
24
gen(context: IR.CONTEXT) is
25
address.gen(context)
26
value.gen(context)
27
let body = context.current_srm_body_emitter!
28
body.store_object(context.resolve_type_token(type))
29
si
30
31
to_string() -> string =>
32
"store_indirect:[{type}]({address},{value})"
33
si
34
si