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
context.write_line("ldloc {name}");
20
si
21
22
gen_address(context: IR.CONTEXT) is
23
context.write_line("ldloca {name}");
24
si
25
26
to_string() -> string =>
27
"load:[{type}]({name}\")";
28
si
29
si