svf-lib 1.0.992 → 1.0.995

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.
Files changed (140) hide show
  1. package/SVF-linux/Release-build/lib/libSvf.a +0 -0
  2. package/SVF-linux/include/CFL/CFGNormalizer.h +6 -3
  3. package/SVF-linux/include/CFL/CFLAlias.h +26 -15
  4. package/SVF-linux/include/CFL/CFLGrammar.h +30 -16
  5. package/SVF-linux/include/CFL/CFLSolver.h +9 -5
  6. package/SVF-linux/include/CFL/GrammarBuilder.h +10 -7
  7. package/SVF-linux/include/CUDD/cudd.h +20 -11
  8. package/SVF-linux/include/CUDD/cuddInt.h +48 -31
  9. package/SVF-linux/include/CUDD/epd.h +35 -29
  10. package/SVF-linux/include/CUDD/mtr.h +4 -3
  11. package/SVF-linux/include/CUDD/st.h +7 -4
  12. package/SVF-linux/include/CUDD/util.h +6 -6
  13. package/SVF-linux/include/FastCluster/fastcluster.h +13 -12
  14. package/SVF-linux/include/Graphs/CFLGraph.h +16 -10
  15. package/SVF-linux/include/Graphs/CHG.h +2 -2
  16. package/SVF-linux/include/Graphs/ConsG.h +2 -1
  17. package/SVF-linux/include/Graphs/GenericGraph.h +3 -3
  18. package/SVF-linux/include/Graphs/ICFG.h +2 -2
  19. package/SVF-linux/include/Graphs/ICFGEdge.h +16 -9
  20. package/SVF-linux/include/Graphs/ICFGNode.h +2 -2
  21. package/SVF-linux/include/Graphs/IRGraph.h +10 -6
  22. package/SVF-linux/include/Graphs/PTACallGraph.h +1 -1
  23. package/SVF-linux/include/Graphs/SVFG.h +4 -3
  24. package/SVF-linux/include/Graphs/SVFGNode.h +14 -8
  25. package/SVF-linux/include/Graphs/ThreadCallGraph.h +4 -2
  26. package/SVF-linux/include/Graphs/VFG.h +45 -39
  27. package/SVF-linux/include/Graphs/VFGNode.h +8 -4
  28. package/SVF-linux/include/MSSA/MemSSA.h +1 -1
  29. package/SVF-linux/include/MTA/FSMPTA.h +55 -44
  30. package/SVF-linux/include/MTA/LockAnalysis.h +11 -9
  31. package/SVF-linux/include/MTA/LockResultValidator.h +64 -54
  32. package/SVF-linux/include/MTA/MHP.h +17 -13
  33. package/SVF-linux/include/MTA/MTAResultValidator.h +24 -20
  34. package/SVF-linux/include/MTA/PCG.h +9 -7
  35. package/SVF-linux/include/MTA/TCT.h +27 -22
  36. package/SVF-linux/include/MemoryModel/LocationSet.h +5 -3
  37. package/SVF-linux/include/MemoryModel/PersistentPointsToCache.h +28 -13
  38. package/SVF-linux/include/MemoryModel/PersistentPointsToDS.h +2 -2
  39. package/SVF-linux/include/MemoryModel/PointerAnalysis.h +5 -4
  40. package/SVF-linux/include/MemoryModel/PointsTo.h +8 -2
  41. package/SVF-linux/include/MemoryModel/SVFIR.h +6 -5
  42. package/SVF-linux/include/MemoryModel/SVFStatements.h +65 -45
  43. package/SVF-linux/include/MemoryModel/SVFVariables.h +6 -5
  44. package/SVF-linux/include/MemoryModel/SymbolTableInfo.h +18 -15
  45. package/SVF-linux/include/SABER/PathCondAllocator.h +14 -7
  46. package/SVF-linux/include/SABER/ProgSlice.h +2 -1
  47. package/SVF-linux/include/SABER/SaberSVFGBuilder.h +1 -1
  48. package/SVF-linux/include/SABER/SrcSnkDDA.h +8 -4
  49. package/SVF-linux/include/SVF-FE/CHGBuilder.h +4 -2
  50. package/SVF-linux/include/SVF-FE/DataFlowUtil.h +10 -9
  51. package/SVF-linux/include/SVF-FE/IRAnnotator.h +8 -8
  52. package/SVF-linux/include/SVF-FE/LLVMModule.h +13 -12
  53. package/SVF-linux/include/SVF-FE/LLVMUtil.h +4 -4
  54. package/SVF-linux/include/SVF-FE/SVFIRBuilder.h +13 -9
  55. package/SVF-linux/include/SVF-FE/SymbolTableBuilder.h +3 -2
  56. package/SVF-linux/include/Util/BDDExpr.h +32 -16
  57. package/SVF-linux/include/Util/BasicTypes.h +77 -25
  58. package/SVF-linux/include/Util/CoreBitVector.h +2 -1
  59. package/SVF-linux/include/Util/CxtStmt.h +37 -27
  60. package/SVF-linux/include/Util/ExeState.h +42 -22
  61. package/SVF-linux/include/Util/ExtAPI.h +1 -1
  62. package/SVF-linux/include/Util/NodeIDAllocator.h +7 -4
  63. package/SVF-linux/include/Util/Options.h +3 -3
  64. package/SVF-linux/include/Util/SVFBasicTypes.h +49 -40
  65. package/SVF-linux/include/Util/SVFModule.h +5 -5
  66. package/SVF-linux/include/Util/SVFUtil.h +12 -9
  67. package/SVF-linux/include/Util/Z3Expr.h +191 -144
  68. package/SVF-linux/include/WPA/Andersen.h +11 -11
  69. package/SVF-linux/include/WPA/VersionedFlowSensitive.h +4 -1
  70. package/SVF-osx/Release-build/lib/CUDD/libCudd.a +0 -0
  71. package/SVF-osx/Release-build/lib/libSvf.a +0 -0
  72. package/SVF-osx/include/CFL/CFGNormalizer.h +6 -3
  73. package/SVF-osx/include/CFL/CFLAlias.h +26 -15
  74. package/SVF-osx/include/CFL/CFLGrammar.h +30 -16
  75. package/SVF-osx/include/CFL/CFLSolver.h +9 -5
  76. package/SVF-osx/include/CFL/GrammarBuilder.h +10 -7
  77. package/SVF-osx/include/CUDD/cudd.h +20 -11
  78. package/SVF-osx/include/CUDD/cuddInt.h +48 -31
  79. package/SVF-osx/include/CUDD/epd.h +35 -29
  80. package/SVF-osx/include/CUDD/mtr.h +4 -3
  81. package/SVF-osx/include/CUDD/st.h +7 -4
  82. package/SVF-osx/include/CUDD/util.h +6 -6
  83. package/SVF-osx/include/FastCluster/fastcluster.h +13 -12
  84. package/SVF-osx/include/Graphs/CFLGraph.h +16 -10
  85. package/SVF-osx/include/Graphs/CHG.h +2 -2
  86. package/SVF-osx/include/Graphs/ConsG.h +2 -1
  87. package/SVF-osx/include/Graphs/GenericGraph.h +3 -3
  88. package/SVF-osx/include/Graphs/ICFG.h +2 -2
  89. package/SVF-osx/include/Graphs/ICFGEdge.h +16 -9
  90. package/SVF-osx/include/Graphs/ICFGNode.h +2 -2
  91. package/SVF-osx/include/Graphs/IRGraph.h +10 -6
  92. package/SVF-osx/include/Graphs/PTACallGraph.h +1 -1
  93. package/SVF-osx/include/Graphs/SVFG.h +4 -3
  94. package/SVF-osx/include/Graphs/SVFGNode.h +14 -8
  95. package/SVF-osx/include/Graphs/ThreadCallGraph.h +4 -2
  96. package/SVF-osx/include/Graphs/VFG.h +45 -39
  97. package/SVF-osx/include/Graphs/VFGNode.h +8 -4
  98. package/SVF-osx/include/MSSA/MemSSA.h +1 -1
  99. package/SVF-osx/include/MTA/FSMPTA.h +55 -44
  100. package/SVF-osx/include/MTA/LockAnalysis.h +11 -9
  101. package/SVF-osx/include/MTA/LockResultValidator.h +64 -54
  102. package/SVF-osx/include/MTA/MHP.h +17 -13
  103. package/SVF-osx/include/MTA/MTAResultValidator.h +24 -20
  104. package/SVF-osx/include/MTA/PCG.h +9 -7
  105. package/SVF-osx/include/MTA/TCT.h +27 -22
  106. package/SVF-osx/include/MemoryModel/LocationSet.h +5 -3
  107. package/SVF-osx/include/MemoryModel/PersistentPointsToCache.h +28 -13
  108. package/SVF-osx/include/MemoryModel/PersistentPointsToDS.h +2 -2
  109. package/SVF-osx/include/MemoryModel/PointerAnalysis.h +5 -4
  110. package/SVF-osx/include/MemoryModel/PointsTo.h +8 -2
  111. package/SVF-osx/include/MemoryModel/SVFIR.h +6 -5
  112. package/SVF-osx/include/MemoryModel/SVFStatements.h +65 -45
  113. package/SVF-osx/include/MemoryModel/SVFVariables.h +6 -5
  114. package/SVF-osx/include/MemoryModel/SymbolTableInfo.h +18 -15
  115. package/SVF-osx/include/SABER/PathCondAllocator.h +14 -7
  116. package/SVF-osx/include/SABER/ProgSlice.h +2 -1
  117. package/SVF-osx/include/SABER/SaberSVFGBuilder.h +1 -1
  118. package/SVF-osx/include/SABER/SrcSnkDDA.h +8 -4
  119. package/SVF-osx/include/SVF-FE/CHGBuilder.h +4 -2
  120. package/SVF-osx/include/SVF-FE/DataFlowUtil.h +10 -9
  121. package/SVF-osx/include/SVF-FE/IRAnnotator.h +8 -8
  122. package/SVF-osx/include/SVF-FE/LLVMModule.h +13 -12
  123. package/SVF-osx/include/SVF-FE/LLVMUtil.h +4 -4
  124. package/SVF-osx/include/SVF-FE/SVFIRBuilder.h +13 -9
  125. package/SVF-osx/include/SVF-FE/SymbolTableBuilder.h +3 -2
  126. package/SVF-osx/include/Util/BDDExpr.h +32 -16
  127. package/SVF-osx/include/Util/BasicTypes.h +77 -25
  128. package/SVF-osx/include/Util/CoreBitVector.h +2 -1
  129. package/SVF-osx/include/Util/CxtStmt.h +37 -27
  130. package/SVF-osx/include/Util/ExeState.h +42 -22
  131. package/SVF-osx/include/Util/ExtAPI.h +1 -1
  132. package/SVF-osx/include/Util/NodeIDAllocator.h +7 -4
  133. package/SVF-osx/include/Util/Options.h +3 -3
  134. package/SVF-osx/include/Util/SVFBasicTypes.h +49 -40
  135. package/SVF-osx/include/Util/SVFModule.h +5 -5
  136. package/SVF-osx/include/Util/SVFUtil.h +12 -9
  137. package/SVF-osx/include/Util/Z3Expr.h +191 -144
  138. package/SVF-osx/include/WPA/Andersen.h +11 -11
  139. package/SVF-osx/include/WPA/VersionedFlowSensitive.h +4 -1
  140. package/package.json +1 -1
