Skip to content

Commit

Permalink
remove CopyStmt::Unknown
Browse files Browse the repository at this point in the history
  • Loading branch information
bjjwwang committed Mar 15, 2024
1 parent 81f2d76 commit 70a7b9b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion svf-llvm/include/SVF-LLVM/SVFIRBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ class SVFIRBuilder: public llvm::InstVisitor<SVFIRBuilder>
return CopyStmt::COPYVAL;
}
}
return CopyStmt::UNKNOWN;
assert (false && "Unknown cast inst!");
}

/// Add Copy edge
Expand Down
5 changes: 3 additions & 2 deletions svf-llvm/lib/LLVMModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1271,10 +1271,11 @@ SVFConstantData* LLVMModuleSet::getSVFConstantData(const ConstantData* cd)
dval = cfp->getValueAPF().convertToDouble();
}
else {

assert (false && "Unsupported floating point type");
}
} else {

// other cfp type, like isZero(), isInfinity(), isNegative(), etc.
// do nothing
}
svfcd = new SVFConstantFP(getSVFType(cd->getType()), dval);
}
Expand Down
2 changes: 1 addition & 1 deletion svf/include/SVFIR/SVFStatements.h
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ class CopyStmt: public AssignStmt
void operator=(const CopyStmt&); ///< place holder
public:
enum CopyKind {COPYVAL, ZEXT, SEXT, BITCAST, TRUNC, FPTRUNC,
FPTOUI, FPTOSI, UITOFP, SITOFP, INTTOPTR, PTRTOINT, UNKNOWN};
FPTOUI, FPTOSI, UITOFP, SITOFP, INTTOPTR, PTRTOINT};
/// Methods for support type inquiry through isa, cast, and dyn_cast:
//@{
static inline bool classof(const CopyStmt*)
Expand Down
6 changes: 3 additions & 3 deletions svf/lib/AE/Svfexe/SVFIR2ItvExeState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,9 @@ void SVFIR2ItvExeState::translateCopy(const CopyStmt *copy)
{
if (inVarToValTable(rhs))
{
_es[lhs] = _es[rhs];
if (copy->getCopyKind() == CopyStmt::COPYVAL) {
_es[lhs] = _es[rhs];
}
if (copy->getCopyKind() == CopyStmt::ZEXT) {
_es[lhs] = getZExtValue(copy->getRHSVar());
}
Expand All @@ -984,8 +986,6 @@ void SVFIR2ItvExeState::translateCopy(const CopyStmt *copy)
else if (copy->getCopyKind() == CopyStmt::FPTRUNC) {
_es[lhs] = getFPTruncValue(copy->getRHSVar(), copy->getLHSVar()->getType());
}


}
else if (inVarToAddrsTable(rhs))
{
Expand Down
3 changes: 0 additions & 3 deletions svf/lib/SVFIR/PAGBuilderFromFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,6 @@ void PAGBuilderFromFile::addEdge(NodeID srcID, NodeID dstID,
else if (opType == "PTRTOINT") {
pag->addCopyStmt(srcID, dstID, CopyStmt::PTRTOINT);
}
else if (opType == "UNKNOWN") {
pag->addCopyStmt(srcID, dstID, CopyStmt::UNKNOWN);
}
else {
assert(false && "format not support, can not create such edge");
}
Expand Down

0 comments on commit 70a7b9b

Please sign in to comment.