1 | #pragma once |
---|---|
2 | |
3 | #ifndef _TRITON_IR_CFG_H_ |
4 | #define _TRITON_IR_CFG_H_ |
5 | |
6 | #include <vector> |
7 | #include <functional> |
8 | |
9 | namespace triton{ |
10 | namespace ir{ |
11 | |
12 | class module; |
13 | class function; |
14 | class basic_block; |
15 | class instruction; |
16 | class value; |
17 | |
18 | class cfg { |
19 | public: |
20 | static std::vector<basic_block *> post_order(function* fn); |
21 | static std::vector<basic_block *> reverse_post_order(function* fn); |
22 | }; |
23 | |
24 | void for_each_instruction(ir::module& mod, const std::function<void(triton::ir::instruction*)> &fn); |
25 | void for_each_instruction_backward(module &mod, const std::function<void (instruction *)> &do_work); |
26 | void for_each_value(ir::module& mod, const std::function<void(triton::ir::value *)> &fn); |
27 | |
28 | } |
29 | } |
30 | |
31 | #endif |
32 |