![]() |
PandA-2024.02
|
#include <OrderedInstructions.hpp>
Public Member Functions | |
| OrderedBasicBlock (const blocRef &BasicB) | |
| bool | dominates (const struct gimple_node *A, const struct gimple_node *B) |
Find out whether A dominates B, meaning whether A comes before B in BB. More... | |
Private Member Functions | |
| bool | instComesBefore (const struct gimple_node *A, const struct gimple_node *B) |
Given no cached results, find if A comes before B in BB. More... | |
Private Attributes | |
| CustomMap< const struct gimple_node *, unsigned > | NumberedInsts |
| Map a instruction to its position in a BasicBlock. More... | |
| std::list< tree_nodeRef >::const_iterator | LastInstFound |
Keep track of last instruction inserted into NumberedInsts. More... | |
| unsigned | NextInstPos |
| The position/number to tag the next instruction to be found. More... | |
| const std::list< tree_nodeRef > & | BBInst |
| The source BasicBlock instruction list. More... | |
| const blocRef | BB |
| The source BasicBlock to map. More... | |
Definition at line 57 of file OrderedInstructions.hpp.
|
explicit |
Definition at line 82 of file OrderedInstructions.cpp.
References GET_CONST_NODE, NumberedInsts, and U.
| bool OrderedBasicBlock::dominates | ( | const struct gimple_node * | A, |
| const struct gimple_node * | B | ||
| ) |
Find out whether A dominates B, meaning whether A comes before B in BB.
This is a simplification that considers cached instruction positions and ignores other basic blocks, being only relevant to compare relative instructions positions inside BB. Returns false for A == B.
Definition at line 92 of file OrderedInstructions.cpp.
References BB, gimple_node::bb_index, tree_node::get_kind(), instComesBefore(), NumberedInsts, and THROW_ASSERT.

|
private |
Given no cached results, find if A comes before B in BB.
Cache and number out instruction while walking BB.
Definition at line 52 of file OrderedInstructions.cpp.
References B, BBInst, GET_CONST_NODE, LastInstFound, NextInstPos, NumberedInsts, and THROW_ASSERT.
Referenced by dominates().

|
private |
The source BasicBlock to map.
Definition at line 74 of file OrderedInstructions.hpp.
Referenced by dominates().
|
private |
The source BasicBlock instruction list.
Definition at line 71 of file OrderedInstructions.hpp.
Referenced by instComesBefore().
|
private |
Keep track of last instruction inserted into NumberedInsts.
It speeds up queries for uncached instructions by providing a start point for new queries in OrderedBasicBlock::comesBefore.
Definition at line 65 of file OrderedInstructions.hpp.
Referenced by instComesBefore().
|
private |
The position/number to tag the next instruction to be found.
Definition at line 68 of file OrderedInstructions.hpp.
Referenced by instComesBefore().
|
private |
Map a instruction to its position in a BasicBlock.
Definition at line 60 of file OrderedInstructions.hpp.
Referenced by dominates(), instComesBefore(), and OrderedBasicBlock().
1.8.13