svf-tools 1.0.330 → 1.0.331

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 (212) hide show
  1. package/SVF-doxygen/html/html/AndersenSFR_8cpp_source.html +4 -4
  2. package/SVF-doxygen/html/html/Andersen_8cpp_source.html +4 -4
  3. package/SVF-doxygen/html/html/CSC_8cpp_source.html +2 -3
  4. package/SVF-doxygen/html/html/ConsGEdge_8h_source.html +3 -3
  5. package/SVF-doxygen/html/html/ConsGNode_8h_source.html +5 -5
  6. package/SVF-doxygen/html/html/ConsG_8cpp_source.html +2 -2
  7. package/SVF-doxygen/html/html/ConsG_8h_source.html +4 -4
  8. package/SVF-doxygen/html/html/ContextDDA_8cpp_source.html +5 -5
  9. package/SVF-doxygen/html/html/DDAVFSolver_8h_source.html +6 -6
  10. package/SVF-doxygen/html/html/FlowDDA_8cpp_source.html +2 -2
  11. package/SVF-doxygen/html/html/FlowSensitiveStat_8cpp_source.html +3 -3
  12. package/SVF-doxygen/html/html/FlowSensitiveTBHC_8cpp_source.html +2 -2
  13. package/SVF-doxygen/html/html/IRAnnotator_8h_source.html +6 -7
  14. package/SVF-doxygen/html/html/IRGraph_8cpp_source.html +1 -1
  15. package/SVF-doxygen/html/html/IRGraph_8h_source.html +1 -1
  16. package/SVF-doxygen/html/html/LocationSet_8cpp.html +1 -0
  17. package/SVF-doxygen/html/html/LocationSet_8cpp_source.html +12 -15
  18. package/SVF-doxygen/html/html/LocationSet_8h.html +1 -1
  19. package/SVF-doxygen/html/html/LocationSet_8h_source.html +26 -40
  20. package/SVF-doxygen/html/html/MemRegion_8cpp_source.html +5 -5
  21. package/SVF-doxygen/html/html/OfflineConsG_8cpp_source.html +1 -1
  22. package/SVF-doxygen/html/html/PAGBuilderFromFile_8cpp_source.html +2 -2
  23. package/SVF-doxygen/html/html/PTAStat_8cpp_source.html +14 -14
  24. package/SVF-doxygen/html/html/PointerAnalysisImpl_8cpp_source.html +6 -6
  25. package/SVF-doxygen/html/html/PointerAnalysis_8cpp_source.html +5 -5
  26. package/SVF-doxygen/html/html/PointerAnalysis_8h_source.html +6 -6
  27. package/SVF-doxygen/html/html/SVFIRBuilder_8cpp_source.html +6 -7
  28. package/SVF-doxygen/html/html/SVFIRBuilder_8h_source.html +32 -32
  29. package/SVF-doxygen/html/html/SVFIR_8cpp_source.html +12 -12
  30. package/SVF-doxygen/html/html/SVFIR_8h_source.html +12 -12
  31. package/SVF-doxygen/html/html/SVFStatements_8h_source.html +3 -3
  32. package/SVF-doxygen/html/html/SVFVariables_8cpp_source.html +2 -2
  33. package/SVF-doxygen/html/html/SVFVariables_8h.html +1 -1
  34. package/SVF-doxygen/html/html/SVFVariables_8h_source.html +69 -69
  35. package/SVF-doxygen/html/html/SaberSVFGBuilder_8cpp_source.html +3 -3
  36. package/SVF-doxygen/html/html/SymbolTableBuilder_8cpp_source.html +21 -21
  37. package/SVF-doxygen/html/html/SymbolTableBuilder_8h_source.html +1 -1
  38. package/SVF-doxygen/html/html/SymbolTableInfo_8cpp_source.html +52 -53
  39. package/SVF-doxygen/html/html/SymbolTableInfo_8h_source.html +72 -75
  40. package/SVF-doxygen/html/html/ThreadCallGraph_8cpp_source.html +3 -3
  41. package/SVF-doxygen/html/html/TypeBasedHeapCloning_8cpp_source.html +13 -13
  42. package/SVF-doxygen/html/html/TypeBasedHeapCloning_8h_source.html +2 -2
  43. package/SVF-doxygen/html/html/VersionedFlowSensitiveStat_8cpp_source.html +3 -3
  44. package/SVF-doxygen/html/html/annotated.html +6 -6
  45. package/SVF-doxygen/html/html/classSVF_1_1AndersenBase.html +4 -4
  46. package/SVF-doxygen/html/html/classSVF_1_1AndersenSFR.html +5 -5
  47. package/SVF-doxygen/html/html/classSVF_1_1BVDataPTAImpl.html +9 -9
  48. package/SVF-doxygen/html/html/classSVF_1_1CSC.html +2 -3
  49. package/SVF-doxygen/html/html/classSVF_1_1CloneDummyObjVar.html +11 -11
  50. package/SVF-doxygen/html/html/classSVF_1_1CloneFIObjVar.html +11 -11
  51. package/SVF-doxygen/html/html/classSVF_1_1CloneGepObjVar-members.html +56 -55
  52. package/SVF-doxygen/html/html/classSVF_1_1CloneGepObjVar.html +44 -41
  53. package/SVF-doxygen/html/html/classSVF_1_1CloneGepObjVar.png +0 -0
  54. package/SVF-doxygen/html/html/classSVF_1_1ConstraintGraph.html +3 -3
  55. package/SVF-doxygen/html/html/classSVF_1_1ConstraintNode-members.html +26 -26
  56. package/SVF-doxygen/html/html/classSVF_1_1ConstraintNode.html +43 -43
  57. package/SVF-doxygen/html/html/classSVF_1_1ContextDDA.html +4 -4
  58. package/SVF-doxygen/html/html/classSVF_1_1DDAVFSolver.html +1 -1
  59. package/SVF-doxygen/html/html/classSVF_1_1DummyObjVar.html +11 -11
  60. package/SVF-doxygen/html/html/classSVF_1_1DummyValVar.html +11 -11
  61. package/SVF-doxygen/html/html/classSVF_1_1FIObjVar.html +13 -13
  62. package/SVF-doxygen/html/html/classSVF_1_1FlattenedFieldInfo-members.html +85 -0
  63. package/SVF-doxygen/html/html/classSVF_1_1FlattenedFieldInfo.html +254 -0
  64. package/SVF-doxygen/html/html/classSVF_1_1FlowDDA.html +2 -2
  65. package/SVF-doxygen/html/html/classSVF_1_1FlowSensitive.html +1 -1
  66. package/SVF-doxygen/html/html/classSVF_1_1FlowSensitiveStat.html +3 -3
  67. package/SVF-doxygen/html/html/classSVF_1_1FlowSensitiveTBHC.html +6 -6
  68. package/SVF-doxygen/html/html/classSVF_1_1GenericNode.html +22 -23
  69. package/SVF-doxygen/html/html/classSVF_1_1GenericNode.png +0 -0
  70. package/SVF-doxygen/html/html/classSVF_1_1GepObjVar-members.html +173 -0
  71. package/SVF-doxygen/html/html/classSVF_1_1GepObjVar.html +813 -0
  72. package/SVF-doxygen/html/html/classSVF_1_1GepObjVar.png +0 -0
  73. package/SVF-doxygen/html/html/classSVF_1_1GepValVar.html +2 -2
  74. package/SVF-doxygen/html/html/classSVF_1_1IRAnnotator-members.html +1 -1
  75. package/SVF-doxygen/html/html/classSVF_1_1IRAnnotator.html +8 -8
  76. package/SVF-doxygen/html/html/classSVF_1_1LocationSet-members.html +17 -21
  77. package/SVF-doxygen/html/html/classSVF_1_1LocationSet.html +150 -326
  78. package/SVF-doxygen/html/html/classSVF_1_1MRGenerator.html +6 -6
  79. package/SVF-doxygen/html/html/classSVF_1_1MemObj.html +84 -84
  80. package/SVF-doxygen/html/html/classSVF_1_1NormalGepCGEdge.html +2 -2
  81. package/SVF-doxygen/html/html/classSVF_1_1NormalGepStmt.html +2 -2
  82. package/SVF-doxygen/html/html/classSVF_1_1ObjTypeInfo.html +96 -96
  83. package/SVF-doxygen/html/html/classSVF_1_1ObjVar.html +5 -5
  84. package/SVF-doxygen/html/html/classSVF_1_1ObjVar.png +0 -0
  85. package/SVF-doxygen/html/html/classSVF_1_1PAGBuilderFromFile.html +2 -2
  86. package/SVF-doxygen/html/html/classSVF_1_1PTAStat.html +14 -14
  87. package/SVF-doxygen/html/html/classSVF_1_1PointerAnalysis.html +8 -8
  88. package/SVF-doxygen/html/html/classSVF_1_1RetPN.html +11 -11
  89. package/SVF-doxygen/html/html/classSVF_1_1SVFIR.html +26 -26
  90. package/SVF-doxygen/html/html/classSVF_1_1SVFIRBuilder.html +114 -115
  91. package/SVF-doxygen/html/html/classSVF_1_1SVFVar.html +4 -4
  92. package/SVF-doxygen/html/html/classSVF_1_1SVFVar.png +0 -0
  93. package/SVF-doxygen/html/html/classSVF_1_1SaberSVFGBuilder.html +3 -3
  94. package/SVF-doxygen/html/html/classSVF_1_1StInfo-members.html +11 -14
  95. package/SVF-doxygen/html/html/classSVF_1_1StInfo.html +70 -168
  96. package/SVF-doxygen/html/html/classSVF_1_1SymbolTableBuilder.html +30 -30
  97. package/SVF-doxygen/html/html/classSVF_1_1SymbolTableInfo-members.html +59 -60
  98. package/SVF-doxygen/html/html/classSVF_1_1SymbolTableInfo.html +118 -146
  99. package/SVF-doxygen/html/html/classSVF_1_1ThreadCallGraph.html +3 -3
  100. package/SVF-doxygen/html/html/classSVF_1_1TypeBasedHeapCloning.html +18 -18
  101. package/SVF-doxygen/html/html/classSVF_1_1VarArgPN.html +11 -11
  102. package/SVF-doxygen/html/html/classSVF_1_1VersionedFlowSensitiveStat.html +3 -3
  103. package/SVF-doxygen/html/html/classes.html +6 -6
  104. package/SVF-doxygen/html/html/functions_a.html +13 -10
  105. package/SVF-doxygen/html/html/functions_b.html +1 -5
  106. package/SVF-doxygen/html/html/functions_c.html +6 -8
  107. package/SVF-doxygen/html/html/functions_d.html +1 -1
  108. package/SVF-doxygen/html/html/functions_e.html +0 -16
  109. package/SVF-doxygen/html/html/functions_f.html +21 -19
  110. package/SVF-doxygen/html/html/functions_func.html +15 -12
  111. package/SVF-doxygen/html/html/functions_func_c.html +2 -2
  112. package/SVF-doxygen/html/html/functions_func_d.html +1 -1
  113. package/SVF-doxygen/html/html/functions_func_e.html +2 -8
  114. package/SVF-doxygen/html/html/functions_func_f.html +4 -4
  115. package/SVF-doxygen/html/html/functions_func_g.html +39 -60
  116. package/SVF-doxygen/html/html/functions_func_i.html +11 -14
  117. package/SVF-doxygen/html/html/functions_func_s.html +6 -9
  118. package/SVF-doxygen/html/html/functions_func_t.html +1 -1
  119. package/SVF-doxygen/html/html/functions_func_w.html +1 -1
  120. package/SVF-doxygen/html/html/functions_g.html +38 -59
  121. package/SVF-doxygen/html/html/functions_i.html +6 -9
  122. package/SVF-doxygen/html/html/functions_l.html +1 -1
  123. package/SVF-doxygen/html/html/functions_n.html +4 -7
  124. package/SVF-doxygen/html/html/functions_o.html +21 -16
  125. package/SVF-doxygen/html/html/functions_p.html +16 -14
  126. package/SVF-doxygen/html/html/functions_s.html +15 -18
  127. package/SVF-doxygen/html/html/functions_t.html +4 -4
  128. package/SVF-doxygen/html/html/functions_type_e.html +0 -4
  129. package/SVF-doxygen/html/html/functions_type_o.html +3 -0
  130. package/SVF-doxygen/html/html/functions_v.html +3 -3
  131. package/SVF-doxygen/html/html/functions_vars_b.html +1 -5
  132. package/SVF-doxygen/html/html/functions_vars_e.html +0 -6
  133. package/SVF-doxygen/html/html/functions_vars_f.html +9 -7
  134. package/SVF-doxygen/html/html/functions_vars_l.html +1 -1
  135. package/SVF-doxygen/html/html/functions_vars_n.html +0 -3
  136. package/SVF-doxygen/html/html/functions_vars_o.html +2 -2
  137. package/SVF-doxygen/html/html/functions_w.html +1 -1
  138. package/SVF-doxygen/html/html/hierarchy.html +64 -64
  139. package/SVF-doxygen/html/html/namespaceSVF.html +3 -3
  140. package/SVF-doxygen/html/html/search/all_1.js +3 -2
  141. package/SVF-doxygen/html/html/search/all_10.js +8 -8
  142. package/SVF-doxygen/html/html/search/all_12.js +1 -1
  143. package/SVF-doxygen/html/html/search/all_13.js +9 -10
  144. package/SVF-doxygen/html/html/search/all_14.js +7 -7
  145. package/SVF-doxygen/html/html/search/all_15.js +1 -1
  146. package/SVF-doxygen/html/html/search/all_16.js +2 -2
  147. package/SVF-doxygen/html/html/search/all_17.js +1 -1
  148. package/SVF-doxygen/html/html/search/all_2.js +2 -3
  149. package/SVF-doxygen/html/html/search/all_3.js +3 -3
  150. package/SVF-doxygen/html/html/search/all_4.js +1 -1
  151. package/SVF-doxygen/html/html/search/all_5.js +0 -5
  152. package/SVF-doxygen/html/html/search/all_6.js +6 -5
  153. package/SVF-doxygen/html/html/search/all_7.js +13 -21
  154. package/SVF-doxygen/html/html/search/all_9.js +1 -2
  155. package/SVF-doxygen/html/html/search/all_c.js +2 -2
  156. package/SVF-doxygen/html/html/search/all_d.js +1 -1
  157. package/SVF-doxygen/html/html/search/all_e.js +1 -2
  158. package/SVF-doxygen/html/html/search/all_f.js +4 -3
  159. package/SVF-doxygen/html/html/search/classes_5.js +1 -1
  160. package/SVF-doxygen/html/html/search/classes_6.js +1 -1
  161. package/SVF-doxygen/html/html/search/functions_0.js +3 -2
  162. package/SVF-doxygen/html/html/search/functions_10.js +2 -3
  163. package/SVF-doxygen/html/html/search/functions_11.js +1 -1
  164. package/SVF-doxygen/html/html/search/functions_14.js +1 -1
  165. package/SVF-doxygen/html/html/search/functions_2.js +2 -2
  166. package/SVF-doxygen/html/html/search/functions_3.js +1 -1
  167. package/SVF-doxygen/html/html/search/functions_4.js +0 -2
  168. package/SVF-doxygen/html/html/search/functions_5.js +1 -1
  169. package/SVF-doxygen/html/html/search/functions_6.js +13 -21
  170. package/SVF-doxygen/html/html/search/functions_8.js +1 -2
  171. package/SVF-doxygen/html/html/search/functions_a.js +1 -1
  172. package/SVF-doxygen/html/html/search/functions_e.js +1 -1
  173. package/SVF-doxygen/html/html/search/typedefs_4.js +0 -1
  174. package/SVF-doxygen/html/html/search/typedefs_e.js +1 -0
  175. package/SVF-doxygen/html/html/search/variables_14.js +3 -3
  176. package/SVF-doxygen/html/html/search/variables_15.js +1 -1
  177. package/SVF-doxygen/html/html/search/variables_2.js +2 -3
  178. package/SVF-doxygen/html/html/search/variables_5.js +0 -2
  179. package/SVF-doxygen/html/html/search/variables_6.js +5 -4
  180. package/SVF-doxygen/html/html/search/variables_c.js +1 -1
  181. package/SVF-doxygen/html/html/search/variables_e.js +0 -1
  182. package/SVF-doxygen/html/html/search/variables_f.js +1 -1
  183. package/SVF-doxygen/html/html/structllvm_1_1DOTGraphTraits_3_01ConstraintGraph_01_5_01_4.html +1 -1
  184. package/SVF-doxygen/html/html/structllvm_1_1DOTGraphTraits_3_01IRGraph_01_5_01_4.html +1 -1
  185. package/SVF-doxygen/html/html/structllvm_1_1DOTGraphTraits_3_01OfflineConsG_01_5_01_4.html +1 -1
  186. package/SVF-doxygen/html/html/structstd_1_1hash_3_01SVF_1_1LocationSet_01_4.html +5 -5
  187. package/include/Graphs/ConsG.h +1 -1
  188. package/include/Graphs/ConsGEdge.h +1 -1
  189. package/include/MemoryModel/LocationSet.h +39 -126
  190. package/include/MemoryModel/SVFIR.h +1 -1
  191. package/include/MemoryModel/SVFStatements.h +1 -1
  192. package/include/MemoryModel/SVFVariables.h +17 -11
  193. package/include/MemoryModel/SymbolTableInfo.h +27 -25
  194. package/include/Util/IRAnnotator.h +3 -3
  195. package/lib/DDA/ContextDDA.cpp +1 -1
  196. package/lib/Graphs/ConsG.cpp +1 -1
  197. package/lib/Graphs/IRGraph.cpp +1 -1
  198. package/lib/Graphs/OfflineConsG.cpp +1 -1
  199. package/lib/MemoryModel/LocationSet.cpp +53 -95
  200. package/lib/MemoryModel/PointerAnalysisImpl.cpp +4 -4
  201. package/lib/MemoryModel/SVFIR.cpp +4 -4
  202. package/lib/MemoryModel/SVFVariables.cpp +2 -2
  203. package/lib/MemoryModel/SymbolTableInfo.cpp +36 -63
  204. package/lib/SABER/SaberSVFGBuilder.cpp +1 -1
  205. package/lib/SVF-FE/SVFIRBuilder.cpp +9 -10
  206. package/lib/SVF-FE/SymbolTableBuilder.cpp +4 -4
  207. package/lib/Util/TypeBasedHeapCloning.cpp +10 -10
  208. package/lib/WPA/Andersen.cpp +1 -1
  209. package/lib/WPA/AndersenSFR.cpp +2 -2
  210. package/lib/WPA/CSC.cpp +1 -1
  211. package/lib/WPA/FlowSensitiveTBHC.cpp +6 -6
  212. package/package.json +1 -1
