Skip to content
← Back

src/ir/values/load/temp.ghul

1
namespace IR.Values.Load is
2
use TypeTyped = Semantic.Types.Typed
3
use Semantic.Types.Type
4
5
class TEMP: Value, TypeTyped is
6
name: string
7
8
type: Type
9
10
has_address: bool => true
11
is_lightweight_pure: bool => true
12
13
init(name: string, type: Type) is
14
self.name = name
15
self.type = type
16
si
17
18
gen(context: IR.CONTEXT) is
19
let body = context.current_srm_body_emitter!
20
body.ldloc(name)
21
si
22
23
gen_address(context: IR.CONTEXT) is
24
let body = context.current_srm_body_emitter!
25
body.ldloca(name)
26
si
27
28
to_string() -> string =>
29
"load:[{type}]({name}\")"
30
si
31
si