svf-tools 1.0.328 → 1.0.332
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.
- package/SVF-doxygen/html/html/AndersenHCD_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/AndersenSCD_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/AndersenSFR_8cpp_source.html +7 -7
- package/SVF-doxygen/html/html/AndersenSFR_8h_source.html +4 -4
- package/SVF-doxygen/html/html/AndersenWaveDiff_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/Andersen_8cpp_source.html +38 -38
- package/SVF-doxygen/html/html/Andersen_8h_source.html +6 -6
- package/SVF-doxygen/html/html/CSC_8cpp_source.html +2 -3
- package/SVF-doxygen/html/html/ConsGEdge_8h_source.html +3 -3
- package/SVF-doxygen/html/html/ConsGNode_8h_source.html +5 -5
- package/SVF-doxygen/html/html/ConsG_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/ConsG_8h_source.html +4 -4
- package/SVF-doxygen/html/html/ContextDDA_8cpp_source.html +6 -6
- package/SVF-doxygen/html/html/ContextDDA_8h_source.html +1 -1
- package/SVF-doxygen/html/html/DDAClient_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/DDAStat_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/DDAVFSolver_8h_source.html +6 -6
- package/SVF-doxygen/html/html/FSMPTA_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/FlowDDA_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/FlowDDA_8h_source.html +2 -2
- package/SVF-doxygen/html/html/FlowSensitiveStat_8cpp_source.html +3 -3
- package/SVF-doxygen/html/html/FlowSensitiveTBHC_8cpp_source.html +3 -3
- package/SVF-doxygen/html/html/FlowSensitive_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/ICFGNode_8h_source.html +3 -3
- package/SVF-doxygen/html/html/IRAnnotator_8h_source.html +6 -7
- package/SVF-doxygen/html/html/IRGraph_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/IRGraph_8h_source.html +1 -1
- package/SVF-doxygen/html/html/LocationSet_8cpp.html +1 -0
- package/SVF-doxygen/html/html/LocationSet_8cpp_source.html +12 -15
- package/SVF-doxygen/html/html/LocationSet_8h.html +1 -1
- package/SVF-doxygen/html/html/LocationSet_8h_source.html +26 -40
- package/SVF-doxygen/html/html/MemRegion_8cpp_source.html +5 -5
- package/SVF-doxygen/html/html/OfflineConsG_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/PAGBuilderFromFile_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/PTAStat_8cpp_source.html +15 -15
- package/SVF-doxygen/html/html/PointerAnalysisImpl_8cpp_source.html +10 -10
- package/SVF-doxygen/html/html/PointerAnalysisImpl_8h_source.html +2 -2
- package/SVF-doxygen/html/html/PointerAnalysis_8cpp_source.html +28 -29
- package/SVF-doxygen/html/html/PointerAnalysis_8h_source.html +29 -29
- package/SVF-doxygen/html/html/SVFIRBuilder_8cpp_source.html +12 -4
- package/SVF-doxygen/html/html/SVFIRBuilder_8h_source.html +71 -70
- package/SVF-doxygen/html/html/SVFIR_8cpp_source.html +12 -12
- package/SVF-doxygen/html/html/SVFIR_8h_source.html +12 -12
- package/SVF-doxygen/html/html/SVFStatements_8h_source.html +3 -3
- package/SVF-doxygen/html/html/SVFVariables_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/SVFVariables_8h.html +1 -1
- package/SVF-doxygen/html/html/SVFVariables_8h_source.html +69 -69
- package/SVF-doxygen/html/html/SaberSVFGBuilder_8cpp_source.html +4 -4
- package/SVF-doxygen/html/html/Steensgaard_8h_source.html +1 -1
- package/SVF-doxygen/html/html/SymbolTableBuilder_8cpp_source.html +21 -21
- package/SVF-doxygen/html/html/SymbolTableBuilder_8h_source.html +1 -1
- package/SVF-doxygen/html/html/SymbolTableInfo_8cpp_source.html +52 -63
- package/SVF-doxygen/html/html/SymbolTableInfo_8h_source.html +72 -79
- package/SVF-doxygen/html/html/ThreadCallGraph_8cpp_source.html +3 -3
- package/SVF-doxygen/html/html/TypeAnalysis_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/TypeBasedHeapCloning_8cpp_source.html +13 -13
- package/SVF-doxygen/html/html/TypeBasedHeapCloning_8h_source.html +2 -2
- package/SVF-doxygen/html/html/VersionedFlowSensitiveStat_8cpp_source.html +3 -3
- package/SVF-doxygen/html/html/annotated.html +6 -6
- package/SVF-doxygen/html/html/classSVF_1_1Andersen-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1Andersen.html +79 -79
- package/SVF-doxygen/html/html/classSVF_1_1AndersenBase-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1AndersenBase.html +23 -24
- package/SVF-doxygen/html/html/classSVF_1_1AndersenHCD-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1AndersenHCD.html +9 -9
- package/SVF-doxygen/html/html/classSVF_1_1AndersenHLCD-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1AndersenHLCD.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1AndersenLCD-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1AndersenLCD.html +11 -11
- package/SVF-doxygen/html/html/classSVF_1_1AndersenSCD-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1AndersenSCD.html +13 -13
- package/SVF-doxygen/html/html/classSVF_1_1AndersenSFR-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1AndersenSFR.html +13 -13
- package/SVF-doxygen/html/html/classSVF_1_1AndersenWaveDiff-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1AndersenWaveDiff.html +11 -11
- package/SVF-doxygen/html/html/classSVF_1_1BVDataPTAImpl-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1BVDataPTAImpl.html +17 -17
- package/SVF-doxygen/html/html/classSVF_1_1CSC.html +2 -3
- package/SVF-doxygen/html/html/classSVF_1_1CallBlockNode-members.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1CallBlockNode.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1CloneDummyObjVar.html +11 -11
- package/SVF-doxygen/html/html/classSVF_1_1CloneFIObjVar.html +11 -11
- package/SVF-doxygen/html/html/classSVF_1_1CloneGepObjVar-members.html +56 -55
- package/SVF-doxygen/html/html/classSVF_1_1CloneGepObjVar.html +44 -41
- package/SVF-doxygen/html/html/classSVF_1_1CloneGepObjVar.png +0 -0
- package/SVF-doxygen/html/html/classSVF_1_1CondPTAImpl-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1CondPTAImpl.html +7 -7
- package/SVF-doxygen/html/html/classSVF_1_1ConstraintGraph.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1ConstraintNode-members.html +26 -26
- package/SVF-doxygen/html/html/classSVF_1_1ConstraintNode.html +43 -43
- package/SVF-doxygen/html/html/classSVF_1_1ContextDDA-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1ContextDDA.html +9 -9
- package/SVF-doxygen/html/html/classSVF_1_1DDAPass.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1DDAStat.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1DDAVFSolver.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1DummyObjVar.html +11 -11
- package/SVF-doxygen/html/html/classSVF_1_1DummyValVar.html +11 -11
- package/SVF-doxygen/html/html/classSVF_1_1FIObjVar.html +13 -13
- package/SVF-doxygen/html/html/classSVF_1_1FSMPTA-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1FSMPTA.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1FlattenedFieldInfo-members.html +85 -0
- package/SVF-doxygen/html/html/classSVF_1_1FlattenedFieldInfo.html +254 -0
- package/SVF-doxygen/html/html/classSVF_1_1FlowDDA-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1FlowDDA.html +7 -7
- package/SVF-doxygen/html/html/classSVF_1_1FlowSensitive-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1FlowSensitive.html +9 -9
- package/SVF-doxygen/html/html/classSVF_1_1FlowSensitiveStat.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1FlowSensitiveTBHC-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1FlowSensitiveTBHC.html +10 -10
- package/SVF-doxygen/html/html/classSVF_1_1FunEntryBlockNode-members.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1FunEntryBlockNode.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1FunExitBlockNode-members.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1FunExitBlockNode.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1FunptrDDAClient.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1GenericNode.html +22 -23
- package/SVF-doxygen/html/html/classSVF_1_1GenericNode.png +0 -0
- package/SVF-doxygen/html/html/classSVF_1_1GepObjPN.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1GepObjVar-members.html +173 -0
- package/SVF-doxygen/html/html/classSVF_1_1GepObjVar.html +813 -0
- package/SVF-doxygen/html/html/classSVF_1_1GepObjVar.png +0 -0
- package/SVF-doxygen/html/html/classSVF_1_1GepValVar.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1GlobalBlockNode-members.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1GlobalBlockNode.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1ICFGNode-members.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1ICFGNode.html +10 -10
- package/SVF-doxygen/html/html/classSVF_1_1IRAnnotator-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1IRAnnotator.html +8 -8
- package/SVF-doxygen/html/html/classSVF_1_1InterBlockNode-members.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1InterBlockNode.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1IntraBlockNode-members.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1IntraBlockNode.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1LocationSet-members.html +17 -21
- package/SVF-doxygen/html/html/classSVF_1_1LocationSet.html +150 -326
- package/SVF-doxygen/html/html/classSVF_1_1MRGenerator.html +6 -6
- package/SVF-doxygen/html/html/classSVF_1_1MemObj.html +84 -84
- package/SVF-doxygen/html/html/classSVF_1_1NormalGepCGEdge.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1NormalGepStmt.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1ObjTypeInfo.html +96 -96
- package/SVF-doxygen/html/html/classSVF_1_1ObjVar.html +5 -5
- package/SVF-doxygen/html/html/classSVF_1_1ObjVar.png +0 -0
- package/SVF-doxygen/html/html/classSVF_1_1PAGBuilderFromFile.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1PTAStat.html +15 -15
- package/SVF-doxygen/html/html/classSVF_1_1PointerAnalysis-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1PointerAnalysis.html +75 -73
- package/SVF-doxygen/html/html/classSVF_1_1RetBlockNode-members.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1RetBlockNode.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1RetPN.html +11 -11
- package/SVF-doxygen/html/html/classSVF_1_1SVFIR.html +26 -26
- package/SVF-doxygen/html/html/classSVF_1_1SVFIRBuilder-members.html +57 -56
- package/SVF-doxygen/html/html/classSVF_1_1SVFIRBuilder.html +302 -230
- package/SVF-doxygen/html/html/classSVF_1_1SVFVar.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1SVFVar.png +0 -0
- package/SVF-doxygen/html/html/classSVF_1_1SaberSVFGBuilder.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1StInfo-members.html +11 -14
- package/SVF-doxygen/html/html/classSVF_1_1StInfo.html +70 -168
- package/SVF-doxygen/html/html/classSVF_1_1Steensgaard-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1Steensgaard.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1SymbolTableBuilder.html +30 -30
- package/SVF-doxygen/html/html/classSVF_1_1SymbolTableInfo-members.html +20 -24
- package/SVF-doxygen/html/html/classSVF_1_1SymbolTableInfo.html +109 -291
- package/SVF-doxygen/html/html/classSVF_1_1ThreadCallGraph.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1TypeAnalysis-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1TypeAnalysis.html +9 -9
- package/SVF-doxygen/html/html/classSVF_1_1TypeBasedHeapCloning.html +18 -18
- package/SVF-doxygen/html/html/classSVF_1_1VarArgPN.html +11 -11
- package/SVF-doxygen/html/html/classSVF_1_1VersionedFlowSensitive-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1VersionedFlowSensitive.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1VersionedFlowSensitiveStat.html +3 -3
- package/SVF-doxygen/html/html/classes.html +6 -6
- package/SVF-doxygen/html/html/functions_a.html +15 -12
- package/SVF-doxygen/html/html/functions_b.html +1 -5
- package/SVF-doxygen/html/html/functions_c.html +19 -20
- package/SVF-doxygen/html/html/functions_d.html +1 -1
- package/SVF-doxygen/html/html/functions_e.html +0 -16
- package/SVF-doxygen/html/html/functions_f.html +21 -19
- package/SVF-doxygen/html/html/functions_func.html +14 -11
- package/SVF-doxygen/html/html/functions_func_c.html +16 -17
- package/SVF-doxygen/html/html/functions_func_d.html +1 -1
- package/SVF-doxygen/html/html/functions_func_e.html +2 -8
- package/SVF-doxygen/html/html/functions_func_f.html +4 -4
- package/SVF-doxygen/html/html/functions_func_g.html +43 -65
- package/SVF-doxygen/html/html/functions_func_i.html +11 -14
- package/SVF-doxygen/html/html/functions_func_s.html +6 -9
- package/SVF-doxygen/html/html/functions_func_t.html +1 -1
- package/SVF-doxygen/html/html/functions_func_w.html +1 -1
- package/SVF-doxygen/html/html/functions_g.html +44 -66
- package/SVF-doxygen/html/html/functions_i.html +6 -9
- package/SVF-doxygen/html/html/functions_l.html +4 -4
- package/SVF-doxygen/html/html/functions_n.html +4 -7
- package/SVF-doxygen/html/html/functions_o.html +25 -20
- package/SVF-doxygen/html/html/functions_p.html +12 -16
- package/SVF-doxygen/html/html/functions_s.html +17 -20
- package/SVF-doxygen/html/html/functions_t.html +6 -8
- package/SVF-doxygen/html/html/functions_type_e.html +0 -4
- package/SVF-doxygen/html/html/functions_type_o.html +3 -0
- package/SVF-doxygen/html/html/functions_vars_b.html +1 -5
- package/SVF-doxygen/html/html/functions_vars_c.html +1 -1
- package/SVF-doxygen/html/html/functions_vars_e.html +0 -6
- package/SVF-doxygen/html/html/functions_vars_f.html +9 -7
- package/SVF-doxygen/html/html/functions_vars_l.html +1 -1
- package/SVF-doxygen/html/html/functions_vars_n.html +0 -3
- package/SVF-doxygen/html/html/functions_vars_o.html +2 -2
- package/SVF-doxygen/html/html/functions_w.html +6 -10
- package/SVF-doxygen/html/html/hierarchy.html +64 -64
- package/SVF-doxygen/html/html/namespaceSVF.html +3 -3
- package/SVF-doxygen/html/html/search/all_1.js +4 -3
- package/SVF-doxygen/html/html/search/all_10.js +6 -6
- package/SVF-doxygen/html/html/search/all_12.js +1 -1
- package/SVF-doxygen/html/html/search/all_13.js +4 -5
- package/SVF-doxygen/html/html/search/all_14.js +6 -6
- package/SVF-doxygen/html/html/search/all_15.js +1 -1
- package/SVF-doxygen/html/html/search/all_17.js +2 -2
- package/SVF-doxygen/html/html/search/all_2.js +2 -3
- package/SVF-doxygen/html/html/search/all_3.js +5 -5
- package/SVF-doxygen/html/html/search/all_4.js +1 -1
- package/SVF-doxygen/html/html/search/all_5.js +0 -5
- package/SVF-doxygen/html/html/search/all_6.js +6 -5
- package/SVF-doxygen/html/html/search/all_7.js +16 -24
- package/SVF-doxygen/html/html/search/all_9.js +2 -3
- package/SVF-doxygen/html/html/search/all_c.js +4 -4
- package/SVF-doxygen/html/html/search/all_e.js +1 -2
- package/SVF-doxygen/html/html/search/all_f.js +5 -4
- package/SVF-doxygen/html/html/search/classes_5.js +1 -1
- package/SVF-doxygen/html/html/search/classes_6.js +1 -1
- package/SVF-doxygen/html/html/search/functions_0.js +4 -3
- package/SVF-doxygen/html/html/search/functions_10.js +2 -3
- package/SVF-doxygen/html/html/search/functions_11.js +1 -1
- package/SVF-doxygen/html/html/search/functions_14.js +1 -1
- package/SVF-doxygen/html/html/search/functions_2.js +3 -3
- package/SVF-doxygen/html/html/search/functions_3.js +1 -1
- package/SVF-doxygen/html/html/search/functions_4.js +0 -2
- package/SVF-doxygen/html/html/search/functions_5.js +1 -1
- package/SVF-doxygen/html/html/search/functions_6.js +16 -24
- package/SVF-doxygen/html/html/search/functions_8.js +1 -2
- package/SVF-doxygen/html/html/search/functions_a.js +1 -1
- package/SVF-doxygen/html/html/search/functions_e.js +1 -1
- package/SVF-doxygen/html/html/search/typedefs_4.js +0 -1
- package/SVF-doxygen/html/html/search/typedefs_e.js +1 -0
- package/SVF-doxygen/html/html/search/variables_14.js +2 -2
- package/SVF-doxygen/html/html/search/variables_15.js +1 -1
- package/SVF-doxygen/html/html/search/variables_2.js +2 -3
- package/SVF-doxygen/html/html/search/variables_3.js +1 -1
- package/SVF-doxygen/html/html/search/variables_5.js +0 -2
- package/SVF-doxygen/html/html/search/variables_6.js +5 -4
- package/SVF-doxygen/html/html/search/variables_c.js +1 -1
- package/SVF-doxygen/html/html/search/variables_e.js +0 -1
- package/SVF-doxygen/html/html/search/variables_f.js +1 -1
- package/SVF-doxygen/html/html/structllvm_1_1DOTGraphTraits_3_01ConstraintGraph_01_5_01_4.html +1 -1
- package/SVF-doxygen/html/html/structllvm_1_1DOTGraphTraits_3_01IRGraph_01_5_01_4.html +1 -1
- package/SVF-doxygen/html/html/structllvm_1_1DOTGraphTraits_3_01OfflineConsG_01_5_01_4.html +1 -1
- package/SVF-doxygen/html/html/structstd_1_1hash_3_01SVF_1_1LocationSet_01_4.html +5 -5
- package/include/Graphs/ConsG.h +1 -1
- package/include/Graphs/ConsGEdge.h +1 -1
- package/include/Graphs/ICFGNode.h +2 -2
- package/include/MemoryModel/LocationSet.h +39 -126
- package/include/MemoryModel/PointerAnalysis.h +1 -1
- package/include/MemoryModel/SVFIR.h +1 -1
- package/include/MemoryModel/SVFStatements.h +1 -1
- package/include/MemoryModel/SVFVariables.h +17 -11
- package/include/MemoryModel/SymbolTableInfo.h +27 -31
- package/include/SVF-FE/SVFIRBuilder.h +6 -1
- package/include/Util/IRAnnotator.h +3 -3
- package/lib/DDA/ContextDDA.cpp +1 -1
- package/lib/Graphs/ConsG.cpp +1 -1
- package/lib/Graphs/IRGraph.cpp +1 -1
- package/lib/Graphs/OfflineConsG.cpp +1 -1
- package/lib/MemoryModel/LocationSet.cpp +53 -95
- package/lib/MemoryModel/PointerAnalysis.cpp +4 -2
- package/lib/MemoryModel/PointerAnalysisImpl.cpp +4 -4
- package/lib/MemoryModel/SVFIR.cpp +4 -4
- package/lib/MemoryModel/SVFVariables.cpp +2 -2
- package/lib/MemoryModel/SymbolTableInfo.cpp +36 -210
- package/lib/SABER/SaberSVFGBuilder.cpp +1 -1
- package/lib/SVF-FE/SVFIRBuilder.cpp +136 -8
- package/lib/SVF-FE/SymbolTableBuilder.cpp +4 -4
- package/lib/Util/TypeBasedHeapCloning.cpp +10 -10
- package/lib/WPA/Andersen.cpp +1 -5
- package/lib/WPA/AndersenSFR.cpp +2 -2
- package/lib/WPA/CSC.cpp +1 -1
- package/lib/WPA/FlowSensitiveTBHC.cpp +6 -6
- 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
|
|
40
|
+
* Add offset value to vector offsetValues
|
|
40
41
|
*/
|
|
41
|
-
|
|
42
|
+
bool LocationSet::addOffsetValue(const Value* offsetVal)
|
|
42
43
|
{
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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(
|
|
68
|
+
result.set(accumulateConstantOffset());
|
|
69
|
+
return result;
|
|
70
|
+
}
|
|
120
71
|
|
|
121
|
-
|
|
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
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
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
|
+
}
|
|
@@ -53,7 +53,6 @@ using namespace SVFUtil;
|
|
|
53
53
|
using namespace cppUtil;
|
|
54
54
|
|
|
55
55
|
|
|
56
|
-
CommonCHGraph* PointerAnalysis::chgraph = nullptr;
|
|
57
56
|
SVFIR* PointerAnalysis::pag = nullptr;
|
|
58
57
|
|
|
59
58
|
const std::string PointerAnalysis::aliasTestMayAlias = "MAYALIAS";
|
|
@@ -73,7 +72,7 @@ const std::string PointerAnalysis::aliasTestFailNoAliasMangled = "_Z20EXPECTEDF
|
|
|
73
72
|
* Constructor
|
|
74
73
|
*/
|
|
75
74
|
PointerAnalysis::PointerAnalysis(SVFIR* p, PTATY ty, bool alias_check) :
|
|
76
|
-
svfMod(nullptr),ptaTy(ty),stat(nullptr),ptaCallGraph(nullptr),callGraphSCC(nullptr),icfg(nullptr),typeSystem(nullptr)
|
|
75
|
+
svfMod(nullptr),ptaTy(ty),stat(nullptr),ptaCallGraph(nullptr),callGraphSCC(nullptr),icfg(nullptr),typeSystem(nullptr), chgraph(nullptr)
|
|
77
76
|
{
|
|
78
77
|
pag = p;
|
|
79
78
|
OnTheFlyIterBudgetForStat = Options::StatBudget;
|
|
@@ -103,6 +102,9 @@ void PointerAnalysis::destroy()
|
|
|
103
102
|
|
|
104
103
|
delete stat;
|
|
105
104
|
stat = nullptr;
|
|
105
|
+
|
|
106
|
+
delete chgraph;
|
|
107
|
+
chgraph = nullptr;
|
|
106
108
|
}
|
|
107
109
|
|
|
108
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 (
|
|
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->
|
|
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<
|
|
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
|
-
|
|
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 (
|
|
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.
|
|
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.
|
|
436
|
+
NodeID gepId = NodeIDAllocator::get()->allocateGepObjectId(base, ls.accumulateConstantOffset(), StInfo::getMaxFieldLimit());
|
|
437
437
|
GepObjVarMap[std::make_pair(base, ls)] = gepId;
|
|
438
|
-
|
|
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
|
|
144
|
+
const std::string GepObjVar::toString() const {
|
|
145
145
|
std::string str;
|
|
146
146
|
raw_string_ostream rawstr(str);
|
|
147
|
-
rawstr << "
|
|
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,
|
|
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->
|
|
109
|
+
u32_t nfE = elemStInfo->getFlattenedFieldInfoVec().size();
|
|
110
110
|
for (u32_t j = 0; j < nfE; j++)
|
|
111
111
|
{
|
|
112
|
-
u32_t idx = elemStInfo->
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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,
|
|
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->
|
|
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->
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
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
|
-
|
|
169
|
-
|
|
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,161 +178,12 @@ void SymbolTableInfo::collectSimpleTypeInfo(const Type* ty)
|
|
|
191
178
|
typeToFieldInfo[ty] = stinfo;
|
|
192
179
|
|
|
193
180
|
/// Only one field
|
|
194
|
-
stinfo->addFldWithType(0,
|
|
181
|
+
stinfo->addFldWithType(0, ty);
|
|
195
182
|
|
|
196
|
-
|
|
197
|
-
|
|
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
|
-
/*!
|
|
203
|
-
* Compute gep offset
|
|
204
|
-
*/
|
|
205
|
-
bool SymbolTableInfo::computeGepOffset(const User *V, LocationSet& ls)
|
|
206
|
-
{
|
|
207
|
-
assert(V);
|
|
208
|
-
|
|
209
|
-
const llvm::GEPOperator *gepOp = SVFUtil::dyn_cast<const llvm::GEPOperator>(V);
|
|
210
|
-
DataLayout * dataLayout = getDataLayout(LLVMModuleSet::getLLVMModuleSet()->getMainLLVMModule());
|
|
211
|
-
llvm::APInt byteOffset(dataLayout->getIndexSizeInBits(gepOp->getPointerAddressSpace()),0,true);
|
|
212
|
-
if(gepOp && dataLayout && gepOp->accumulateConstantOffset(*dataLayout,byteOffset))
|
|
213
|
-
{
|
|
214
|
-
Size_t bo = byteOffset.getSExtValue();
|
|
215
|
-
ls.setByteOffset(bo + ls.getByteOffset());
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
for (bridge_gep_iterator gi = bridge_gep_begin(*V), ge = bridge_gep_end(*V);
|
|
219
|
-
gi != ge; ++gi)
|
|
220
|
-
{
|
|
221
|
-
|
|
222
|
-
// Handling array types, skipe array handling here
|
|
223
|
-
// We treat whole array as one, then we can distinguish different field of an array of struct
|
|
224
|
-
// e.g. s[1].f1 is differet from s[0].f2
|
|
225
|
-
if(SVFUtil::isa<ArrayType>(*gi))
|
|
226
|
-
continue;
|
|
227
|
-
|
|
228
|
-
//The int-value object of the current index operand
|
|
229
|
-
// (may not be constant for arrays).
|
|
230
|
-
ConstantInt *op = SVFUtil::dyn_cast<ConstantInt>(gi.getOperand());
|
|
231
|
-
|
|
232
|
-
/// given a gep edge p = q + i,
|
|
233
|
-
if(!op)
|
|
234
|
-
{
|
|
235
|
-
return false;
|
|
236
|
-
}
|
|
237
|
-
//The actual index
|
|
238
|
-
Size_t idx = op->getSExtValue();
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
// Handling pointer types
|
|
242
|
-
// These GEP instructions are simply making address computations from the base pointer address
|
|
243
|
-
// e.g. idx = (char*) &p + 4, at this case gep only one offset index (idx)
|
|
244
|
-
// Case 1: This operation is likely accessing an array through pointer p.
|
|
245
|
-
// Case 2: It may also be used to access a field of a struct (which is not ANSI-compliant)
|
|
246
|
-
// Since this is a field-index based memory model,
|
|
247
|
-
// for case 1: we consider the whole array as one element, This can be improved by LocMemModel as it can distinguish different
|
|
248
|
-
// elements of the same array.
|
|
249
|
-
// for case 2: we treat idx the same as &p by ignoring const 4 (This handling is unsound since the program itself is not ANSI-compliant).
|
|
250
|
-
if (SVFUtil::isa<PointerType>(*gi))
|
|
251
|
-
{
|
|
252
|
-
//off += idx;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
// Handling struct here
|
|
257
|
-
if (const StructType *ST = SVFUtil::dyn_cast<StructType>(*gi) )
|
|
258
|
-
{
|
|
259
|
-
assert(op && "non-const struct index in GEP");
|
|
260
|
-
const vector<u32_t> &so = SymbolTableInfo::SymbolInfo()->getFattenFieldIdxVec(ST);
|
|
261
|
-
if ((unsigned)idx >= so.size())
|
|
262
|
-
{
|
|
263
|
-
outs() << "!! Struct index out of bounds" << idx << "\n";
|
|
264
|
-
assert(0);
|
|
265
|
-
}
|
|
266
|
-
//add the translated offset
|
|
267
|
-
ls.setFldIdx(ls.getOffset() + so[idx]);
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
return true;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
/*!
|
|
275
|
-
* Replace fields with flatten fields of T if the number of its fields is larger than msz.
|
|
276
|
-
*/
|
|
277
|
-
u32_t SymbolTableInfo::getFields(std::vector<LocationSet>& fields, const Type* T, u32_t msz)
|
|
278
|
-
{
|
|
279
|
-
if (!SVFUtil::isa<PointerType>(T))
|
|
280
|
-
return 0;
|
|
281
|
-
|
|
282
|
-
T = T->getContainedType(0);
|
|
283
|
-
const std::vector<FieldInfo>& stVec = SymbolTableInfo::SymbolInfo()->getFlattenFieldInfoVec(T);
|
|
284
|
-
u32_t sz = stVec.size();
|
|
285
|
-
if (msz < sz)
|
|
286
|
-
{
|
|
287
|
-
/// Replace fields with T's flatten fields.
|
|
288
|
-
fields.clear();
|
|
289
|
-
for(std::vector<FieldInfo>::const_iterator it = stVec.begin(), eit = stVec.end(); it!=eit; ++it)
|
|
290
|
-
fields.push_back(LocationSet(*it));
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
return sz;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
/*!
|
|
298
|
-
* Find the base type and the max possible offset for an object pointed to by (V).
|
|
299
|
-
*/
|
|
300
|
-
const Type *SymbolTableInfo::getBaseTypeAndFlattenedFields(const Value *V, std::vector<LocationSet> &fields)
|
|
301
|
-
{
|
|
302
|
-
assert(V);
|
|
303
|
-
fields.push_back(LocationSet(0));
|
|
304
|
-
|
|
305
|
-
const Type *T = V->getType();
|
|
306
|
-
// Use the biggest struct type out of all operands.
|
|
307
|
-
if (const User *U = SVFUtil::dyn_cast<User>(V))
|
|
308
|
-
{
|
|
309
|
-
u32_t msz = 1; //the max size seen so far
|
|
310
|
-
// In case of BitCast, try the target type itself
|
|
311
|
-
if (SVFUtil::isa<BitCastInst>(V))
|
|
312
|
-
{
|
|
313
|
-
u32_t sz = getFields(fields, T, msz);
|
|
314
|
-
if (msz < sz)
|
|
315
|
-
{
|
|
316
|
-
msz = sz;
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
// Try the types of all operands
|
|
320
|
-
for (User::const_op_iterator it = U->op_begin(), ie = U->op_end();
|
|
321
|
-
it != ie; ++it)
|
|
322
|
-
{
|
|
323
|
-
const Type *operandtype = it->get()->getType();
|
|
324
|
-
|
|
325
|
-
u32_t sz = getFields(fields, operandtype, msz);
|
|
326
|
-
if (msz < sz)
|
|
327
|
-
{
|
|
328
|
-
msz = sz;
|
|
329
|
-
T = operandtype;
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
// If V is a CE, the actual pointer type is its operand.
|
|
334
|
-
else if (const ConstantExpr *E = SVFUtil::dyn_cast<ConstantExpr>(V))
|
|
335
|
-
{
|
|
336
|
-
T = E->getOperand(0)->getType();
|
|
337
|
-
getFields(fields, T, 0);
|
|
338
|
-
}
|
|
339
|
-
// Handle Argument case
|
|
340
|
-
else if (SVFUtil::isa<Argument>(V))
|
|
341
|
-
{
|
|
342
|
-
getFields(fields, T, 0);
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
while (const PointerType *ptype = SVFUtil::dyn_cast<PointerType>(T))
|
|
346
|
-
T = ptype->getElementType();
|
|
347
|
-
return T;
|
|
348
|
-
}
|
|
349
187
|
|
|
350
188
|
/*!
|
|
351
189
|
* Get modulus offset given the type information
|
|
@@ -357,7 +195,7 @@ LocationSet SymbolTableInfo::getModulusOffset(const MemObj* obj, const LocationS
|
|
|
357
195
|
/// of current struct. Make the offset positive so we can still get a node within current
|
|
358
196
|
/// struct to represent this obj.
|
|
359
197
|
|
|
360
|
-
Size_t offset = ls.
|
|
198
|
+
Size_t offset = ls.accumulateConstantOffset();
|
|
361
199
|
if(offset < 0)
|
|
362
200
|
{
|
|
363
201
|
writeWrnMsg("try to create a gep node with negative offset.");
|
|
@@ -441,10 +279,10 @@ bool SymbolTableInfo::isConstantObjSym(const Value *val)
|
|
|
441
279
|
else
|
|
442
280
|
{
|
|
443
281
|
StInfo *stInfo = getStructInfo(v->getInitializer()->getType());
|
|
444
|
-
const std::vector<
|
|
445
|
-
for (std::vector<
|
|
282
|
+
const std::vector<FlattenedFieldInfo> &fields = stInfo->getFlattenedFieldInfoVec();
|
|
283
|
+
for (std::vector<FlattenedFieldInfo>::const_iterator it = fields.begin(), eit = fields.end(); it != eit; ++it)
|
|
446
284
|
{
|
|
447
|
-
const
|
|
285
|
+
const FlattenedFieldInfo &field = *it;
|
|
448
286
|
const Type *elemTy = field.getFlattenElemTy();
|
|
449
287
|
assert(!SVFUtil::isa<FunctionType>(elemTy) && "Initializer of a global is a function?");
|
|
450
288
|
if (SVFUtil::isa<PointerType>(elemTy))
|
|
@@ -484,29 +322,23 @@ const MemObj* SymbolTableInfo::createDummyObj(SymID symId, const Type* type)
|
|
|
484
322
|
return memObj;
|
|
485
323
|
}
|
|
486
324
|
|
|
487
|
-
const std::vector<u32_t>& SymbolTableInfo::
|
|
488
|
-
{
|
|
489
|
-
return getStructInfoIter(T)->second->getFieldIdxVec();
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
const std::vector<u32_t>& SymbolTableInfo::getFattenFieldOffsetVec(const Type *T)
|
|
325
|
+
const std::vector<u32_t>& SymbolTableInfo::getFlattenedFieldIdxVec(const Type *T)
|
|
493
326
|
{
|
|
494
|
-
return getStructInfoIter(T)->second->
|
|
327
|
+
return getStructInfoIter(T)->second->getFlattenedFieldIdxVec();
|
|
495
328
|
}
|
|
496
329
|
|
|
497
|
-
const std::vector<
|
|
330
|
+
const std::vector<FlattenedFieldInfo>& SymbolTableInfo::getFlattenedFieldInfoVec(const Type *T)
|
|
498
331
|
{
|
|
499
|
-
return getStructInfoIter(T)->second->
|
|
332
|
+
return getStructInfoIter(T)->second->getFlattenedFieldInfoVec();
|
|
500
333
|
}
|
|
501
334
|
|
|
502
|
-
const Type* SymbolTableInfo::
|
|
335
|
+
const Type* SymbolTableInfo::getOriginalFieldType(const Type* baseType, u32_t field_idx)
|
|
503
336
|
{
|
|
504
|
-
return getStructInfoIter(baseType)->second->
|
|
337
|
+
return getStructInfoIter(baseType)->second->getOriginalFieldType(field_idx);
|
|
505
338
|
}
|
|
506
339
|
|
|
507
|
-
const Type* SymbolTableInfo::
|
|
508
|
-
|
|
509
|
-
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);
|
|
510
342
|
}
|
|
511
343
|
|
|
512
344
|
/*
|
|
@@ -530,21 +362,15 @@ void SymbolTableInfo::printFlattenFields(const Type* type)
|
|
|
530
362
|
outs() <<" {Type: ";
|
|
531
363
|
st->print(outs());
|
|
532
364
|
outs() << "}\n";
|
|
533
|
-
std::vector<
|
|
365
|
+
std::vector<FlattenedFieldInfo>& finfo = getStructInfo(st)->getFlattenedFieldInfoVec();
|
|
534
366
|
int field_idx = 0;
|
|
535
|
-
for(std::vector<
|
|
367
|
+
for(std::vector<FlattenedFieldInfo>::iterator it = finfo.begin(), eit = finfo.end();
|
|
536
368
|
it!=eit; ++it, field_idx++)
|
|
537
369
|
{
|
|
538
|
-
outs() << " \tField_idx = " << (*it).getFlattenFldIdx()
|
|
370
|
+
outs() << " \tField_idx = " << (*it).getFlattenFldIdx();
|
|
539
371
|
outs() << ", field type: ";
|
|
540
372
|
(*it).getFlattenElemTy()->print(outs());
|
|
541
373
|
outs() << ", field size: " << getTypeSizeInBytes((*it).getFlattenElemTy());
|
|
542
|
-
outs() << ", field stride pair: ";
|
|
543
|
-
for(FieldInfo::ElemNumStridePairVec::const_iterator pit = (*it).elemStridePairBegin(),
|
|
544
|
-
peit = (*it).elemStridePairEnd(); pit!=peit; ++pit)
|
|
545
|
-
{
|
|
546
|
-
outs() << "[ " << pit->first << ", " << pit->second << " ] ";
|
|
547
|
-
}
|
|
548
374
|
outs() << "\n";
|
|
549
375
|
}
|
|
550
376
|
outs() << "\n";
|
|
@@ -723,12 +549,12 @@ bool ObjTypeInfo::isNonPtrFieldObj(const LocationSet& ls)
|
|
|
723
549
|
if (SVFUtil::isa<StructType>(ety) || SVFUtil::isa<ArrayType>(ety))
|
|
724
550
|
{
|
|
725
551
|
bool hasIntersection = false;
|
|
726
|
-
const vector<
|
|
727
|
-
vector<
|
|
728
|
-
vector<
|
|
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();
|
|
729
555
|
for (; it != eit; ++it)
|
|
730
556
|
{
|
|
731
|
-
const
|
|
557
|
+
const FlattenedFieldInfo& fieldLS = *it;
|
|
732
558
|
if (ls.intersects(LocationSet(fieldLS)))
|
|
733
559
|
{
|
|
734
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(
|
|
76
|
+
if(GepObjVar* gepobj = SVFUtil::dyn_cast<GepObjVar>(pagNode)) {
|
|
77
77
|
if(SVFUtil::isa<DummyObjVar>(pag->getGNode(gepobj->getBaseNode())))
|
|
78
78
|
continue;
|
|
79
79
|
}
|