Skip to content

Commit

Permalink
fix some bugs and remove some unused data
Browse files Browse the repository at this point in the history
  • Loading branch information
bjjwwang committed Apr 9, 2024
1 parent acee7c2 commit 891092f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 35 deletions.
9 changes: 2 additions & 7 deletions svf/include/AE/Svfexe/AbstractInterpretation.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class AbstractInterpretation
*
* @param block basic block that has a series of instructions
*/
void handleWTONode(const ICFGNode* node);
virtual void handleWTONode(const ICFGNode* node);

/**
* handle one instruction in ICFGNode
Expand Down Expand Up @@ -357,7 +357,7 @@ class AbstractInterpretation
Map<const SVFFunction*, ICFGWTO*> _funcToWTO;
Set<const SVFFunction*> _recursiveFuns;

private:
protected:
// helper functions in handleCallSite
virtual bool isExtCall(const CallICFGNode* callNode);
virtual void extCallPass(const CallICFGNode* callNode);
Expand All @@ -368,9 +368,6 @@ class AbstractInterpretation
virtual bool isIndirectCall(const CallICFGNode* callNode);
virtual void indirectCallFunPass(const CallICFGNode* callNode);

// helper functions in hasInEdgesES
bool isFunEntry(const ICFGNode* node);
bool isGlobalEntry(const ICFGNode* node);

// helper functions in handleCycle
bool widenFixpointPass(const ICFGNode* cycle_head,
Expand All @@ -383,8 +380,6 @@ class AbstractInterpretation
Map<std::string, std::function<void(const CallSite &)>> _func_map;
Set<const CallICFGNode*> _checkpoints;
Set<std::string> _checkpoint_names;

private:
Map<const ICFGNode*, AbstractState> _preAbstractTrace;
Map<const ICFGNode*, AbstractState> _postAbstractTrace;
std::string _moduleName;
Expand Down
3 changes: 0 additions & 3 deletions svf/include/AE/Svfexe/SVFIR2AbsState.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,6 @@ class SVFIR2AbsState
SVFIR *_svfir;
AbstractState _es;
RelExeState _relEs;

Map<NodeID, AbstractState*> _br_cond;
AbstractValue getZExtValue(const SVFVar* var, const SVFType*);
};
}

Expand Down
25 changes: 0 additions & 25 deletions svf/lib/AE/Svfexe/AbstractInterpretation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,36 +224,12 @@ bool AbstractInterpretation::propogateAbsStateToCurNode(const ICFGNode *block)
assert(false && "implement this part");
}

bool AbstractInterpretation::isFunEntry(const SVF::ICFGNode *block)
{
if (SVFUtil::isa<FunEntryICFGNode>(block))
{
if (_preAbstractTrace.find(block) != _preAbstractTrace.end())
{
return true;
}
}
return false;
}

bool AbstractInterpretation::isGlobalEntry(const SVF::ICFGNode *block)
{
for (auto *edge : _icfg->getGlobalICFGNode()->getOutEdges())
{
if (edge->getDstNode() == block)
{
return true;
}
}
return false;
}

bool AbstractInterpretation::hasCmpBranchES(const CmpStmt* cmpStmt, s64_t succ,
AbstractState& es)
{
AbstractState new_es = es;
// get cmp stmt's op0, op1, and predicate
NodeID op0 = cmpStmt->getOpVarID(0);
NodeID op1 = cmpStmt->getOpVarID(1);
NodeID res_id = cmpStmt->getResID();
s32_t predicate = cmpStmt->getPredicate();
Expand Down Expand Up @@ -851,7 +827,6 @@ void AbstractInterpretation::handleFunc(const SVFFunction *func)

void AbstractInterpretation::handleSVFStatement(const SVFStmt *stmt)
{
std::cout << stmt->toString() << std::endl;
if (const AddrStmt *addr = SVFUtil::dyn_cast<AddrStmt>(stmt))
{
_svfir2ExeState->handleAddr(addr);
Expand Down

0 comments on commit 891092f

Please sign in to comment.