Skip to content

Commit

Permalink
Update svflib
Browse files Browse the repository at this point in the history
  • Loading branch information
yuleisui committed Jan 8, 2025
1 parent bce50a4 commit 1e90026
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 4 deletions.
Binary file modified SVF-osx/Release-build/bin/ae
Binary file not shown.
Binary file modified SVF-osx/Release-build/bin/cfl
Binary file not shown.
Binary file modified SVF-osx/Release-build/bin/dvf
Binary file not shown.
Binary file modified SVF-osx/Release-build/bin/llvm2svf
Binary file not shown.
Binary file modified SVF-osx/Release-build/bin/mta
Binary file not shown.
Binary file modified SVF-osx/Release-build/bin/saber
Binary file not shown.
Binary file modified SVF-osx/Release-build/bin/svf-ex
Binary file not shown.
Binary file modified SVF-osx/Release-build/bin/wpa
Binary file not shown.
35 changes: 35 additions & 0 deletions SVF-osx/Release-build/include/SVF-LLVM/LLVMUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,41 @@ inline bool isCallSite(const Value* val)
return SVFUtil::isa<CallBase>(val);
}

inline double getDoubleValue(const ConstantFP* fpValue)
{
double dval = 0;
if (fpValue->isNormalFP())
{
const llvm::fltSemantics& semantics = fpValue->getValueAPF().getSemantics();
if (&semantics == &llvm::APFloat::IEEEhalf() ||
&semantics == &llvm::APFloat::IEEEsingle() ||
&semantics == &llvm::APFloat::IEEEdouble() ||
&semantics == &llvm::APFloat::IEEEquad() ||
&semantics == &llvm::APFloat::x87DoubleExtended())
{
dval = fpValue->getValueAPF().convertToDouble();
}
else
{
assert (false && "Unsupported floating point type");
abort();
}
}
else
{
// other cfp type, like isZero(), isInfinity(), isNegative(), etc.
// do nothing
}
return dval;
}

inline std::pair<s64_t, u64_t> getIntegerValue(const ConstantInt* intValue)
{
if (intValue->getBitWidth() <= 64 && intValue->getBitWidth() >= 1)
return std::make_pair(intValue->getSExtValue(), intValue->getZExtValue());
else
return std::make_pair(0,0);
}

/// Return LLVM callsite given a value
inline const CallBase* getLLVMCallSite(const Value* value)
Expand Down
8 changes: 4 additions & 4 deletions SVF-osx/Release-build/include/SVFIR/SVFIR.h
Original file line number Diff line number Diff line change
Expand Up @@ -585,10 +585,10 @@ class SVFIR : public IRGraph
return addNode(node, i);
}

inline NodeID addConstantIntValNode(const SVFValue* curInst, s64_t sval, u64_t zval, const NodeID i,
inline NodeID addConstantIntValNode(const SVFValue* curInst, const std::pair<s64_t, u64_t>& intValue, const NodeID i,
const ICFGNode* icfgNode)
{
SVFVar* node = new ConstantIntValVar(curInst, sval, zval, i, icfgNode);
SVFVar* node = new ConstantIntValVar(curInst, intValue.first, intValue.second, i, icfgNode);
return addNode(node, i);
}

Expand Down Expand Up @@ -656,13 +656,13 @@ class SVFIR : public IRGraph
}


inline NodeID addConstantIntObjNode(const SVFValue* curInst, s64_t sval, u64_t zval, const NodeID i)
inline NodeID addConstantIntObjNode(const SVFValue* curInst, const std::pair<s64_t, u64_t>& intValue, const NodeID i)
{
const MemObj* mem = getMemObj(curInst);
NodeID base = mem->getId();
memToFieldsMap[base].set(mem->getId());
ConstantIntObjVar* node =
new ConstantIntObjVar(curInst, sval, zval, mem->getId(), mem);
new ConstantIntObjVar(curInst, intValue.first, intValue.second, mem->getId(), mem);
return addObjNode(curInst, node, mem->getId());
}

Expand Down
Binary file modified SVF-osx/Release-build/lib/libSvfCore.a
Binary file not shown.
Binary file modified SVF-osx/Release-build/lib/libSvfLLVM.a
Binary file not shown.

0 comments on commit 1e90026

Please sign in to comment.