@@ -31,122 +31,80 @@
31
31
 
32
32
  #include "Util/Options.h"
33
33
  #include "MemoryModel/LocationSet.h"
34
+ #include "Util/SVFUtil.h"
34
35
 
35
36
  using namespace SVF;
36
-
37
+ using namespace SVFUtil;
37
38
 
38
39
  /*!
39
- * Add element num and stride pair
40
+ * Add offset value to vector offsetValues
40
41
  */
41
- void LocationSet::addElemNumStridePair(const NodePair& pair)
42
+ bool LocationSet::addOffsetValue(const Value* offsetVal)
42
43
  {
43
- /// The pair will not be added if any number of a stride is zero,
44
- /// because they will not have effect on the locations represented by this LocationSet.
45
- if (pair.first == 0 || pair.second == 0)
46
- return;
47
-
48
- if (Options::SingleStride)
49
- {
50
- if (numStridePair.empty())
51
- numStridePair.push_back(std::make_pair(StInfo::getMaxFieldLimit(),pair.second));
52
- else
53
- {
54
- /// Find the GCD stride
55
- NodeID existStride = (*numStridePair.begin()).second;
56
- NodeID newStride = gcd(pair.second, existStride);
57
- if (newStride != existStride)
58
- {
59
- numStridePair.pop_back();
60
- numStridePair.push_back(std::make_pair(StInfo::getMaxFieldLimit(),newStride));
61
- }
62
- }
63
- }
64
- else
65
- {
66
- numStridePair.push_back(pair);
44
+ for(const Value* val : offsetValues){
45
+ if(val==offsetVal)
46
+ return false;
67
47
  }
48
+ offsetValues.push_back(offsetVal);
49
+ return true;
68
50
  }
69
51
 
70
-
71
- /*!
72
- * Return TRUE if it successfully increases any index by 1
73
- */
74
- bool LocationSet::increaseIfNotReachUpperBound(std::vector<NodeID>& indices,
75
- const ElemNumStridePairVec& pairVec) const
52
+ /// Return TRUE if all offset values are constants
53
+ bool LocationSet::isConstantOffset() const
76
54
  {
77
- assert(indices.size() == pairVec.size() && "vector size not match");
78
-
79
- /// Check if all indices reach upper bound
80
- bool reachUpperBound = true;
81
- for (u32_t i = 0; i < indices.size(); i++)
82
- {
83
- assert(pairVec[i].first > 0 && "number must be greater than 0");
84
- if (indices[i] < (pairVec[i].first - 1))
85
- reachUpperBound = false;
55
+ for(const Value* val : offsetValues){
56
+ if(SVFUtil::isa<ConstantInt>(val) == false)
57
+ return false;
86
58
  }
87
-
88
- /// Increase index if not reach upper bound
89
- bool increased = false;
90
- if (reachUpperBound == false)
91
- {
92
- u32_t i = 0;
93
- while (increased == false)
94
- {
95
- if (indices[i] < (pairVec[i].first - 1))
96
- {
97
- indices[i] += 1;
98
- increased = true;
99
- }
100
- else
101
- {
102
- indices[i] = 0;
103
- i++;
104
- }
105
- }
106
- }
107
-
108
- return increased;
59
+ return true;
109
60
  }
110
61
 
111
-
112
62
  /*!
113
63
  * Compute all possible locations according to offset and number-stride pairs.
114
64
  */
115
65
  NodeBS LocationSet::computeAllLocations() const
116
66
  {
117
-
118
67
  NodeBS result;
119
- result.set(getOffset());
68
+ result.set(accumulateConstantOffset());
69
+ return result;
70
+ }
120
71
 
121
- if (isConstantOffset() == false)
72
+ SVF::LocationSet::LSRelation LocationSet::checkRelation(const LocationSet& LHS, const LocationSet& RHS)
73
+ {
74
+ NodeBS lhsLocations = LHS.computeAllLocations();
75
+ NodeBS rhsLocations = RHS.computeAllLocations();
76
+ if (lhsLocations.intersects(rhsLocations))
122
77
  {
123
- const ElemNumStridePairVec& lhsVec = getNumStridePair();
124
- std::vector<NodeID> indices;
125
- u32_t size = lhsVec.size();
126
- while (size)
127
- {
128
- indices.push_back(0);
129
- size--;
130
- }
131
-
132
- do
133
- {
134
- u32_t i = 0;
135
- NodeID ofst = getOffset();
136
- while (i < lhsVec.size())
137
- {
138
- ofst += (lhsVec[i].second * indices[i]);
139
- i++;
140
- }
141
-
142
- result.set(ofst);
143
-
144
- }
145
- while (increaseIfNotReachUpperBound(indices, lhsVec));
78
+ if (lhsLocations == rhsLocations)
79
+ return Same;
80
+ else if (lhsLocations.contains(rhsLocations))
81
+ return Superset;
82
+ else if (rhsLocations.contains(lhsLocations))
83
+ return Subset;
84
+ else
85
+ return Overlap;
86
+ }
87
+ else
88
+ {
89
+ return NonOverlap;
146
90
  }
147
-
148
- return result;
149
91
  }
150
92
 
151
-
152
-
93
+ /// Dump location set
94
+ std::string LocationSet::dump() const
95
+ {
96
+ std::string str;
97
+ raw_string_ostream rawstr(str);
98
+
99
+ rawstr << "LocationSet\tField_Index: " << accumulateConstantOffset();
100
+ rawstr << ",\tNum-Stride: {";
101
+ const OffsetValueVec& vec = getOffsetValueVec();
102
+ OffsetValueVec::const_iterator it = vec.begin();
103
+ OffsetValueVec::const_iterator eit = vec.end();
104
+ for (; it != eit; ++it)
105
+ {
106
+ rawstr << " (" << value2String(*it) << ")";
107
+ }
108
+ rawstr << " }\n";
109
+ return rawstr.str();
110
+ }
@@ -150,11 +150,11 @@ void BVDataPTAImpl::writeToFile(const string& filename)
150
150
  for (auto it = pag->begin(), ie = pag->end(); it != ie; ++it)
151
151
  {
152
152
  PAGNode* pagNode = it->second;
153
- if (GepObjPN *gepObjPN = SVFUtil::dyn_cast<GepObjPN>(pagNode))
153
+ if (GepObjVar *gepObjPN = SVFUtil::dyn_cast<GepObjVar>(pagNode))
154
154
  {
155
155
  F.os() << it->first << " ";
156
156
  F.os() << pag->getBaseObjVar(it->first) << " ";
157
- F.os() << gepObjPN->getLocationSet().getOffset() << "\n";
157
+ F.os() << gepObjPN->getOffset() << "\n";
158
158
  }
159
159
  }
160
160
 
@@ -411,7 +411,7 @@ void BVDataPTAImpl::normalizePointsTo() {
411
411
  assert(memObj && "Invalid memobj in memToFieldsMap");
412
412
  if (memObj->isFieldInsensitive()) {
413
413
  for (NodeID id : t.second) {
414
- if (SVFUtil::isa<GepObjPN>(pag->getGNode(id))) {
414
+ if (SVFUtil::isa<GepObjVar>(pag->getGNode(id))) {
415
415
  dropNodes.set(id);
416
416
  } else
417
417
  assert(id == base && "Not a GepObj Node or a baseObj Node?");
@@ -437,7 +437,7 @@ void BVDataPTAImpl::normalizePointsTo() {
437
437
  // and remove those nodes from pag
438
438
  for (NodeID n: dropNodes) {
439
439
  NodeID base = pag->getBaseObjVar(n);
440
- GepObjPN *gepNode = SVFUtil::dyn_cast<GepObjPN>(pag->getGNode(n));
440
+ GepObjVar *gepNode = SVFUtil::dyn_cast<GepObjVar>(pag->getGNode(n));
441
441
  const LocationSet ls = gepNode->getLocationSet();
442
442
  GepObjVarMap.erase(std::make_pair(base, ls));
443
443
  memToFieldsMap[base].reset(n);
@@ -383,7 +383,7 @@ NodeID SVFIR::addGepValNode(const Value* curInst,const Value* gepVal, const Loca
383
383
  NodeID SVFIR::getGepObjVar(NodeID id, const LocationSet& ls)
384
384
  {
385
385
  SVFVar* node = pag->getGNode(id);
386
- if (GepObjPN* gepNode = SVFUtil::dyn_cast<GepObjPN>(node))
386
+ if (GepObjVar* gepNode = SVFUtil::dyn_cast<GepObjVar>(node))
387
387
  return getGepObjVar(gepNode->getMemObj(), gepNode->getLocationSet() + ls);
388
388
  else if (FIObjVar* baseNode = SVFUtil::dyn_cast<FIObjVar>(node))
389
389
  return getGepObjVar(baseNode->getMemObj(), ls);
@@ -413,7 +413,7 @@ NodeID SVFIR::getGepObjVar(const MemObj* obj, const LocationSet& ls)
413
413
  LocationSet newLS = SymbolTableInfo::SymbolInfo()->getModulusOffset(obj,ls);
414
414
 
415
415
  // Base and first field are the same memory location.
416
- if (Options::FirstFieldEqBase && newLS.getOffset() == 0) return base;
416
+ if (Options::FirstFieldEqBase && newLS.accumulateConstantOffset() == 0) return base;
417
417
 
418
418
  NodeLocationSetMap::iterator iter = GepObjVarMap.find(std::make_pair(base, newLS));
419
419
  if (iter == GepObjVarMap.end())
@@ -433,9 +433,9 @@ NodeID SVFIR::addGepObjNode(const MemObj* obj, const LocationSet& ls)
433
433
  assert(0==GepObjVarMap.count(std::make_pair(base, ls))
434
434
  && "this node should not be created before");
435
435
 
436
- NodeID gepId = NodeIDAllocator::get()->allocateGepObjectId(base, ls.getOffset(), StInfo::getMaxFieldLimit());
436
+ NodeID gepId = NodeIDAllocator::get()->allocateGepObjectId(base, ls.accumulateConstantOffset(), StInfo::getMaxFieldLimit());
437
437
  GepObjVarMap[std::make_pair(base, ls)] = gepId;
438
- GepObjPN *node = new GepObjPN(obj, gepId, ls);
438
+ GepObjVar *node = new GepObjVar(obj, gepId, ls);
439
439
  memToFieldsMap[base].set(gepId);
440
440
  return addObjNode(obj->getValue(), node, gepId);
441
441
  }
@@ -141,10 +141,10 @@ const std::string GepValVar::toString() const {
141
141
  return rawstr.str();
142
142
  }
143
143
 
144
- const std::string GepObjPN::toString() const {
144
+ const std::string GepObjVar::toString() const {
145
145
  std::string str;
146
146
  raw_string_ostream rawstr(str);
147
- rawstr << "GepObjPN ID: " << getId() << " with offset_" + llvm::itostr(ls.getOffset());
147
+ rawstr << "GepObjVar ID: " << getId() << " with offset_" + llvm::itostr(ls.accumulateConstantOffset());
148
148
  if (Options::PAGDotGraphShorter) {
149
149
  rawstr << "\n";
150
150
  }
@@ -101,22 +101,18 @@ void SymbolTableInfo::collectArrayInfo(const ArrayType* ty)
101
101
  }
102
102
 
103
103
  /// Array itself only has one field which is the inner most element
104
- stinfo->addFldWithType(0, 0, elemTy);
104
+ stinfo->addFldWithType(0,elemTy);
105
105
 
106
106
  /// Array's flatten field infor is the same as its element's
107
107
  /// flatten infor.
108
108
  StInfo* elemStInfo = getStructInfo(elemTy);
109
- u32_t nfE = elemStInfo->getFlattenFieldInfoVec().size();
109
+ u32_t nfE = elemStInfo->getFlattenedFieldInfoVec().size();
110
110
  for (u32_t j = 0; j < nfE; j++)
111
111
  {
112
- u32_t idx = elemStInfo->getFlattenFieldInfoVec()[j].getFlattenFldIdx();
113
- u32_t off = elemStInfo->getFlattenFieldInfoVec()[j].getFlattenByteOffset();
114
- const Type* fieldTy = elemStInfo->getFlattenFieldInfoVec()[j].getFlattenElemTy();
115
- FieldInfo::ElemNumStridePairVec pair = elemStInfo->getFlattenFieldInfoVec()[j].getElemNumStridePairVect();
116
- /// append the additional number
117
- pair.push_back(std::make_pair(out_num, out_stride));
118
- FieldInfo field(idx, off, fieldTy, pair);
119
- stinfo->getFlattenFieldInfoVec().push_back(field);
112
+ u32_t idx = elemStInfo->getFlattenedFieldInfoVec()[j].getFlattenFldIdx();
113
+ const Type* fieldTy = elemStInfo->getFlattenedFieldInfoVec()[j].getFlattenElemTy();
114
+ FlattenedFieldInfo field(idx, fieldTy);
115
+ stinfo->getFlattenedFieldInfoVec().push_back(field);
120
116
  }
121
117
  }
122
118
 
@@ -139,36 +135,27 @@ void SymbolTableInfo::collectStructInfo(const StructType *sty)
139
135
  sty->element_end(); it != ie; ++it, ++field_idx)
140
136
  {
141
137
  const Type *et = *it;
142
- // This offset is computed after alignment with the current struct
143
- u64_t eOffsetInBytes = getTypeSizeInBytes(sty, field_idx);
144
- //The offset is where this element will be placed in the exp. struct.
145
- /// FIXME: As the layout size is uint_64, here we assume
146
138
  /// offset with uint_32 (Size_t) is large enough and will not cause overflow
147
- stinfo->addFldWithType(nf, static_cast<u32_t>(eOffsetInBytes), et);
139
+ stinfo->addFldWithType(nf, et);
148
140
 
149
141
  if (SVFUtil::isa<StructType>(et) || SVFUtil::isa<ArrayType>(et))
150
142
  {
151
143
  StInfo * subStinfo = getStructInfo(et);
152
- u32_t nfE = subStinfo->getFlattenFieldInfoVec().size();
144
+ u32_t nfE = subStinfo->getFlattenedFieldInfoVec().size();
153
145
  //Copy ST's info, whose element 0 is the size of ST itself.
154
146
  for (u32_t j = 0; j < nfE; j++)
155
147
  {
156
- u32_t fldIdx = nf + subStinfo->getFlattenFieldInfoVec()[j].getFlattenFldIdx();
157
- u32_t off = eOffsetInBytes + subStinfo->getFlattenFieldInfoVec()[j].getFlattenByteOffset();
158
- const Type* elemTy = subStinfo->getFlattenFieldInfoVec()[j].getFlattenElemTy();
159
- FieldInfo::ElemNumStridePairVec pair = subStinfo->getFlattenFieldInfoVec()[j].getElemNumStridePairVect();
160
- pair.push_back(std::make_pair(1, 0));
161
- FieldInfo field(fldIdx, off,elemTy,pair);
162
- stinfo->getFlattenFieldInfoVec().push_back(field);
148
+ u32_t fldIdx = nf + subStinfo->getFlattenedFieldInfoVec()[j].getFlattenFldIdx();
149
+ const Type* elemTy = subStinfo->getFlattenedFieldInfoVec()[j].getFlattenElemTy();
150
+ FlattenedFieldInfo field(fldIdx, elemTy);
151
+ stinfo->getFlattenedFieldInfoVec().push_back(field);
163
152
  }
164
153
  nf += nfE;
165
154
  }
166
155
  else //simple type
167
156
  {
168
- FieldInfo::ElemNumStridePairVec pair;
169
- pair.push_back(std::make_pair(1,0));
170
- FieldInfo field(nf, eOffsetInBytes, et,pair);
171
- stinfo->getFlattenFieldInfoVec().push_back(field);
157
+ FlattenedFieldInfo field(nf, et);
158
+ stinfo->getFlattenedFieldInfoVec().push_back(field);
172
159
  ++nf;
173
160
  }
174
161
  }
@@ -191,12 +178,10 @@ void SymbolTableInfo::collectSimpleTypeInfo(const Type* ty)
191
178
  typeToFieldInfo[ty] = stinfo;
192
179
 
193
180
  /// Only one field
194
- stinfo->addFldWithType(0,0, ty);
181
+ stinfo->addFldWithType(0, ty);
195
182
 
196
- FieldInfo::ElemNumStridePairVec pair;
197
- pair.push_back(std::make_pair(1,0));
198
- FieldInfo field(0, 0, ty, pair);
199
- stinfo->getFlattenFieldInfoVec().push_back(field);
183
+ FlattenedFieldInfo field(0, ty);
184
+ stinfo->getFlattenedFieldInfoVec().push_back(field);
200
185
  }
201
186
 
202
187
 
@@ -210,7 +195,7 @@ LocationSet SymbolTableInfo::getModulusOffset(const MemObj* obj, const LocationS
210
195
  /// of current struct. Make the offset positive so we can still get a node within current
211
196
  /// struct to represent this obj.
212
197
 
213
- Size_t offset = ls.getOffset();
198
+ Size_t offset = ls.accumulateConstantOffset();
214
199
  if(offset < 0)
215
200
  {
216
201
  writeWrnMsg("try to create a gep node with negative offset.");
@@ -294,10 +279,10 @@ bool SymbolTableInfo::isConstantObjSym(const Value *val)
294
279
  else
295
280
  {
296
281
  StInfo *stInfo = getStructInfo(v->getInitializer()->getType());
297
- const std::vector<FieldInfo> &fields = stInfo->getFlattenFieldInfoVec();
298
- for (std::vector<FieldInfo>::const_iterator it = fields.begin(), eit = fields.end(); it != eit; ++it)
282
+ const std::vector<FlattenedFieldInfo> &fields = stInfo->getFlattenedFieldInfoVec();
283
+ for (std::vector<FlattenedFieldInfo>::const_iterator it = fields.begin(), eit = fields.end(); it != eit; ++it)
299
284
  {
300
- const FieldInfo &field = *it;
285
+ const FlattenedFieldInfo &field = *it;
301
286
  const Type *elemTy = field.getFlattenElemTy();
302
287
  assert(!SVFUtil::isa<FunctionType>(elemTy) && "Initializer of a global is a function?");
303
288
  if (SVFUtil::isa<PointerType>(elemTy))
@@ -337,29 +322,23 @@ const MemObj* SymbolTableInfo::createDummyObj(SymID symId, const Type* type)
337
322
  return memObj;
338
323
  }
339
324
 
340
- const std::vector<u32_t>& SymbolTableInfo::getFattenFieldIdxVec(const Type *T)
325
+ const std::vector<u32_t>& SymbolTableInfo::getFlattenedFieldIdxVec(const Type *T)
341
326
  {
342
- return getStructInfoIter(T)->second->getFieldIdxVec();
327
+ return getStructInfoIter(T)->second->getFlattenedFieldIdxVec();
343
328
  }
344
329
 
345
- const std::vector<u32_t>& SymbolTableInfo::getFattenFieldOffsetVec(const Type *T)
330
+ const std::vector<FlattenedFieldInfo>& SymbolTableInfo::getFlattenedFieldInfoVec(const Type *T)
346
331
  {
347
- return getStructInfoIter(T)->second->getFieldOffsetVec();
332
+ return getStructInfoIter(T)->second->getFlattenedFieldInfoVec();
348
333
  }
349
334
 
350
- const std::vector<FieldInfo>& SymbolTableInfo::getFlattenFieldInfoVec(const Type *T)
335
+ const Type* SymbolTableInfo::getOriginalFieldType(const Type* baseType, u32_t field_idx)
351
336
  {
352
- return getStructInfoIter(T)->second->getFlattenFieldInfoVec();
337
+ return getStructInfoIter(baseType)->second->getOriginalFieldType(field_idx);
353
338
  }
354
339
 
355
- const Type* SymbolTableInfo::getOrigSubTypeWithFldInx(const Type* baseType, u32_t field_idx)
356
- {
357
- return getStructInfoIter(baseType)->second->getFieldTypeWithFldIdx(field_idx);
358
- }
359
-
360
- const Type* SymbolTableInfo::getOrigSubTypeWithByteOffset(const Type* baseType, u32_t byteOffset)
361
- {
362
- return getStructInfoIter(baseType)->second->getFieldTypeWithByteOffset(byteOffset);
340
+ const Type* SymbolTableInfo::getFlatternedFieldType(const Type* baseType, u32_t field_idx){
341
+ return getStructInfoIter(baseType)->second->getFlatternedFieldType(field_idx);
363
342
  }
364
343
 
365
344
  /*
@@ -383,21 +362,15 @@ void SymbolTableInfo::printFlattenFields(const Type* type)
383
362
  outs() <<" {Type: ";
384
363
  st->print(outs());
385
364
  outs() << "}\n";
386
- std::vector<FieldInfo>& finfo = getStructInfo(st)->getFlattenFieldInfoVec();
365
+ std::vector<FlattenedFieldInfo>& finfo = getStructInfo(st)->getFlattenedFieldInfoVec();
387
366
  int field_idx = 0;
388
- for(std::vector<FieldInfo>::iterator it = finfo.begin(), eit = finfo.end();
367
+ for(std::vector<FlattenedFieldInfo>::iterator it = finfo.begin(), eit = finfo.end();
389
368
  it!=eit; ++it, field_idx++)
390
369
  {
391
- outs() << " \tField_idx = " << (*it).getFlattenFldIdx() << " [offset: " << (*it).getFlattenByteOffset();
370
+ outs() << " \tField_idx = " << (*it).getFlattenFldIdx();
392
371
  outs() << ", field type: ";
393
372
  (*it).getFlattenElemTy()->print(outs());
394
373
  outs() << ", field size: " << getTypeSizeInBytes((*it).getFlattenElemTy());
395
- outs() << ", field stride pair: ";
396
- for(FieldInfo::ElemNumStridePairVec::const_iterator pit = (*it).elemStridePairBegin(),
397
- peit = (*it).elemStridePairEnd(); pit!=peit; ++pit)
398
- {
399
- outs() << "[ " << pit->first << ", " << pit->second << " ] ";
400
- }
401
374
  outs() << "\n";
402
375
  }
403
376
  outs() << "\n";
@@ -576,12 +549,12 @@ bool ObjTypeInfo::isNonPtrFieldObj(const LocationSet& ls)
576
549
  if (SVFUtil::isa<StructType>(ety) || SVFUtil::isa<ArrayType>(ety))
577
550
  {
578
551
  bool hasIntersection = false;
579
- const vector<FieldInfo> &infovec = SymbolTableInfo::SymbolInfo()->getFlattenFieldInfoVec(ety);
580
- vector<FieldInfo>::const_iterator it = infovec.begin();
581
- vector<FieldInfo>::const_iterator eit = infovec.end();
552
+ const vector<FlattenedFieldInfo> &infovec = SymbolTableInfo::SymbolInfo()->getFlattenedFieldInfoVec(ety);
553
+ vector<FlattenedFieldInfo>::const_iterator it = infovec.begin();
554
+ vector<FlattenedFieldInfo>::const_iterator eit = infovec.end();
582
555
  for (; it != eit; ++it)
583
556
  {
584
- const FieldInfo& fieldLS = *it;
557
+ const FlattenedFieldInfo& fieldLS = *it;
585
558
  if (ls.intersects(LocationSet(fieldLS)))
586
559
  {
587
560
  hasIntersection = true;
@@ -73,7 +73,7 @@ void SaberSVFGBuilder::collectGlobals(BVDataPTAImpl* pta)
73
73
  if(SVFUtil::isa<DummyValVar>(pagNode) || SVFUtil::isa<DummyObjVar>(pagNode))
74
74
  continue;
75
75
 
76
- if(GepObjPN* gepobj = SVFUtil::dyn_cast<GepObjPN>(pagNode)) {
76
+ if(GepObjVar* gepobj = SVFUtil::dyn_cast<GepObjVar>(pagNode)) {
77
77
  if(SVFUtil::isa<DummyObjVar>(pag->getGNode(gepobj->getBaseNode())))
78
78
  continue;
79
79
  }
@@ -212,13 +212,12 @@ bool SVFIRBuilder::computeGepOffset(const User *V, LocationSet& ls)
212
212
  if(gepOp && dataLayout && gepOp->accumulateConstantOffset(*dataLayout,byteOffset))
213
213
  {
214
214
  Size_t bo = byteOffset.getSExtValue();
215
- ls.setByteOffset(bo + ls.getByteOffset());
216
215
  }
217
216
 
218
217
  for (bridge_gep_iterator gi = bridge_gep_begin(*V), ge = bridge_gep_end(*V);
219
218
  gi != ge; ++gi)
220
219
  {
221
-
220
+ ls.addOffsetValue(gi.getOperand());
222
221
  // Handling array types, skipe array handling here
223
222
  // We treat whole array as one, then we can distinguish different field of an array of struct
224
223
  // e.g. s[1].f1 is differet from s[0].f2
@@ -257,14 +256,14 @@ bool SVFIRBuilder::computeGepOffset(const User *V, LocationSet& ls)
257
256
  if (const StructType *ST = SVFUtil::dyn_cast<StructType>(*gi) )
258
257
  {
259
258
  assert(op && "non-const struct index in GEP");
260
- const vector<u32_t> &so = SymbolTableInfo::SymbolInfo()->getFattenFieldIdxVec(ST);
259
+ const vector<u32_t> &so = SymbolTableInfo::SymbolInfo()->getFlattenedFieldIdxVec(ST);
261
260
  if ((unsigned)idx >= so.size())
262
261
  {
263
262
  outs() << "!! Struct index out of bounds" << idx << "\n";
264
263
  assert(0);
265
264
  }
266
265
  //add the translated offset
267
- ls.setFldIdx(ls.getOffset() + so[idx]);
266
+ ls.setFldIdx(ls.accumulateConstantOffset() + so[idx]);
268
267
  }
269
268
  }
270
269
  return true;
@@ -483,7 +482,7 @@ void SVFIRBuilder::InitialGlobal(const GlobalVariable *gvar, Constant *C,
483
482
  {
484
483
  const StructType *sty = SVFUtil::cast<StructType>(C->getType());
485
484
  const std::vector<u32_t>& offsetvect =
486
- SymbolTableInfo::SymbolInfo()->getFattenFieldIdxVec(sty);
485
+ SymbolTableInfo::SymbolInfo()->getFlattenedFieldIdxVec(sty);
487
486
  for (u32_t i = 0, e = C->getNumOperands(); i != e; i++)
488
487
  {
489
488
  u32_t off = offsetvect[i];
@@ -1290,7 +1289,7 @@ void SVFIRBuilder::handleExtCall(CallSite cs, const SVFFunction *callee)
1290
1289
  // We have vArg3 points to the entry of _Rb_tree_node_base { color; parent; left; right; }.
1291
1290
  // Now we calculate the offset from base to vArg3
1292
1291
  NodeID vnArg3 = pag->getValueNode(vArg3);
1293
- Size_t offset = pag->getLocationSetFromBaseNode(vnArg3).getOffset();
1292
+ Size_t offset = pag->getLocationSetFromBaseNode(vnArg3).accumulateConstantOffset();
1294
1293
 
1295
1294
  // We get all flattened fields of base
1296
1295
  vector<LocationSet> fields;
@@ -1314,7 +1313,7 @@ void SVFIRBuilder::handleExtCall(CallSite cs, const SVFFunction *callee)
1314
1313
 
1315
1314
  Value *vArg = cs.getArgument(0);
1316
1315
  NodeID vnArg = pag->getValueNode(vArg);
1317
- Size_t offset = pag->getLocationSetFromBaseNode(vnArg).getOffset();
1316
+ Size_t offset = pag->getLocationSetFromBaseNode(vnArg).accumulateConstantOffset();
1318
1317
 
1319
1318
  // We get all fields
1320
1319
  vector<LocationSet> fields;
@@ -1523,7 +1522,7 @@ NodeID SVFIRBuilder::getGepValVar(const Value* val, const LocationSet& ls, const
1523
1522
  * 2. GlobalVariable
1524
1523
  */
1525
1524
  assert((SVFUtil::isa<Instruction>(curVal) || SVFUtil::isa<GlobalVariable>(curVal)) && "curVal not an instruction or a globalvariable?");
1526
- const std::vector<FieldInfo> &fieldinfo = SymbolTableInfo::SymbolInfo()->getFlattenFieldInfoVec(baseType);
1525
+ const std::vector<FlattenedFieldInfo> &fieldinfo = SymbolTableInfo::SymbolInfo()->getFlattenedFieldInfoVec(baseType);
1527
1526
  const Type *type = fieldinfo[fieldidx].getFlattenElemTy();
1528
1527
 
1529
1528
  // We assume every GepValNode and its GepEdge to the baseNode are unique across the whole program
@@ -1627,13 +1626,13 @@ u32_t SVFIRBuilder::getFields(std::vector<LocationSet>& fields, const Type* T, u
1627
1626
  return 0;
1628
1627
 
1629
1628
  T = T->getContainedType(0);
1630
- const std::vector<FieldInfo>& stVec = SymbolTableInfo::SymbolInfo()->getFlattenFieldInfoVec(T);
1629
+ const std::vector<FlattenedFieldInfo>& stVec = SymbolTableInfo::SymbolInfo()->getFlattenedFieldInfoVec(T);
1631
1630
  u32_t sz = stVec.size();
1632
1631
  if (msz < sz)
1633
1632
  {
1634
1633
  /// Replace fields with T's flatten fields.
1635
1634
  fields.clear();
1636
- for(std::vector<FieldInfo>::const_iterator it = stVec.begin(), eit = stVec.end(); it!=eit; ++it)
1635
+ for(std::vector<FlattenedFieldInfo>::const_iterator it = stVec.begin(), eit = stVec.end(); it!=eit; ++it)
1637
1636
  fields.push_back(LocationSet(*it));
1638
1637
  }
1639
1638
 
@@ -444,7 +444,7 @@ void SymbolTableBuilder::handleGlobalInitializerCE(const Constant *C,
444
444
  {
445
445
  const StructType *sty = SVFUtil::cast<StructType>(C->getType());
446
446
  const std::vector<u32_t>& offsetvect =
447
- SymbolTableInfo::SymbolInfo()->getFattenFieldIdxVec(sty);
447
+ SymbolTableInfo::SymbolInfo()->getFlattenedFieldIdxVec(sty);
448
448
  for (u32_t i = 0, e = C->getNumOperands(); i != e; i++)
449
449
  {
450
450
  u32_t off = offsetvect[i];
@@ -515,8 +515,8 @@ void SymbolTableBuilder::analyzeGlobalStackObjType(ObjTypeInfo* typeinfo, const
515
515
  }
516
516
  if (const StructType *ST= SVFUtil::dyn_cast<StructType>(elemTy))
517
517
  {
518
- const std::vector<FieldInfo>& flattenFields = SymbolTableInfo::SymbolInfo()->getFlattenFieldInfoVec(ST);
519
- for(std::vector<FieldInfo>::const_iterator it = flattenFields.begin(), eit = flattenFields.end();
518
+ const std::vector<FlattenedFieldInfo>& flattenFields = SymbolTableInfo::SymbolInfo()->getFlattenedFieldInfoVec(ST);
519
+ for(std::vector<FlattenedFieldInfo>::const_iterator it = flattenFields.begin(), eit = flattenFields.end();
520
520
  it!=eit; ++it)
521
521
  {
522
522
  if((*it).getFlattenElemTy()->isPointerTy())
@@ -600,7 +600,7 @@ u32_t SymbolTableBuilder::getObjSize(const Value* val)
600
600
  u32_t numOfFields = 1;
601
601
  if (SVFUtil::isa<StructType>(ety) || SVFUtil::isa<ArrayType>(ety))
602
602
  {
603
- numOfFields = SymbolTableInfo::SymbolInfo()->getFlattenFieldInfoVec(ety).size();
603
+ numOfFields = SymbolTableInfo::SymbolInfo()->getFlattenedFieldInfoVec(ety).size();
604
604
  }
605
605
  return numOfFields;
606
606
  }
@@ -153,9 +153,9 @@ const NodeBS TypeBasedHeapCloning::getGepObjClones(NodeID base, unsigned offset)
153
153
  // totalOffset is the offset from the real base (i.e. base of base),
154
154
  // offset is the offset into base, whether it is a field itself or not.
155
155
  unsigned totalOffset = offset;
156
- if (const GepObjPN *baseGep = SVFUtil::dyn_cast<GepObjPN>(baseNode))
156
+ if (const GepObjVar *baseGep = SVFUtil::dyn_cast<GepObjVar>(baseNode))
157
157
  {
158
- totalOffset += baseGep->getLocationSet().getOffset();
158
+ totalOffset += baseGep->getOffset();
159
159
  }
160
160
 
161
161
  const DIType *baseType = getType(base);
@@ -184,12 +184,12 @@ const NodeBS TypeBasedHeapCloning::getGepObjClones(NodeID base, unsigned offset)
184
184
  {
185
185
  PAGNode *node = ppag->getGNode(gep);
186
186
  assert(node && "TBHC: expected gep node doesn't exist.");
187
- assert((SVFUtil::isa<GepObjPN>(node) || SVFUtil::isa<FIObjVar>(node))
187
+ assert((SVFUtil::isa<GepObjVar>(node) || SVFUtil::isa<FIObjVar>(node))
188
188
  && "TBHC: expected a GEP or FI object.");
189
189
 
190
- if (GepObjPN *gepNode = SVFUtil::dyn_cast<GepObjPN>(node))
190
+ if (GepObjVar *gepNode = SVFUtil::dyn_cast<GepObjVar>(node))
191
191
  {
192
- if (gepNode->getLocationSet().getOffset() == totalOffset)
192
+ if (gepNode->getOffset() == totalOffset)
193
193
  {
194
194
  geps.set(gep);
195
195
  }
@@ -225,7 +225,7 @@ const NodeBS TypeBasedHeapCloning::getGepObjClones(NodeID base, unsigned offset)
225
225
  newGep = ppag->getGepObjVar(base, newLS);
226
226
  }
227
227
 
228
- if (GepObjPN *gep = SVFUtil::dyn_cast<GepObjPN>(ppag->getGNode(newGep)))
228
+ if (GepObjVar *gep = SVFUtil::dyn_cast<GepObjVar>(ppag->getGNode(newGep)))
229
229
  {
230
230
  gep->setBaseNode(base);
231
231
  }
@@ -412,9 +412,9 @@ NodeID TypeBasedHeapCloning::cloneObject(NodeID o, const DIType *type, bool)
412
412
  {
413
413
  NodeID clone;
414
414
  const PAGNode *obj = ppag->getGNode(o);
415
- if (const GepObjPN *gepObj = SVFUtil::dyn_cast<GepObjPN>(obj))
415
+ if (const GepObjVar *gepObj = SVFUtil::dyn_cast<GepObjVar>(obj))
416
416
  {
417
- const NodeBS &clones = getGepObjClones(gepObj->getBaseNode(), gepObj->getLocationSet().getOffset());
417
+ const NodeBS &clones = getGepObjClones(gepObj->getBaseNode(), gepObj->getOffset());
418
418
  // TODO: a bit of repetition.
419
419
  for (NodeID clone : clones)
420
420
  {
@@ -427,7 +427,7 @@ NodeID TypeBasedHeapCloning::cloneObject(NodeID o, const DIType *type, bool)
427
427
  clone = addCloneGepObjNode(gepObj->getMemObj(), gepObj->getLocationSet());
428
428
 
429
429
  // The base needs to know about the new clone.
430
- addGepToObj(clone, gepObj->getBaseNode(), gepObj->getLocationSet().getOffset());
430
+ addGepToObj(clone, gepObj->getBaseNode(), gepObj->getOffset());
431
431
 
432
432
  addClone(o, clone);
433
433
  addClone(getOriginalObj(o), clone);
@@ -539,7 +539,7 @@ const DIType *TypeBasedHeapCloning::getTypeFromCTirMetadata(const Value *v)
539
539
  bool TypeBasedHeapCloning::isGep(const PAGNode *n) const
540
540
  {
541
541
  assert(n != nullptr && "TBHC: testing if null is a GEP object!");
542
- return SVFUtil::isa<GepObjPN>(n);
542
+ return SVFUtil::isa<GepObjVar>(n);
543
543
  }
544
544
 
545
545
  /// Returns true if the function name matches MAYALIAS, NOALIAS, etc.
@@ -166,7 +166,7 @@ void AndersenBase::normalizePointsTo()
166
166
  // for redundant gepnodes and remove those nodes from pag
167
167
  for (NodeID n: redundantGepNodes) {
168
168
  NodeID base = pag->getBaseObjVar(n);
169
- GepObjPN *gepNode = SVFUtil::dyn_cast<GepObjPN>(pag->getGNode(n));
169
+ GepObjVar *gepNode = SVFUtil::dyn_cast<GepObjVar>(pag->getGNode(n));
170
170
  assert(gepNode && "Not a gep node in redundantGepNodes set");
171
171
  const LocationSet ls = gepNode->getLocationSet();
172
172
  GepObjVarMap.erase(std::make_pair(base, ls));
@@ -133,8 +133,8 @@ void AndersenSFR::fieldExpand(NodeSet& initials, Size_t offset, NodeBS& strides,
133
133
  const MemObj* obj = pag->getBaseObj(init);
134
134
  const Size_t maxLimit = obj->getMaxFieldOffsetLimit();
135
135
  Size_t initOffset;
136
- if (GepObjPN *gepNode = SVFUtil::dyn_cast<GepObjPN>(initPN))
137
- initOffset = gepNode->getLocationSet().getOffset();
136
+ if (GepObjVar *gepNode = SVFUtil::dyn_cast<GepObjVar>(initPN))
137
+ initOffset = gepNode->getOffset();
138
138
  else if (SVFUtil::isa<FIObjVar>(initPN) || SVFUtil::isa<DummyObjVar>(initPN))
139
139
  initOffset = 0;
140
140
  else