6 using namespace SVFUtil;
11 fldIdxVec.push_back(fldIdx);
12 elemIdxVec.push_back(elemIdx);
13 fldIdx2TypeMap[fldIdx] =
type;
23 if(it!=fldIdx2TypeMap.end())
30 assert(hasLoopInfo(bb) &&
"loopinfo does not exist (bb not in a loop)");
32 return mapIter->second;
39 const LoopBBs blocks = getLoopInfo(bb);
46 if ((std::find(blocks.begin(), blocks.end(), succ)==blocks.end()))
47 exitbbs.push_back(succ);
60 if (isUnreachable(bbValue))
66 if (isUnreachable(bbKey))
73 if (mapIter != dtBBsMap.end())
75 const BBSet & dtBBs = mapIter->second;
76 if (dtBBs.find(bbValue) != dtBBs.end())
91 if (isUnreachable(bbValue))
97 if (isUnreachable(bbKey))
104 if (mapIter != dtBBsMap.end())
106 const BBSet & dtBBs = mapIter->second;
107 if (dtBBs.find(bbValue) != dtBBs.end())
117 assert(A && B &&
"Pointers are not valid");
119 "Two blocks are not in same function");
127 const auto lvA = getBBPDomLevel().find(A);
128 const auto lvB = getBBPDomLevel().find(B);
129 assert(lvA != getBBPDomLevel().end() && lvB != getBBPDomLevel().end());
131 if (lvA->second < lvB->second) std::swap(A, B);
133 const auto lvAIdom = getBB2PIdom().find(A);
134 assert(lvAIdom != getBB2PIdom().end());
145 const LoopBBs& blocks = getLoopInfo(bb);
146 assert(!blocks.empty() &&
"no available loop info?");
147 return blocks.front() == bb;
153 bool declare,
bool intrinsic,
bool adt,
bool varg,
156 addrTaken(adt), isUncalled(
false), isNotRet(
false), varArg(varg),
157 funcType(ft), loopAndDom(ld), realDefFun(nullptr), exitBlock(nullptr)
177 assert (idx <
allArgs.size() &&
"getArg() out of range!");
188 assert(
hasBasicBlock() &&
"function does not have any Basicblock, external function?");
189 assert(
exitBlock &&
"must have an exitBlock");
195 assert(!
exitBlock &&
"have already set exit Basicblock!");
221 assert(
false &&
"Didn't find successor edge?");
234 assert(
false &&
"Didn't find successor edge?");
250 assert(
false &&
"Didn't find predecessor edge?");
262 assert(
false &&
"Didn't find predecessor edge?");
268 :
SVFValue(ty, k), bb(
b), terminator(tm), ret(isRet)
275 assert(
"SVFValue::toString should be implemented or supported by fronted" &&
false);
282 assert(
"SVFBaseNode::valueOnlyToString should be implemented or supported by fronted" &&
false);
const std::string valueOnlyToString() const
u32_t getBBPredecessorPos(const SVFBasicBlock *succbb)
const std::vector< const SVFBasicBlock * > & getSuccessors() const
std::vector< const SVFBasicBlock * > succBBs
all successor BasicBlocks of this BasicBlock
u32_t getBBSuccessorPos(const SVFBasicBlock *succbb)
~SVFBasicBlock() override
const std::vector< const SVFBasicBlock * > & getPredecessors() const
const SVFFunction * getParent() const
const SVFArgument * getArg(u32_t idx) const
bool varArg
return true if this function never returns
SVFBasicBlock * exitBlock
all formal arguments of this function
std::vector< const SVFArgument * > allArgs
all BasicBlocks of this function
bool hasBasicBlock() const
std::vector< const SVFBasicBlock * > allBBs
the definition of a function across multiple modules
void setExitBlock(SVFBasicBlock *bb)
const SVFBasicBlock * getExitBB() const
SVFLoopAndDomInfo * loopAndDom
FunctionType, which is different from the type (PointerType) of this SVFFunction.
SVFInstruction(void)=delete
const LoopBBs & getLoopInfo(const SVFBasicBlock *bb) const
std::vector< const SVFBasicBlock * > BBList
bool dominate(const SVFBasicBlock *bbKey, const SVFBasicBlock *bbValue) const
bool isLoopHeader(const SVFBasicBlock *bb) const
void getExitBlocksOfLoop(const SVFBasicBlock *bb, BBList &exitbbs) const
const SVFBasicBlock * findNearestCommonPDominator(const SVFBasicBlock *A, const SVFBasicBlock *B) const
find nearest common post dominator of two basic blocks
Set< const SVFBasicBlock * > BBSet
bool postDominate(const SVFBasicBlock *bbKey, const SVFBasicBlock *bbValue) const
std::string toString() const
Needs to be implemented by a SVF front end.
const SVFType * getOriginalElemType(u32_t fldIdx) const
void addFldWithType(u32_t fldIdx, const SVFType *type, u32_t elemIdx)
Add field index and element index and their corresponding type.
__attribute__((weak)) std
std::unordered_map< Key, Value, Hash, KeyEqual, Allocator > Map