Skip to content
← Back

src/ir/values/call/global.ghul

1
namespace IR.Values.Call is
2
use TypeTyped = Semantic.Types.Typed
3
use Semantic.Types.Type
4
5
class GLOBAL: Value, TypeTyped is
6
is_state_changing_call: bool => !function.is_store_free
7
function: Semantic.Symbols.Function
8
arguments: Collections.List[Value]
9
type: Type
10
11
init(function: Semantic.Symbols.Function, arguments: Collections.List[Value], type: Type?) is
12
super.init()
13
14
self.function = function
15
self.arguments = arguments
16
17
if type? then
18
self.type = type
19
else
20
self.type = function.return_type!
21
fi
22
23
si
24
25
accept(visitor: Visitor) is
26
visitor.visit(self)
27
si
28
29
to_string() -> string =>
30
"global-call:[{type}](\"{function.name}\",{arguments})"
31
si
32
si