@@ -589,7 +589,7 @@ public:
589
589
  virtual inline bool updateDFInFromIn(LocID srcLoc, const Key& srcVar, LocID dstLoc, const Key& dstVar) override
590
590
  {
591
591
  if (varHasNewDFInPts(srcLoc, srcVar)
592
- && this->unionPtsThroughIds(this->getDFInPtIdRef(dstLoc, dstVar), this->getDFInPtIdRef(srcLoc, srcVar)))
592
+ && this->unionPtsThroughIds(this->getDFInPtIdRef(dstLoc, dstVar), this->getDFInPtIdRef(srcLoc, srcVar)))
593
593
  {
594
594
  setVarDFInSetUpdated(dstLoc, dstVar);
595
595
  return true;
@@ -601,7 +601,7 @@ public:
601
601
  virtual inline bool updateDFInFromOut(LocID srcLoc, const Key& srcVar, LocID dstLoc, const Key& dstVar) override
602
602
  {
603
603
  if (varHasNewDFOutPts(srcLoc, srcVar)
604
- && this->unionPtsThroughIds(this->getDFInPtIdRef(dstLoc, dstVar), this->getDFOutPtIdRef(srcLoc, srcVar)))
604
+ && this->unionPtsThroughIds(this->getDFInPtIdRef(dstLoc, dstVar), this->getDFOutPtIdRef(srcLoc, srcVar)))
605
605
  {
606
606
  setVarDFInSetUpdated(dstLoc, dstVar);
607
607
  return true;
@@ -165,10 +165,11 @@ protected:
165
165
  TypeSystem *typeSystem;
166
166
 
167
167
  public:
168
- /// Get ICFG
169
- inline ICFG* getICFG() const {
170
- return pag->getICFG();
171
- }
168
+ /// Get ICFG
169
+ inline ICFG* getICFG() const
170
+ {
171
+ return pag->getICFG();
172
+ }
172
173
  /// Return number of resolved indirect call edges
173
174
  inline u32_t getNumOfResolvedIndCallEdge() const
174
175
  {
@@ -124,8 +124,14 @@ public:
124
124
  /// If not, remaps.
125
125
  void checkAndRemap(void);
126
126
 
127
- const_iterator begin(void) const { return PointsToIterator(this); }
128
- const_iterator end(void) const { return PointsToIterator(this, true); }
127
+ const_iterator begin(void) const
128
+ {
129
+ return PointsToIterator(this);
130
+ }
131
+ const_iterator end(void) const
132
+ {
133
+ return PointsToIterator(this, true);
134
+ }
129
135
 
130
136
  MappingPtr getNodeMapping(void) const;
131
137
 
@@ -43,10 +43,10 @@ namespace SVF
43
43
  class SVFIR : public IRGraph
44
44
  {
45
45
 
46
- friend class SVFIRBuilder;
47
- friend class ExternalPAG;
48
- friend class PAGBuilderFromFile;
49
- friend class TypeBasedHeapCloning;
46
+ friend class SVFIRBuilder;
47
+ friend class ExternalPAG;
48
+ friend class PAGBuilderFromFile;
49
+ friend class TypeBasedHeapCloning;
50
50
 
51
51
  public:
52
52
  typedef Set<const CallICFGNode*> CallSiteSet;
@@ -447,7 +447,8 @@ public:
447
447
  private:
448
448
 
449
449
  /// Map a SVFStatement type to a set of corresponding SVF statements
450
- inline void addToStmt2TypeMap(SVFStmt* edge) {
450
+ inline void addToStmt2TypeMap(SVFStmt* edge)
451
+ {
451
452
  bool added = KindToSVFStmtSetMap[edge->getEdgeKind()].insert(edge).second;
452
453
  assert(added && "duplicated edge, not added!!!");
453
454
  if (edge->isPTAEdge())
@@ -194,7 +194,8 @@ private:
194
194
  connecting RHS expression and LHS expression with an assignment (e.g., LHSExpr = RHSExpr)
195
195
  Only one operand on the right handside of an assignment
196
196
  */
197
- class AssignStmt : public SVFStmt{
197
+ class AssignStmt : public SVFStmt
198
+ {
198
199
 
199
200
  private:
200
201
  AssignStmt(); ///< place holder
@@ -244,18 +245,22 @@ public:
244
245
  }
245
246
  //@}
246
247
 
247
- inline SVFVar* getRHSVar() const {
248
+ inline SVFVar* getRHSVar() const
249
+ {
248
250
  return SVFStmt::getSrcNode();
249
- }
250
- inline SVFVar* getLHSVar() const {
251
+ }
252
+ inline SVFVar* getLHSVar() const
253
+ {
251
254
  return SVFStmt::getDstNode();
252
- }
253
- inline NodeID getRHSVarID() const {
255
+ }
256
+ inline NodeID getRHSVarID() const
257
+ {
254
258
  return SVFStmt::getSrcID();
255
- }
256
- inline NodeID getLHSVarID() const {
259
+ }
260
+ inline NodeID getLHSVarID() const
261
+ {
257
262
  return SVFStmt::getDstID();
258
- }
263
+ }
259
264
 
260
265
  virtual const std::string toString() const = 0;
261
266
  };
@@ -441,7 +446,8 @@ public:
441
446
  return getLocationSet().getOffsetValueVec();
442
447
  }
443
448
  /// Return TRUE if this is a constant location set.
444
- inline bool isConstantOffset() const{
449
+ inline bool isConstantOffset() const
450
+ {
445
451
  return getLocationSet().isConstantOffset();
446
452
  }
447
453
  /// Return accumulated constant offset (when accessing array or struct) if this offset is a constant.
@@ -455,11 +461,11 @@ public:
455
461
  assert(isVariantFieldGep()==false && "Can't retrieve the LocationSet if using a variable field index (pointer arithmetic) for struct field access ");
456
462
  return getLocationSet().accumulateConstantFieldIdx();
457
463
  }
458
- /// Gep statement with a variant field index (pointer arithmetic) for struct field access
464
+ /// Gep statement with a variant field index (pointer arithmetic) for struct field access
459
465
  inline bool isVariantFieldGep() const
460
466
  {
461
467
  return variantField;
462
- }
468
+ }
463
469
 
464
470
  /// constructor
465
471
  GepStmt(SVFVar* s, SVFVar* d, const LocationSet& l, bool varfld=false) : AssignStmt(s,d,SVFStmt::Gep), ls(l), variantField(varfld)
@@ -472,7 +478,7 @@ public:
472
478
 
473
479
 
474
480
  /*!
475
- * Call
481
+ * Call
476
482
  */
477
483
  class CallPE: public AssignStmt
478
484
  {
@@ -481,7 +487,7 @@ private:
481
487
  CallPE(const CallPE &); ///< place holder
482
488
  void operator=(const CallPE &); ///< place holder
483
489
 
484
- const CallICFGNode* call; /// the callsite statement calling from
490
+ const CallICFGNode* call; /// the callsite statement calling from
485
491
  const FunEntryICFGNode* entry; /// the function exit statement calling to
486
492
  public:
487
493
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
@@ -493,12 +499,12 @@ public:
493
499
  static inline bool classof(const SVFStmt *edge)
494
500
  {
495
501
  return edge->getEdgeKind() == SVFStmt::Call
496
- || edge->getEdgeKind() == SVFStmt::ThreadFork;
502
+ || edge->getEdgeKind() == SVFStmt::ThreadFork;
497
503
  }
498
504
  static inline bool classof(const GenericPAGEdgeTy *edge)
499
505
  {
500
506
  return edge->getEdgeKind() == SVFStmt::Call
501
- || edge->getEdgeKind() == SVFStmt::ThreadFork;
507
+ || edge->getEdgeKind() == SVFStmt::ThreadFork;
502
508
  }
503
509
  //@}
504
510
 
@@ -529,7 +535,7 @@ public:
529
535
 
530
536
 
531
537
  /*!
532
- * Return
538
+ * Return
533
539
  */
534
540
  class RetPE: public AssignStmt
535
541
  {
@@ -550,12 +556,12 @@ public:
550
556
  static inline bool classof(const SVFStmt *edge)
551
557
  {
552
558
  return edge->getEdgeKind() == SVFStmt::Ret
553
- || edge->getEdgeKind() == SVFStmt::ThreadJoin;
559
+ || edge->getEdgeKind() == SVFStmt::ThreadJoin;
554
560
  }
555
561
  static inline bool classof(const GenericPAGEdgeTy *edge)
556
562
  {
557
563
  return edge->getEdgeKind() == SVFStmt::Ret
558
- || edge->getEdgeKind() == SVFStmt::ThreadJoin;
564
+ || edge->getEdgeKind() == SVFStmt::ThreadJoin;
559
565
  }
560
566
  //@}
561
567
 
@@ -587,7 +593,8 @@ public:
587
593
  /*
588
594
  * Program statements with multiple operands including BinaryOPStmt, CmpStmt and PhiStmt
589
595
  */
590
- class MultiOpndStmt : public SVFStmt{
596
+ class MultiOpndStmt : public SVFStmt
597
+ {
591
598
  public:
592
599
  typedef std::vector<SVFVar*> OPVars;
593
600
  private:
@@ -647,7 +654,8 @@ public:
647
654
  {
648
655
  return opVars.size();
649
656
  }
650
- inline const OPVars& getOpndVars() const{
657
+ inline const OPVars& getOpndVars() const
658
+ {
651
659
  return opVars;
652
660
  }
653
661
  inline OPVars::const_iterator opVarBegin() const
@@ -702,18 +710,20 @@ public:
702
710
  {
703
711
  assert(opnds.size()==icfgNodes.size() && "Numbers of operands and their ICFGNodes are not consistent?");
704
712
  }
705
- void addOpVar(SVFVar* op, const ICFGNode* inode){
713
+ void addOpVar(SVFVar* op, const ICFGNode* inode)
714
+ {
706
715
  opVars.push_back(op);
707
716
  opICFGNodes.push_back(inode);
708
717
  assert(opVars.size()==opICFGNodes.size() && "Numbers of operands and their ICFGNodes are not consistent?");
709
718
  }
710
719
 
711
720
  /// Return the corresponding ICFGNode of this operand
712
- inline const ICFGNode* getOpICFGNode(u32_t op_idx) const{
721
+ inline const ICFGNode* getOpICFGNode(u32_t op_idx) const
722
+ {
713
723
  return opICFGNodes.at(op_idx);
714
724
  }
715
725
 
716
- /// Return true if this is a phi at the function exit
726
+ /// Return true if this is a phi at the function exit
717
727
  /// to receive one or multiple return values of this function
718
728
  bool isFunctionRetPhi() const;
719
729
 
@@ -759,13 +769,16 @@ public:
759
769
  }
760
770
  virtual const std::string toString() const override;
761
771
 
762
- inline const SVFVar* getCondition() const{
772
+ inline const SVFVar* getCondition() const
773
+ {
763
774
  return condition;
764
775
  }
765
- inline const SVFVar* getTrueValue() const{
776
+ inline const SVFVar* getTrueValue() const
777
+ {
766
778
  return getOpVar(0);
767
779
  }
768
- inline const SVFVar* getFalseValue() const{
780
+ inline const SVFVar* getFalseValue() const
781
+ {
769
782
  return getOpVar(1);
770
783
  }
771
784
  };
@@ -811,7 +824,7 @@ public:
811
824
  {
812
825
  return predicate;
813
826
  }
814
-
827
+
815
828
  virtual const std::string toString() const override;
816
829
  };
817
830
 
@@ -902,10 +915,12 @@ public:
902
915
  {
903
916
  return opcode;
904
917
  }
905
- inline const SVFVar* getOpVar() const{
918
+ inline const SVFVar* getOpVar() const
919
+ {
906
920
  return SVFStmt::getSrcNode();
907
921
  }
908
- inline const SVFVar* getRes() const{
922
+ inline const SVFVar* getRes() const
923
+ {
909
924
  return SVFStmt::getDstNode();
910
925
  }
911
926
  NodeID getOpVarID() const;
@@ -916,7 +931,7 @@ public:
916
931
 
917
932
 
918
933
  /*!
919
- * Branch statements including if/else and switch
934
+ * Branch statements including if/else and switch
920
935
  */
921
936
  class BranchStmt: public SVFStmt
922
937
  {
@@ -926,8 +941,8 @@ private:
926
941
  BranchStmt(); ///< place holder
927
942
  BranchStmt(const BranchStmt &); ///< place holder
928
943
  void operator=(const BranchStmt &); ///< place holder
929
- SVFVar* getSrcNode(); ///< place holder, not allowed
930
- SVFVar* getDstNode(); ///< place holder, not allowed
944
+ SVFVar* getSrcNode(); ///< place holder, not allowed
945
+ SVFVar* getDstNode(); ///< place holder, not allowed
931
946
  NodeID getSrcID(); ///< place holder, use getOpVarID(pos) instead
932
947
  NodeID getDstID(); ///< place holder, use getResID() instead
933
948
 
@@ -961,33 +976,38 @@ public:
961
976
  bool isUnconditional() const;
962
977
  /// The branch is conditional if cond is not a null value
963
978
  bool isConditional() const;
964
- /// Return the condition
979
+ /// Return the condition
965
980
  const SVFVar* getCondition() const;
966
- const SVFVar* getBranchInst() const{
981
+ const SVFVar* getBranchInst() const
982
+ {
967
983
  return brInst;
968
984
  }
969
-
985
+
970
986
  /// For example if(c) {stmt1} else {stmt2}
971
987
  /// successor(0): stmt1, 1
972
- /// successor(1): stmt2, 0
988
+ /// successor(1): stmt2, 0
973
989
 
974
990
  /// For example switch(c) case 0: {stmt1; break;} case 1: {stmt2; break;} default {stmt3: break}
975
991
  /// successor(0): stmt1, 0
976
- /// successor(1): stmt2, 1
977
- /// successor(3): stmt3, -1
992
+ /// successor(1): stmt2, 1
993
+ /// successor(3): stmt3, -1
978
994
 
979
995
  /// Successors of this branch statement
980
996
  ///@{
981
- u32_t getNumSuccessors() const{
997
+ u32_t getNumSuccessors() const
998
+ {
982
999
  return successors.size();
983
1000
  }
984
- const SuccAndCondPairVec& getSuccessors() const{
1001
+ const SuccAndCondPairVec& getSuccessors() const
1002
+ {
985
1003
  return successors;
986
1004
  }
987
- const ICFGNode* getSuccessor (u32_t i) const{
1005
+ const ICFGNode* getSuccessor (u32_t i) const
1006
+ {
988
1007
  return successors.at(i).first;
989
1008
  }
990
- s32_t getSuccessorCondValue (u32_t i) const{
1009
+ s32_t getSuccessorCondValue (u32_t i) const
1010
+ {
991
1011
  return successors.at(i).second;
992
1012
  }
993
1013
  //@}
@@ -996,7 +1016,7 @@ public:
996
1016
 
997
1017
 
998
1018
  /*!
999
- * Thread Fork
1019
+ * Thread Fork
1000
1020
  */
1001
1021
  class TDForkPE: public CallPE
1002
1022
  {
@@ -1034,7 +1054,7 @@ public:
1034
1054
 
1035
1055
 
1036
1056
  /*!
1037
- * Thread Join
1057
+ * Thread Join
1038
1058
  */
1039
1059
  class TDJoinPE: public RetPE
1040
1060
  {
@@ -45,9 +45,9 @@ class SVFVar;
45
45
  typedef GenericNode<SVFVar,SVFStmt> GenericPAGNodeTy;
46
46
  class SVFVar : public GenericPAGNodeTy
47
47
  {
48
- friend class IRGraph;
49
- friend class SVFIR;
50
- friend class VFG;
48
+ friend class IRGraph;
49
+ friend class SVFIR;
50
+ friend class VFG;
51
51
 
52
52
  public:
53
53
  /// Nine kinds of SVFIR variables
@@ -177,7 +177,7 @@ public:
177
177
  else
178
178
  return false;
179
179
  }
180
-
180
+
181
181
  /// Get incoming SVFStmt iterator
182
182
  inline SVFStmt::SVFStmtSetTy::iterator getIncomingEdgesBegin(SVFStmt::PEDGEK kind) const
183
183
  {
@@ -233,7 +233,8 @@ private:
233
233
  SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(SVFStmt::Gep);
234
234
  if (it != InEdgeKindToSetMap.end())
235
235
  {
236
- for(auto gep : it->second){
236
+ for(auto gep : it->second)
237
+ {
237
238
  if(SVFUtil::cast<GepStmt>(gep)->isVariantFieldGep())
238
239
  return true;
239
240
  }
@@ -47,7 +47,7 @@ class StInfo;
47
47
  */
48
48
  class SymbolTableInfo
49
49
  {
50
- friend class SymbolTableBuilder;
50
+ friend class SymbolTableBuilder;
51
51
 
52
52
  public:
53
53
 
@@ -154,7 +154,7 @@ public:
154
154
  {
155
155
  return mod;
156
156
  }
157
- /// Module
157
+ /// Module
158
158
  inline void setModule(SVFModule* m)
159
159
  {
160
160
  mod = m;
@@ -278,7 +278,7 @@ public:
278
278
  }
279
279
  //@}
280
280
 
281
-
281
+
282
282
  /// Statistics
283
283
  //@{
284
284
  inline u32_t getTotalSymNum() const
@@ -389,7 +389,7 @@ protected:
389
389
  /*!
390
390
  * Memory object symbols or MemObj (address-taken variables in LLVM-based languages)
391
391
  */
392
- class MemObj
392
+ class MemObj
393
393
  {
394
394
 
395
395
  private:
@@ -427,7 +427,7 @@ public:
427
427
  /// Get obj type
428
428
  const Type* getType() const;
429
429
 
430
- /// Get the number of elements of this object
430
+ /// Get the number of elements of this object
431
431
  u32_t getNumOfElements() const;
432
432
 
433
433
  /// Set the number of elements of this object
@@ -496,11 +496,11 @@ private:
496
496
  /// All field infos after flattening a struct
497
497
  std::vector<const Type*> finfo;
498
498
  /// stride represents the number of repetitive elements if this StInfo represent an ArrayType. stride is 1 by default.
499
- u32_t stride;
499
+ u32_t stride;
500
500
  /// number of elements after flattenning (including array elements)
501
- u32_t numOfFlattenElements;
501
+ u32_t numOfFlattenElements;
502
502
  /// number of fields after flattenning (ignoring array elements)
503
- u32_t numOfFlattenFields;
503
+ u32_t numOfFlattenFields;
504
504
  /// Type vector of fields
505
505
  std::vector<const Type*> flattenElementTypes;
506
506
  /// Max field limit
@@ -554,16 +554,19 @@ public:
554
554
  }
555
555
 
556
556
  /// Return number of elements after flattenning (including array elements)
557
- inline u32_t getNumOfFlattenElements() const {
557
+ inline u32_t getNumOfFlattenElements() const
558
+ {
558
559
  return numOfFlattenElements;
559
560
  }
560
561
 
561
562
  /// Return the number of fields after flattenning (ignoring array elements)
562
- inline u32_t getNumOfFlattenFields() const {
563
+ inline u32_t getNumOfFlattenFields() const
564
+ {
563
565
  return numOfFlattenFields;
564
566
  }
565
567
  /// Return the stride
566
- inline u32_t getStride() const{
568
+ inline u32_t getStride() const
569
+ {
567
570
  return stride;
568
571
  }
569
572
  };
@@ -573,7 +576,7 @@ public:
573
576
  */
574
577
  class ObjTypeInfo
575
578
  {
576
- friend class SymbolTableBuilder;
579
+ friend class SymbolTableBuilder;
577
580
  public:
578
581
  typedef enum
579
582
  {
@@ -613,7 +616,7 @@ public:
613
616
  virtual ~ObjTypeInfo()
614
617
  {
615
618
  }
616
-
619
+
617
620
  /// Get LLVM type
618
621
  inline const Type* getType() const
619
622
  {
@@ -632,14 +635,14 @@ public:
632
635
  maxOffsetLimit = limit;
633
636
  }
634
637
 
635
- /// Set the number of elements of this object
638
+ /// Set the number of elements of this object
636
639
  inline void setNumOfElements(u32_t num)
637
640
  {
638
641
  elemNum = num;
639
642
  setMaxFieldOffsetLimit(num);
640
643
  }
641
644
 
642
- /// Get the number of elements of this object
645
+ /// Get the number of elements of this object
643
646
  inline u32_t getNumOfElements() const
644
647
  {
645
648
  return elemNum;
@@ -133,12 +133,14 @@ public:
133
133
  {
134
134
  return condMgr->getCondInst(cond);
135
135
  }
136
- inline void setCondInst(const Condition* cond, const Instruction* inst){
136
+ inline void setCondInst(const Condition* cond, const Instruction* inst)
137
+ {
137
138
  condMgr->setCondInst(cond, inst);
138
139
  }
139
140
  //@}
140
141
 
141
- bool isNegCond(const Condition *condition) {
142
+ bool isNegCond(const Condition *condition)
143
+ {
142
144
  return condMgr->isNegCond(condition);
143
145
  }
144
146
 
@@ -189,20 +191,24 @@ public:
189
191
  void printPathCond();
190
192
 
191
193
  /// whether condition is satisfiable
192
- inline bool isSatisfiable(Condition* condition){
194
+ inline bool isSatisfiable(Condition* condition)
195
+ {
193
196
  return condMgr->isSatisfiable(condition);
194
197
  }
195
198
 
196
199
  /// whether condition is satisfiable for all possible boolean guards
197
- inline bool isAllPathReachable(Condition* condition){
200
+ inline bool isAllPathReachable(Condition* condition)
201
+ {
198
202
  return condMgr->isAllPathReachable(condition);
199
203
  }
200
204
 
201
- bool isEquivalentBranchCond(const Condition *lhs, const Condition *rhs) const{
205
+ bool isEquivalentBranchCond(const Condition *lhs, const Condition *rhs) const
206
+ {
202
207
  return condMgr->isEquivalentBranchCond(lhs, rhs);
203
208
  }
204
209
 
205
- inline ICFG* getICFG() const {
210
+ inline ICFG* getICFG() const
211
+ {
206
212
  return PAG::getPAG()->getICFG();
207
213
  }
208
214
 
@@ -276,7 +282,8 @@ private:
276
282
 
277
283
 
278
284
  /// Release memory
279
- void destroy(){
285
+ void destroy()
286
+ {
280
287
 
281
288
  }
282
289
 
@@ -253,7 +253,8 @@ protected:
253
253
  }
254
254
  //@}
255
255
 
256
- inline bool isEquivalentBranchCond(const Condition *lhs, const Condition *rhs) const {
256
+ inline bool isEquivalentBranchCond(const Condition *lhs, const Condition *rhs) const
257
+ {
257
258
  return pathAllocator->isEquivalentBranchCond(lhs, rhs);
258
259
  };
259
260
 
@@ -59,7 +59,7 @@ public:
59
59
  /// Add ActualParmVFGNode
60
60
  inline void addActualParmVFGNode(const PAGNode* pagNode, const CallICFGNode* cs)
61
61
  {
62
- svfg->addActualParmVFGNode(pagNode, cs);
62
+ svfg->addActualParmVFGNode(pagNode, cs);
63
63
  }
64
64
 
65
65
  protected:
@@ -169,19 +169,23 @@ public:
169
169
  ///@{
170
170
  virtual void initSrcs() = 0;
171
171
  virtual void initSnks() = 0;
172
- virtual bool isSourceLikeFun(const SVFFunction* fun) {
172
+ virtual bool isSourceLikeFun(const SVFFunction* fun)
173
+ {
173
174
  return false;
174
175
  }
175
176
 
176
- virtual bool isSinkLikeFun(const SVFFunction* fun) {
177
+ virtual bool isSinkLikeFun(const SVFFunction* fun)
178
+ {
177
179
  return false;
178
180
  }
179
181
 
180
- bool isSource(const SVFGNode* node) const {
182
+ bool isSource(const SVFGNode* node) const
183
+ {
181
184
  return getSources().find(node)!=getSources().end();
182
185
  }
183
186
 
184
- bool isSink(const SVFGNode* node) const {
187
+ bool isSink(const SVFGNode* node) const
188
+ {
185
189
  return getSinks().find(node)!=getSinks().end();
186
190
  }
187
191
  ///@}
@@ -29,9 +29,11 @@
29
29
 
30
30
  #include "Graphs/CHG.h"
31
31
 
32
- namespace SVF{
32
+ namespace SVF
33
+ {
33
34
 
34
- class CHGBuilder{
35
+ class CHGBuilder
36
+ {
35
37
 
36
38
  private:
37
39
  CHGraph* chg;
@@ -119,25 +119,26 @@ public:
119
119
  };
120
120
 
121
121
 
122
- class PTACFInfoBuilder{
122
+ class PTACFInfoBuilder
123
+ {
123
124
  public:
124
125
  typedef Map<const Function*, DominatorTree*> FunToDTMap; ///< map a function to its dominator tree
125
126
  typedef Map<const Function*, PostDominatorTree*> FunToPostDTMap; ///< map a function to its post dominator tree
126
127
  typedef Map<const Function*, LoopInfo*> FunToLoopInfoMap; ///< map a function to its loop info
127
128
 
128
129
  /// Constructor
129
- PTACFInfoBuilder();
130
+ PTACFInfoBuilder();
130
131
 
131
- ~PTACFInfoBuilder();
132
+ ~PTACFInfoBuilder();
132
133
 
133
- /// Get loop info of a function
134
- LoopInfo* getLoopInfo(const Function* f);
134
+ /// Get loop info of a function
135
+ LoopInfo* getLoopInfo(const Function* f);
135
136
 
136
- /// Get post dominator tree of a function
137
- PostDominatorTree* getPostDT(const Function* f);
137
+ /// Get post dominator tree of a function
138
+ PostDominatorTree* getPostDT(const Function* f);
138
139
 
139
- /// Get dominator tree of a function
140
- DominatorTree* getDT(const Function* f);
140
+ /// Get dominator tree of a function
141
+ DominatorTree* getDT(const Function* f);
141
142
 
142
143
  private:
143
144
  FunToLoopInfoMap funToLoopInfoMap; ///< map a function to its loop info