svf-lib 1.0.2175 → 1.0.2176

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -52,6 +52,41 @@ inline bool isCallSite(const Value* val)
52
52
  return SVFUtil::isa<CallBase>(val);
53
53
  }
54
54
 
55
+ inline double getDoubleValue(const ConstantFP* fpValue)
56
+ {
57
+ double dval = 0;
58
+ if (fpValue->isNormalFP())
59
+ {
60
+ const llvm::fltSemantics& semantics = fpValue->getValueAPF().getSemantics();
61
+ if (&semantics == &llvm::APFloat::IEEEhalf() ||
62
+ &semantics == &llvm::APFloat::IEEEsingle() ||
63
+ &semantics == &llvm::APFloat::IEEEdouble() ||
64
+ &semantics == &llvm::APFloat::IEEEquad() ||
65
+ &semantics == &llvm::APFloat::x87DoubleExtended())
66
+ {
67
+ dval = fpValue->getValueAPF().convertToDouble();
68
+ }
69
+ else
70
+ {
71
+ assert (false && "Unsupported floating point type");
72
+ abort();
73
+ }
74
+ }
75
+ else
76
+ {
77
+ // other cfp type, like isZero(), isInfinity(), isNegative(), etc.
78
+ // do nothing
79
+ }
80
+ return dval;
81
+ }
82
+
83
+ inline std::pair<s64_t, u64_t> getIntegerValue(const ConstantInt* intValue)
84
+ {
85
+ if (intValue->getBitWidth() <= 64 && intValue->getBitWidth() >= 1)
86
+ return std::make_pair(intValue->getSExtValue(), intValue->getZExtValue());
87
+ else
88
+ return std::make_pair(0,0);
89
+ }
55
90
 
56
91
  /// Return LLVM callsite given a value
57
92
  inline const CallBase* getLLVMCallSite(const Value* value)
@@ -585,10 +585,10 @@ private:
585
585
  return addNode(node, i);
586
586
  }
587
587
 
588
- inline NodeID addConstantIntValNode(const SVFValue* curInst, s64_t sval, u64_t zval, const NodeID i,
588
+ inline NodeID addConstantIntValNode(const SVFValue* curInst, const std::pair<s64_t, u64_t>& intValue, const NodeID i,
589
589
  const ICFGNode* icfgNode)
590
590
  {
591
- SVFVar* node = new ConstantIntValVar(curInst, sval, zval, i, icfgNode);
591
+ SVFVar* node = new ConstantIntValVar(curInst, intValue.first, intValue.second, i, icfgNode);
592
592
  return addNode(node, i);
593
593
  }
594
594
 
@@ -656,13 +656,13 @@ private:
656
656
  }
657
657
 
658
658
 
659
- inline NodeID addConstantIntObjNode(const SVFValue* curInst, s64_t sval, u64_t zval, const NodeID i)
659
+ inline NodeID addConstantIntObjNode(const SVFValue* curInst, const std::pair<s64_t, u64_t>& intValue, const NodeID i)
660
660
  {
661
661
  const MemObj* mem = getMemObj(curInst);
662
662
  NodeID base = mem->getId();
663
663
  memToFieldsMap[base].set(mem->getId());
664
664
  ConstantIntObjVar* node =
665
- new ConstantIntObjVar(curInst, sval, zval, mem->getId(), mem);
665
+ new ConstantIntObjVar(curInst, intValue.first, intValue.second, mem->getId(), mem);
666
666
  return addObjNode(curInst, node, mem->getId());
667
667
  }
668
668
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.2175",
3
+ "version": "1.0.2176",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {