Skip to content

Commit

Permalink
SVF code formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
yuleisui committed Jan 8, 2025
1 parent a5cd486 commit f7e561e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
14 changes: 8 additions & 6 deletions svf-llvm/include/SVF-LLVM/LLVMUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,17 @@ inline bool isCallSite(const Value* val)
return SVFUtil::isa<CallBase>(val);
}

inline double getDoubleValue(const ConstantFP* fpValue) {
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())
&semantics == &llvm::APFloat::IEEEsingle() ||
&semantics == &llvm::APFloat::IEEEdouble() ||
&semantics == &llvm::APFloat::IEEEquad() ||
&semantics == &llvm::APFloat::x87DoubleExtended())
{
dval = fpValue->getValueAPF().convertToDouble();
}
Expand All @@ -79,7 +80,8 @@ inline double getDoubleValue(const ConstantFP* fpValue) {
return dval;
}

inline std::pair<s64_t, u64_t> getIntegerValue(const ConstantInt* intValue) {
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
Expand Down
3 changes: 2 additions & 1 deletion svf/include/SVFIR/SVFIR.h
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,8 @@ class SVFIR : public IRGraph
}


inline NodeID addConstantIntObjNode(const SVFValue* curInst, const std::pair<s64_t, u64_t>& intValue, 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());
Expand Down

0 comments on commit f7e561e

Please sign in to comment.