Skip to content
← Back

src/ir/values/isa.ghul

1
namespace IR.Values is
2
use Semantic.Types.Type;
3
4
class ISA: Value is
5
type: Type;
6
isa_type: Type;
7
value: Value;
8
9
init(
10
type: Type,
11
isa_type: Type,
12
value: Value
13
) is
14
super.init();
15
16
self.type = type;
17
self.isa_type = isa_type;
18
self.value = value;
19
si
20
21
gen(context: IR.CONTEXT) is
22
gen(value, context);
23
24
context.write_line("isinst {isa_type.get_il_type()}");
25
context.write_line("ldnull");
26
context.write_line("cgt.un");
27
si
28
29
to_string() -> string =>
30
"isa:[{isa_type}]({value})";
31
si
32
si