Documentation ¶
Index ¶
- Constants
- func Delete_useless_bbs(full_path []*ssa.BasicBlock) (result []*ssa.BasicBlock)
- func Delete_useless_bbs_locally(full_path []*ssa.BasicBlock) (result []*ssa.BasicBlock)
- func Find_path_by_call_chain(bb1, bb2 *ssa.BasicBlock, call_chain []*mycallgraph.Call_node) ([]*ssa.BasicBlock, error)
- func Find_paths_locally(bb1, bb2 *ssa.BasicBlock) (paths [][]*ssa.BasicBlock, err error)
- func Find_shortest_path_locally(bb1, bb2 *ssa.BasicBlock) (shortest_path []*ssa.BasicBlock, err error)
- func List_all_exe_chain(fn ssa.Function, end_bb *ssa.BasicBlock) (map[int][]*ssa.BasicBlock, error)
- func Post_dominates(pre, post *ssa.BasicBlock) bool
- func Post_dominates_clean()
- func Post_dominates_prepare(fn ssa.Function) error
- type Cond
- type Myerror
Constants ¶
const Max_recursive int = 10000
const Start_length int = 10000
Variables ¶
This section is empty.
Functions ¶
func Delete_useless_bbs ¶
func Delete_useless_bbs(full_path []*ssa.BasicBlock) (result []*ssa.BasicBlock)
func Delete_useless_bbs_locally ¶
func Delete_useless_bbs_locally(full_path []*ssa.BasicBlock) (result []*ssa.BasicBlock)
make sure that all bbs in full_path are of the same fn
func Find_path_by_call_chain ¶
func Find_path_by_call_chain(bb1, bb2 *ssa.BasicBlock, call_chain []*mycallgraph.Call_node) ([]*ssa.BasicBlock, error)
Find_path_by_call_chain can return a slice of basic blocks from bb1 to bb2, depending on a call-chain from bb1 to bb2. This slice is in order and minimum. bb1 and bb2's parents are the head and tail of call-chain
func Find_paths_locally ¶
func Find_paths_locally(bb1, bb2 *ssa.BasicBlock) (paths [][]*ssa.BasicBlock, err error)
can return paths of basic blocks from bb1 to bb2, which are in the same function
func Find_shortest_path_locally ¶
func Find_shortest_path_locally(bb1, bb2 *ssa.BasicBlock) (shortest_path []*ssa.BasicBlock, err error)
Find_shortest_path_locally can return a slice of basic blocks from bb1 to bb2, which are in the same function. This slice is in order and minimum
func List_all_exe_chain ¶
func List_all_exe_chain(fn ssa.Function, end_bb *ssa.BasicBlock) (map[int][]*ssa.BasicBlock, error)
TODO: This function produces many redundant chains during calculation, meaning the algorithm is not efficient;
Every bb can only appear two times in this chain (see function recursive_append_succ)
func Post_dominates ¶
func Post_dominates(pre, post *ssa.BasicBlock) bool
Before using Post_dominates, you should call List_all_exe_chain, and use the result as the second parameter
func Post_dominates_clean ¶
func Post_dominates_clean()
func Post_dominates_prepare ¶
Types ¶
type Cond ¶
func List_cond_of_path ¶
func List_cond_of_path(path []*ssa.BasicBlock, target_bb *ssa.BasicBlock) (result []Cond)