Skip to content

Commit

Permalink
SVF code formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
yuleisui committed Oct 9, 2024
1 parent 905d5fe commit 6ac0415
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
12 changes: 6 additions & 6 deletions svf-llvm/lib/ICFGBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,14 +251,14 @@ InterICFGNode* ICFGBuilder::addInterBlockICFGNode(const Instruction* inst)
else
{
calledFunc = SVFUtil::dyn_cast<SVFFunction>(
llvmModuleSet()->getSVFValue(called_llvmval));
llvmModuleSet()->getSVFValue(called_llvmval));
}

CallICFGNode* callICFGNode = icfg->addCallICFGNode(
svfInst->getParent(), llvmModuleSet()->getSVFType(inst->getType()),
calledFunc, cb->getFunctionType()->isVarArg(), isvcall,
isvcall ? cppUtil::getVCallIdx(cb) : 0,
isvcall ? cppUtil::getFunNameOfVCallSite(cb) : "");
svfInst->getParent(), llvmModuleSet()->getSVFType(inst->getType()),
calledFunc, cb->getFunctionType()->isVarArg(), isvcall,
isvcall ? cppUtil::getVCallIdx(cb) : 0,
isvcall ? cppUtil::getFunNameOfVCallSite(cb) : "");
csToCallNodeMap()[inst] = callICFGNode;
llvmModuleSet()->setValueAttr(inst, callICFGNode);

Expand Down Expand Up @@ -348,7 +348,7 @@ IntraICFGNode* ICFGBuilder::addIntraBlockICFGNode(const Instruction* inst)
IntraICFGNode* node = llvmModuleSet()->getIntraBlock(inst);
assert (node==nullptr && "no IntraICFGNode for this instruction?");
IntraICFGNode* sNode = icfg->addIntraICFGNode(
svfInst->getParent(), SVFUtil::isa<ReturnInst>(inst));
svfInst->getParent(), SVFUtil::isa<ReturnInst>(inst));
instToBlockNodeMap()[inst] = sNode;
llvmModuleSet()->setValueAttr(inst, sNode);
return sNode;
Expand Down
12 changes: 8 additions & 4 deletions svf/include/Graphs/ICFG.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ class ICFG : public GenericICFGTy
}
}

virtual inline IntraICFGNode* addIntraICFGNode(const SVFBasicBlock* bb, bool isRet) {
virtual inline IntraICFGNode* addIntraICFGNode(const SVFBasicBlock* bb, bool isRet)
{
IntraICFGNode* intraIcfgNode =
new IntraICFGNode(totalICFGNode++, bb, isRet);
addICFGNode(intraIcfgNode);
Expand All @@ -192,20 +193,23 @@ class ICFG : public GenericICFGTy
return callICFGNode;
}

virtual inline RetICFGNode* addRetICFGNode(CallICFGNode* call) {
virtual inline RetICFGNode* addRetICFGNode(CallICFGNode* call)
{
RetICFGNode* retICFGNode = new RetICFGNode(totalICFGNode++, call);
call->setRetICFGNode(retICFGNode);
addICFGNode(retICFGNode);
return retICFGNode;
}

virtual inline FunEntryICFGNode* addFunEntryICFGNode(const SVFFunction* svfFunc) {
virtual inline FunEntryICFGNode* addFunEntryICFGNode(const SVFFunction* svfFunc)
{
FunEntryICFGNode* sNode = new FunEntryICFGNode(totalICFGNode++,svfFunc);
addICFGNode(sNode);
return FunToFunEntryNodeMap[svfFunc] = sNode;
}

virtual inline FunExitICFGNode* addFunExitICFGNode(const SVFFunction* svfFunc) {
virtual inline FunExitICFGNode* addFunExitICFGNode(const SVFFunction* svfFunc)
{
FunExitICFGNode* sNode = new FunExitICFGNode(totalICFGNode++, svfFunc);
addICFGNode(sNode);
return FunToFunExitNodeMap[svfFunc] = sNode;
Expand Down
3 changes: 2 additions & 1 deletion svf/include/Graphs/ICFGNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,8 @@ class CallICFGNode : public InterICFGNode
return isVirCallInst;
}

inline void setVtablePtr(SVFVar* v) {
inline void setVtablePtr(SVFVar* v)
{
vtabPtr = v;
}

Expand Down

0 comments on commit 6ac0415

Please sign in to comment.