#include <SVFLoopAndDomInfo.h>
|
| | SVFLoopAndDomInfo () |
| virtual | ~SVFLoopAndDomInfo () |
| const Map< const SVFBasicBlock *, BBSet > & | getDomFrontierMap () const |
| Map< const SVFBasicBlock *, BBSet > & | getDomFrontierMap () |
| bool | hasLoopInfo (const SVFBasicBlock *bb) const |
| const LoopBBs & | getLoopInfo (const SVFBasicBlock *bb) const |
| const SVFBasicBlock * | getLoopHeader (const LoopBBs &lp) const |
| bool | loopContainsBB (const LoopBBs &lp, const SVFBasicBlock *bb) const |
| void | addToBB2LoopMap (const SVFBasicBlock *bb, const SVFBasicBlock *loopBB) |
| const Map< const SVFBasicBlock *, BBSet > & | getPostDomTreeMap () const |
| Map< const SVFBasicBlock *, BBSet > & | getPostDomTreeMap () |
| const Map< const SVFBasicBlock *, u32_t > & | getBBPDomLevel () const |
| Map< const SVFBasicBlock *, u32_t > & | getBBPDomLevel () |
| const Map< const SVFBasicBlock *, const SVFBasicBlock * > & | getBB2PIdom () const |
| Map< const SVFBasicBlock *, const SVFBasicBlock * > & | getBB2PIdom () |
| Map< const SVFBasicBlock *, BBSet > & | getDomTreeMap () |
| const Map< const SVFBasicBlock *, BBSet > & | getDomTreeMap () const |
| bool | isUnreachable (const SVFBasicBlock *bb) const |
| const BBList & | getReachableBBs () const |
| void | setReachableBBs (BBList &bbs) |
| void | getExitBlocksOfLoop (const SVFBasicBlock *bb, BBList &exitbbs) const |
| bool | isLoopHeader (const SVFBasicBlock *bb) const |
| bool | dominate (const SVFBasicBlock *bbKey, const SVFBasicBlock *bbValue) const |
| bool | postDominate (const SVFBasicBlock *bbKey, const SVFBasicBlock *bbValue) const |
| const SVFBasicBlock * | findNearestCommonPDominator (const SVFBasicBlock *A, const SVFBasicBlock *B) const |
| | find nearest common post dominator of two basic blocks
|
Definition at line 44 of file SVFLoopAndDomInfo.h.
◆ BBList
◆ BBSet
◆ LoopBBs
◆ SVFLoopAndDomInfo()
| SVF::SVFLoopAndDomInfo::SVFLoopAndDomInfo |
( |
| ) |
|
|
inline |
◆ ~SVFLoopAndDomInfo()
| virtual SVF::SVFLoopAndDomInfo::~SVFLoopAndDomInfo |
( |
| ) |
|
|
inlinevirtual |
◆ addToBB2LoopMap()
Definition at line 133 of file SVFLoopAndDomInfo.h.
134 {
136 }
Map< const SVFBasicBlock *, LoopBBs > bb2LoopMap
map a BasicBlock (if it is in a loop) to all the BasicBlocks in this loop
◆ dominate()
Definition at line 103 of file SVFValue.cpp.
104{
105 if (bbKey == bbValue)
106 return true;
107
108
110 {
111 return true;
112 }
113
114
116 {
117 return false;
118 }
119
121 Map<const SVFBasicBlock*,BBSet>::const_iterator mapIter =
dtBBsMap.find(bbKey);
123 {
124 const BBSet & dtBBs = mapIter->second;
125 if (dtBBs.find(bbValue) != dtBBs.end())
126 {
127 return true;
128 }
129 }
130
131 return false;
132}
Map< const SVFBasicBlock *, BBSet > & getDomTreeMap()
Map< const SVFBasicBlock *, BBSet > dtBBsMap
map a BasicBlock to BasicBlocks it Dominates
bool isUnreachable(const SVFBasicBlock *bb) const
Set< const SVFBasicBlock * > BBSet
std::unordered_map< Key, Value, Hash, KeyEqual, Allocator > Map
◆ findNearestCommonPDominator()
find nearest common post dominator of two basic blocks
Definition at line 164 of file SVFValue.cpp.
165{
166 assert(A && B && "Pointers are not valid");
168 "Two blocks are not in same function");
169
170
171
172 while (A != B)
173 {
174
179
180 if (lvA->second < lvB->second) std::swap(A, B);
181
184 A = lvAIdom->second;
185 }
186
187 return A;
188}
const FunObjVar * getParent() const
const Map< const SVFBasicBlock *, u32_t > & getBBPDomLevel() const
const Map< const SVFBasicBlock *, const SVFBasicBlock * > & getBB2PIdom() const
◆ getBB2LoopMap()
◆ getBB2PIdom() [1/2]
Definition at line 163 of file SVFLoopAndDomInfo.h.
164 {
166 }
Map< const SVFBasicBlock *, const SVFBasicBlock * > bb2PIdom
map a BasicBlock to its immediate dominator in pdom tree, used in findNearestCommonPDominator
◆ getBB2PIdom() [2/2]
◆ getBBPDomLevel() [1/2]
Definition at line 153 of file SVFLoopAndDomInfo.h.
154 {
156 }
Map< const SVFBasicBlock *, u32_t > bb2PdomLevel
map a BasicBlock to its level in pdom tree, used in findNearestCommonPDominator
◆ getBBPDomLevel() [2/2]
◆ getDomFrontierMap() [1/2]
Definition at line 110 of file SVFLoopAndDomInfo.h.
111 {
113 }
Map< const SVFBasicBlock *, BBSet > dfBBsMap
map a BasicBlock to its Dominate Frontier BasicBlocks
◆ getDomFrontierMap() [2/2]
◆ getDomTreeMap() [1/2]
◆ getDomTreeMap() [2/2]
◆ getExitBlocksOfLoop()
| void SVFLoopAndDomInfo::getExitBlocksOfLoop |
( |
const SVFBasicBlock * | bb, |
|
|
BBList & | exitbbs ) const |
Definition at line 84 of file SVFValue.cpp.
85{
87 {
89 if (!blocks.empty())
90 {
91 for (const SVFBasicBlock* block : blocks)
92 {
93 for (const SVFBasicBlock* succ : block->getSuccessors())
94 {
95 if ((std::find(blocks.begin(), blocks.end(), succ)==blocks.end()))
96 exitbbs.push_back(succ);
97 }
98 }
99 }
100 }
101}
const LoopBBs & getLoopInfo(const SVFBasicBlock *bb) const
bool hasLoopInfo(const SVFBasicBlock *bb) const
◆ getLoopHeader()
Definition at line 122 of file SVFLoopAndDomInfo.h.
123 {
124 assert(!lp.empty() && "this is not a loop, empty basic block");
125 return lp.front();
126 }
◆ getLoopInfo()
Definition at line 77 of file SVFValue.cpp.
78{
79 assert(
hasLoopInfo(bb) &&
"loopinfo does not exist (bb not in a loop)");
80 Map<const SVFBasicBlock*, LoopBBs>::const_iterator mapIter =
bb2LoopMap.find(bb);
81 return mapIter->second;
82}
◆ getPostDomTreeMap() [1/2]
Definition at line 143 of file SVFLoopAndDomInfo.h.
144 {
146 }
Map< const SVFBasicBlock *, BBSet > pdtBBsMap
map a BasicBlock to BasicBlocks it PostDominates
◆ getPostDomTreeMap() [2/2]
◆ getReachableBBs()
| const BBList & SVF::SVFLoopAndDomInfo::getReachableBBs |
( |
| ) |
const |
|
inline |
Definition at line 185 of file SVFLoopAndDomInfo.h.
186 {
188 }
BBList reachableBBs
reachable BasicBlocks from the function entry.
◆ hasLoopInfo()
| bool SVF::SVFLoopAndDomInfo::hasLoopInfo |
( |
const SVFBasicBlock * | bb | ) |
const |
|
inline |
◆ isLoopHeader()
| bool SVFLoopAndDomInfo::isLoopHeader |
( |
const SVFBasicBlock * | bb | ) |
const |
Definition at line 190 of file SVFValue.cpp.
191{
193 {
195 assert(!blocks.empty() && "no available loop info?");
196 return blocks.front() == bb;
197 }
198 return false;
199}
◆ isUnreachable()
| bool SVF::SVFLoopAndDomInfo::isUnreachable |
( |
const SVFBasicBlock * | bb | ) |
const |
|
inline |
◆ loopContainsBB()
Definition at line 128 of file SVFLoopAndDomInfo.h.
129 {
130 return std::find(lp.begin(), lp.end(), bb) != lp.end();
131 }
◆ postDominate()
Definition at line 134 of file SVFValue.cpp.
135{
136 if (bbKey == bbValue)
137 return true;
138
139
141 {
142 return true;
143 }
144
145
147 {
148 return false;
149 }
150
152 Map<const SVFBasicBlock*,BBSet>::const_iterator mapIter =
dtBBsMap.find(bbKey);
154 {
155 const BBSet & dtBBs = mapIter->second;
156 if (dtBBs.find(bbValue) != dtBBs.end())
157 {
158 return true;
159 }
160 }
161 return false;
162}
const Map< const SVFBasicBlock *, BBSet > & getPostDomTreeMap() const
◆ setBB2LoopMap()
◆ setBB2PdomLevel()
◆ setBB2PIdom()
◆ setDomFrontierMap()
◆ setDomTreeMap()
◆ setPostDomTreeMap()
◆ setReachableBBs()
| void SVF::SVFLoopAndDomInfo::setReachableBBs |
( |
BBList & | bbs | ) |
|
|
inline |
◆ GraphDBClient
| friend class GraphDBClient |
|
friend |
◆ bb2LoopMap
◆ bb2PdomLevel
◆ bb2PIdom
◆ dfBBsMap
◆ dtBBsMap
◆ pdtBBsMap
◆ reachableBBs
| BBList SVF::SVFLoopAndDomInfo::reachableBBs |
|
private |
The documentation for this class was generated from the following files: