1 | #include <algorithm> |
---|---|
2 | #include <iostream> |
3 | #include "triton/ir/basic_block.h" |
4 | #include "triton/ir/module.h" |
5 | #include "triton/ir/type.h" |
6 | #include "triton/ir/constant.h" |
7 | #include "triton/ir/function.h" |
8 | |
9 | namespace triton{ |
10 | namespace ir{ |
11 | |
12 | void module::reset_ret_ty(const std::string& name, type* ty) { |
13 | get_function(name)->get_fn_type()->reset_ret_ty(ty); |
14 | } |
15 | |
16 | /* functions */ |
17 | function *module::get_or_insert_function(const std::string &name, function_type *ty) { |
18 | function *&fn = (function*&)symbols_[name]; |
19 | if(fn == nullptr){ |
20 | fn = function::create(ty, global_value::external, name, this); |
21 | } |
22 | return fn; |
23 | } |
24 | |
25 | |
26 | } |
27 | } |
28 |