Skip to content
← Back

src/ir/values/not.ghul

1
namespace IR.Values is
2
use TypeTyped = Semantic.Types.Typed
3
use Semantic.Types.Type
4
5
class NOT: Value is
6
value: Value
7
8
type: Type? pure => value.type
9
is_value_type: bool => value.is_value_type
10
11
init(value: Value) is
12
super.init()
13
14
self.value = value
15
si
16
17
gen(context: IR.CONTEXT) is
18
Value.gen(value, context)
19
20
let body = context.current_srm_body_emitter!
21
body.ldc_i4(0)
22
body.op(System.Reflection.Metadata.ILOpCode.CEQ)
23
si
24
25
to_string() -> string =>
26
"not:[{type}]({value})"
27
si
28
si