svf-tools 1.0.539 → 1.0.540
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/AndersenStat_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/Andersen_8h_source.html +1 -1
- package/SVF-doxygen/html/html/BreakConstantExpr_8h_source.html +2 -1
- package/SVF-doxygen/html/html/CFGNormalizer_8h_source.html +1 -1
- package/SVF-doxygen/html/html/CFLAlias_8cpp_source.html +5 -4
- package/SVF-doxygen/html/html/CFLAlias_8h_source.html +15 -15
- package/SVF-doxygen/html/html/CFLGramGraphChecker_8h_source.html +4 -4
- package/SVF-doxygen/html/html/CFLGrammar_8txt.html +39 -39
- package/SVF-doxygen/html/html/CFLGraphBuilder_8cpp_source.html +20 -8
- package/SVF-doxygen/html/html/CFLGraphBuilder_8h_source.html +16 -15
- package/SVF-doxygen/html/html/CHGBuilder_8cpp.html +1 -1
- package/SVF-doxygen/html/html/CHGBuilder_8cpp_source.html +2 -1
- package/SVF-doxygen/html/html/CHGBuilder_8h_source.html +2 -1
- package/SVF-doxygen/html/html/CPPUtil_8h.html +4 -4
- package/SVF-doxygen/html/html/DDAStat_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/DDAStat_8h.html +1 -1
- package/SVF-doxygen/html/html/DDAStat_8h_source.html +1 -1
- package/SVF-doxygen/html/html/ExtAPI_8h_source.html +1 -1
- package/SVF-doxygen/html/html/FlowSensitiveStat_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/GrammarBuilder_8cpp_source.html +4 -4
- package/SVF-doxygen/html/html/GrammarBuilder_8h_source.html +3 -3
- package/SVF-doxygen/html/html/ICFGStat_8h.html +1 -1
- package/SVF-doxygen/html/html/ICFGStat_8h_source.html +1 -1
- package/SVF-doxygen/html/html/LLVMLoopAnalysis_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/LLVMModule_8cpp_source.html +2 -1
- package/SVF-doxygen/html/html/LLVMUtil_8h_source.html +1 -1
- package/SVF-doxygen/html/html/LockAnalysis_8cpp.html +1 -1
- package/SVF-doxygen/html/html/LockAnalysis_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/MHP_8cpp.html +1 -1
- package/SVF-doxygen/html/html/MHP_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/MTAResultValidator_8h_source.html +2 -1
- package/SVF-doxygen/html/html/MTAStat_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/MTAStat_8h.html +1 -1
- package/SVF-doxygen/html/html/MTAStat_8h_source.html +1 -1
- package/SVF-doxygen/html/html/NodeIDAllocator_8cpp.html +1 -1
- package/SVF-doxygen/html/html/NodeIDAllocator_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/Options_8cpp_source.html +5 -3
- package/SVF-doxygen/html/html/Options_8h.html +1 -1
- package/SVF-doxygen/html/html/Options_8h_source.html +5 -3
- package/SVF-doxygen/html/html/PEGGrammar_8txt.html +314 -0
- package/SVF-doxygen/html/html/PTAStat_8cpp.html +1 -1
- package/SVF-doxygen/html/html/PTAStat_8cpp_source.html +5 -5
- package/SVF-doxygen/html/html/PTAStat_8h.html +2 -2
- package/SVF-doxygen/html/html/PTAStat_8h_source.html +2 -2
- package/SVF-doxygen/html/html/PointerAnalysis_8cpp.html +1 -1
- package/SVF-doxygen/html/html/PointerAnalysis_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/SVFGStat_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/SVFGStat_8h.html +1 -1
- package/SVF-doxygen/html/html/SVFGStat_8h_source.html +1 -1
- package/SVF-doxygen/html/html/SVFUtil_8h.html +1 -1
- package/SVF-doxygen/html/html/SaberCondAllocator_8cpp_source.html +2 -1
- package/SVF-doxygen/html/html/TypeAnalysis_8cpp.html +1 -1
- package/SVF-doxygen/html/html/TypeAnalysis_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/Util_2BasicTypes_8h.html +1 -1
- package/SVF-doxygen/html/html/VersionedFlowSensitiveStat_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/WPAStat_8h.html +1 -1
- package/SVF-doxygen/html/html/WPAStat_8h_source.html +1 -1
- package/SVF-doxygen/html/html/cfl_8cpp.html +1 -1
- package/SVF-doxygen/html/html/cfl_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1AliasCFLGraphBuilder-members.html +12 -11
- package/SVF-doxygen/html/html/classSVF_1_1AliasCFLGraphBuilder.html +73 -4
- package/SVF-doxygen/html/html/classSVF_1_1Andersen.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1AndersenSCD.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1AndersenSFR.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1AndersenStat.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1AndersenWaveDiff.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1BreakConstantGEPs.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1CFLAlias.html +50 -49
- package/SVF-doxygen/html/html/classSVF_1_1CFLGraphBuilder.html +26 -26
- package/SVF-doxygen/html/html/classSVF_1_1CHGBuilder.html +10 -7
- package/SVF-doxygen/html/html/classSVF_1_1DDAStat.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1ExtAPI.html +11 -11
- package/SVF-doxygen/html/html/classSVF_1_1FlowSensitiveStat.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1GrammarBuilder.html +10 -10
- package/SVF-doxygen/html/html/classSVF_1_1LLVMLoopAnalysis.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1LLVMModuleSet.html +2 -1
- package/SVF-doxygen/html/html/classSVF_1_1MTA.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1MTAStat.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1MemSSAStat.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1MergeFunctionRets.html +3 -2
- package/SVF-doxygen/html/html/classSVF_1_1Options-members.html +8 -6
- package/SVF-doxygen/html/html/classSVF_1_1Options.html +54 -2
- package/SVF-doxygen/html/html/classSVF_1_1PTAStat.html +16 -16
- package/SVF-doxygen/html/html/classSVF_1_1PointerAnalysis.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1SVFGStat.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1SVFIRBuilder.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1SaberCheckerAPI.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1ThreadAPI.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1TypeAnalysis.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1VersionedFlowSensitiveStat.html +2 -2
- package/SVF-doxygen/html/html/dir_95e22971b5dbae2382075a3453e365b4.html +2 -0
- package/SVF-doxygen/html/html/dir_eef3a4ca6ca2cab0eb5fbea30ec32c1a.html +0 -2
- package/SVF-doxygen/html/html/files.html +15 -15
- package/SVF-doxygen/html/html/functions_b.html +3 -0
- package/SVF-doxygen/html/html/functions_c.html +22 -20
- package/SVF-doxygen/html/html/functions_f.html +10 -12
- package/SVF-doxygen/html/html/functions_func_b.html +3 -0
- package/SVF-doxygen/html/html/functions_func_p.html +2 -2
- package/SVF-doxygen/html/html/functions_i.html +6 -6
- package/SVF-doxygen/html/html/functions_l.html +6 -6
- package/SVF-doxygen/html/html/functions_n.html +3 -0
- package/SVF-doxygen/html/html/functions_p.html +19 -18
- package/SVF-doxygen/html/html/functions_r.html +4 -2
- package/SVF-doxygen/html/html/functions_s.html +13 -11
- package/SVF-doxygen/html/html/functions_t.html +3 -3
- package/SVF-doxygen/html/html/functions_v.html +3 -3
- package/SVF-doxygen/html/html/functions_vars_n.html +3 -0
- package/SVF-doxygen/html/html/functions_vars_p.html +3 -0
- package/SVF-doxygen/html/html/globals.html +1 -0
- package/SVF-doxygen/html/html/globals_a.html +3 -1
- package/SVF-doxygen/html/html/globals_c.html +6 -5
- package/SVF-doxygen/html/html/globals_e.html +1 -0
- package/SVF-doxygen/html/html/globals_f.html +7 -5
- package/SVF-doxygen/html/html/globals_g.html +7 -3
- package/SVF-doxygen/html/html/globals_m.html +6 -3
- package/SVF-doxygen/html/html/globals_v.html +2 -1
- package/SVF-doxygen/html/html/globals_vars.html +22 -7
- package/SVF-doxygen/html/html/namespaceSVF.html +2 -2
- package/SVF-doxygen/html/html/namespaceSVF_1_1SVFUtil.html +1 -1
- package/SVF-doxygen/html/html/namespaceSVF_1_1cppUtil.html +4 -4
- package/SVF-doxygen/html/html/search/all_0.js +1 -1
- package/SVF-doxygen/html/html/search/all_1.js +2 -2
- package/SVF-doxygen/html/html/search/all_10.js +11 -9
- package/SVF-doxygen/html/html/search/all_11.js +2 -2
- package/SVF-doxygen/html/html/search/all_12.js +8 -8
- package/SVF-doxygen/html/html/search/all_13.js +6 -6
- package/SVF-doxygen/html/html/search/all_14.js +1 -1
- package/SVF-doxygen/html/html/search/all_15.js +2 -2
- package/SVF-doxygen/html/html/search/all_2.js +1 -0
- package/SVF-doxygen/html/html/search/all_3.js +4 -4
- package/SVF-doxygen/html/html/search/all_5.js +1 -1
- package/SVF-doxygen/html/html/search/all_6.js +6 -6
- package/SVF-doxygen/html/html/search/all_7.js +4 -4
- package/SVF-doxygen/html/html/search/all_9.js +2 -2
- package/SVF-doxygen/html/html/search/all_b.js +1 -1
- package/SVF-doxygen/html/html/search/all_c.js +5 -5
- package/SVF-doxygen/html/html/search/all_d.js +2 -2
- package/SVF-doxygen/html/html/search/all_e.js +5 -4
- package/SVF-doxygen/html/html/search/files_c.js +1 -0
- package/SVF-doxygen/html/html/search/functions_1.js +1 -0
- package/SVF-doxygen/html/html/search/functions_f.js +2 -2
- package/SVF-doxygen/html/html/search/variables_0.js +1 -1
- package/SVF-doxygen/html/html/search/variables_1.js +2 -2
- package/SVF-doxygen/html/html/search/variables_10.js +2 -1
- package/SVF-doxygen/html/html/search/variables_13.js +3 -3
- package/SVF-doxygen/html/html/search/variables_14.js +1 -1
- package/SVF-doxygen/html/html/search/variables_15.js +1 -1
- package/SVF-doxygen/html/html/search/variables_3.js +1 -1
- package/SVF-doxygen/html/html/search/variables_5.js +1 -1
- package/SVF-doxygen/html/html/search/variables_6.js +2 -2
- package/SVF-doxygen/html/html/search/variables_7.js +4 -4
- package/SVF-doxygen/html/html/search/variables_c.js +1 -1
- package/SVF-doxygen/html/html/search/variables_d.js +1 -1
- package/SVF-doxygen/html/html/search/variables_e.js +4 -3
- package/include/CFL/CFGNormalizer.h +3 -3
- package/include/CFL/CFLAlias.h +5 -1
- package/include/CFL/CFLGraphBuilder.h +11 -1
- package/include/CFL/PEGGrammar.txt +28 -0
- package/include/DDA/DDAStat.h +1 -1
- package/include/Graphs/ICFGStat.h +1 -1
- package/include/Graphs/SVFGStat.h +1 -1
- package/include/MTA/MTAStat.h +1 -1
- package/include/SVF-FE/LLVMUtil.h +2 -2
- package/include/Util/ExtAPI.h +2 -2
- package/include/Util/Options.h +3 -1
- package/include/{MemoryModel → Util}/PTAStat.h +0 -0
- package/include/WPA/Andersen.h +3 -3
- package/include/WPA/WPAStat.h +1 -1
- package/lib/CFL/CFLAlias.cpp +12 -7
- package/lib/CFL/CFLGraphBuilder.cpp +135 -0
- package/lib/CFL/GrammarBuilder.cpp +12 -8
- package/lib/MTA/LockAnalysis.cpp +1 -1
- package/lib/MTA/MHP.cpp +1 -1
- package/lib/MemoryModel/PointerAnalysis.cpp +1 -1
- package/lib/SVF-FE/CHGBuilder.cpp +1 -1
- package/lib/Util/NodeIDAllocator.cpp +1 -1
- package/lib/Util/Options.cpp +16 -4
- package/lib/Util/PTAStat.cpp +4 -3
- package/lib/WPA/TypeAnalysis.cpp +1 -1
- package/package.json +1 -1
package/include/Util/Options.h
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
#include <sstream>
|
|
7
7
|
#include "FastCluster/fastcluster.h"
|
|
8
|
-
#include "
|
|
8
|
+
#include "Util/PTAStat.h"
|
|
9
9
|
#include "MemoryModel/PointerAnalysisImpl.h"
|
|
10
10
|
#include "Util/NodeIDAllocator.h"
|
|
11
11
|
#include "MSSA/MemSSA.h"
|
|
@@ -253,6 +253,8 @@ public:
|
|
|
253
253
|
static const llvm::cl::opt<std::string> CFLGraph;
|
|
254
254
|
static const llvm::cl::opt<bool> PrintCFL;
|
|
255
255
|
static const llvm::cl::opt<bool> FlexSymMap;
|
|
256
|
+
static const llvm::cl::opt<bool> PEGTransfer;
|
|
257
|
+
static const llvm::cl::opt<bool> NullDummyNode;
|
|
256
258
|
|
|
257
259
|
// Loop Analysis
|
|
258
260
|
static const llvm::cl::opt<bool> LoopAnalysis;
|
|
File without changes
|
package/include/WPA/Andersen.h
CHANGED
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
* Author: Yulei Sui
|
|
28
28
|
*/
|
|
29
29
|
|
|
30
|
-
#ifndef
|
|
31
|
-
#define
|
|
30
|
+
#ifndef INCLUDE_WPA_ANDERSEN_H_
|
|
31
|
+
#define INCLUDE_WPA_ANDERSEN_H_
|
|
32
32
|
|
|
33
33
|
#include "MemoryModel/PointerAnalysisImpl.h"
|
|
34
34
|
#include "WPA/WPAStat.h"
|
|
@@ -433,4 +433,4 @@ public:
|
|
|
433
433
|
|
|
434
434
|
} // End namespace SVF
|
|
435
435
|
|
|
436
|
-
#endif /*
|
|
436
|
+
#endif /* INCLUDE_WPA_ANDERSEN_H_ */
|
package/include/WPA/WPAStat.h
CHANGED
package/lib/CFL/CFLAlias.cpp
CHANGED
|
@@ -206,7 +206,15 @@ void CFLAlias::analyze()
|
|
|
206
206
|
PointerAnalysis::initialize();
|
|
207
207
|
GrammarBase *grammarBase = grammarBuilder.build();
|
|
208
208
|
ConstraintGraph *consCG = new ConstraintGraph(svfir);
|
|
209
|
-
|
|
209
|
+
if (Options::PEGTransfer)
|
|
210
|
+
{
|
|
211
|
+
graph = cflGraphBuilder.buildBiPEGgraph(consCG, grammarBase->getStartKind(), grammarBase, svfir);
|
|
212
|
+
}
|
|
213
|
+
else
|
|
214
|
+
{
|
|
215
|
+
graph = cflGraphBuilder.buildBigraph(consCG, grammarBase->getStartKind(), grammarBase);
|
|
216
|
+
}
|
|
217
|
+
|
|
210
218
|
cflChecker.check(grammarBase, &cflGraphBuilder, graph);
|
|
211
219
|
grammar = normalizer.normalize(grammarBase);
|
|
212
220
|
cflChecker.check(grammar, &cflGraphBuilder, graph);
|
|
@@ -228,12 +236,9 @@ void CFLAlias::analyze()
|
|
|
228
236
|
solver->solve();
|
|
229
237
|
if(Options::PrintCFL == true)
|
|
230
238
|
{
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
grammar->dump(grammarName.append("_Grammar"));
|
|
235
|
-
std::string CFLGraphFileName = Options::CFLGraph.c_str();
|
|
236
|
-
graph->dump(CFLGraphFileName.append("_CFL"));
|
|
239
|
+
svfir->dump("IR");
|
|
240
|
+
grammar->dump("Grammar");
|
|
241
|
+
graph->dump("CFLGraph");
|
|
237
242
|
}
|
|
238
243
|
if (Options::CFLGraph.empty())
|
|
239
244
|
{
|
|
@@ -222,4 +222,139 @@ CFLGraph* AliasCFLGraphBuilder::buildBigraph(ConstraintGraph *graph, Kind startK
|
|
|
222
222
|
return cflGraph;
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
+
CFLGraph* AliasCFLGraphBuilder::buildBiPEGgraph(ConstraintGraph *graph, Kind startKind, GrammarBase *grammar, SVFIR* pag)
|
|
226
|
+
{
|
|
227
|
+
CFLGraph *cflGraph = new CFLGraph(startKind);
|
|
228
|
+
externMap = true;
|
|
229
|
+
for(auto pairV : grammar->getTerminals())
|
|
230
|
+
{
|
|
231
|
+
if(label2KindMap.find(pairV.first) == label2KindMap.end())
|
|
232
|
+
{
|
|
233
|
+
label2KindMap.insert(pairV);
|
|
234
|
+
}
|
|
235
|
+
if(kind2LabelMap.find(pairV.second) == kind2LabelMap.end())
|
|
236
|
+
{
|
|
237
|
+
kind2LabelMap.insert(make_pair(pairV.second, pairV.first));
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
for(auto pairV : grammar->getNonterminals())
|
|
241
|
+
{
|
|
242
|
+
if(label2KindMap.find(pairV.first) == label2KindMap.end())
|
|
243
|
+
{
|
|
244
|
+
label2KindMap.insert(pairV);
|
|
245
|
+
}
|
|
246
|
+
if(kind2LabelMap.find(pairV.second) == kind2LabelMap.end())
|
|
247
|
+
{
|
|
248
|
+
kind2LabelMap.insert(make_pair(pairV.second, pairV.first));
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
for(auto it = graph->begin(); it!= graph->end(); it++)
|
|
252
|
+
{
|
|
253
|
+
CFLNode* node = new CFLNode((*it).first);
|
|
254
|
+
cflGraph->addCFLNode((*it).first, node);
|
|
255
|
+
}
|
|
256
|
+
for(auto it = graph->begin(); it!= graph->end(); it++)
|
|
257
|
+
{
|
|
258
|
+
ConstraintNode* node = (*it).second;
|
|
259
|
+
for(ConstraintEdge* edge : node->getOutEdges())
|
|
260
|
+
{
|
|
261
|
+
/// Process Store
|
|
262
|
+
if (edge->getEdgeKind() == ConstraintEdge::Store)
|
|
263
|
+
{
|
|
264
|
+
if (pag->isNullPtr(edge->getSrcID()) && (Options::NullDummyNode == false))
|
|
265
|
+
continue;
|
|
266
|
+
/// Check Dst of Store Dereference Node
|
|
267
|
+
ConstraintNode* Dst = edge->getDstNode();
|
|
268
|
+
ConstraintNode* DerefNode = nullptr;
|
|
269
|
+
CFLNode* CFLDerefNode = nullptr;
|
|
270
|
+
for (ConstraintEdge* DstInEdge : Dst->getInEdges())
|
|
271
|
+
{
|
|
272
|
+
if (DstInEdge->getEdgeKind() == ConstraintEdge::Addr)
|
|
273
|
+
{
|
|
274
|
+
DerefNode = DstInEdge->getSrcNode();
|
|
275
|
+
CFLDerefNode = cflGraph->getGNode(DstInEdge->getSrcID());
|
|
276
|
+
break;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
if (DerefNode == nullptr)
|
|
280
|
+
{
|
|
281
|
+
|
|
282
|
+
NodeID refId = pag->addDummyValNode();
|
|
283
|
+
CFLDerefNode = new CFLNode(refId);
|
|
284
|
+
cflGraph->addCFLNode(refId, CFLDerefNode);
|
|
285
|
+
/// Add Addr Edge
|
|
286
|
+
cflGraph->addCFLEdge(CFLDerefNode, cflGraph->getGNode(edge->getDstID()), ConstraintEdge::Addr);
|
|
287
|
+
std::string key = kind2LabelMap[ConstraintEdge::Addr];
|
|
288
|
+
key.append("bar");
|
|
289
|
+
cflGraph->addCFLEdge(cflGraph->getGNode(edge->getDstID()), CFLDerefNode, label2KindMap[key]);
|
|
290
|
+
}
|
|
291
|
+
/// Add Copy Edge
|
|
292
|
+
cflGraph->addCFLEdge(cflGraph->getGNode(edge->getSrcID()), cflGraph->getGNode(CFLDerefNode->getId()), ConstraintEdge::Copy);
|
|
293
|
+
std::string key = kind2LabelMap[ConstraintEdge::Copy];
|
|
294
|
+
key.append("bar");
|
|
295
|
+
cflGraph->addCFLEdge(cflGraph->getGNode(CFLDerefNode->getId()), cflGraph->getGNode(edge->getSrcID()), label2KindMap[key]);
|
|
296
|
+
}
|
|
297
|
+
/// Process Load
|
|
298
|
+
else if ( edge->getEdgeKind() == ConstraintEdge::Load)
|
|
299
|
+
{
|
|
300
|
+
/// Check Src of Load Dereference Node
|
|
301
|
+
ConstraintNode* Src = edge->getSrcNode();
|
|
302
|
+
ConstraintNode* DerefNode = nullptr;
|
|
303
|
+
CFLNode* CFLDerefNode = nullptr;
|
|
304
|
+
for (ConstraintEdge* SrcInEdge : Src->getInEdges())
|
|
305
|
+
{
|
|
306
|
+
if (SrcInEdge->getEdgeKind() == ConstraintEdge::Addr)
|
|
307
|
+
{
|
|
308
|
+
DerefNode = SrcInEdge->getSrcNode();
|
|
309
|
+
CFLDerefNode = cflGraph->getGNode(SrcInEdge->getSrcID());
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
if (DerefNode == nullptr)
|
|
313
|
+
{
|
|
314
|
+
NodeID refId = pag->addDummyValNode();
|
|
315
|
+
CFLDerefNode = new CFLNode(refId);
|
|
316
|
+
cflGraph->addCFLNode(refId, CFLDerefNode);
|
|
317
|
+
/// Add Addr Edge
|
|
318
|
+
cflGraph->addCFLEdge(CFLDerefNode, cflGraph->getGNode(edge->getSrcID()), ConstraintEdge::Addr);
|
|
319
|
+
std::string key = kind2LabelMap[ConstraintEdge::Addr];
|
|
320
|
+
key.append("bar");
|
|
321
|
+
cflGraph->addCFLEdge(cflGraph->getGNode(edge->getSrcID()), CFLDerefNode, label2KindMap[key]);
|
|
322
|
+
}
|
|
323
|
+
/// Add Copy Edge
|
|
324
|
+
cflGraph->addCFLEdge(cflGraph->getGNode(CFLDerefNode->getId()), cflGraph->getGNode(edge->getDstID()), ConstraintEdge::Copy);
|
|
325
|
+
std::string key = kind2LabelMap[ConstraintEdge::Copy];
|
|
326
|
+
key.append("bar");
|
|
327
|
+
cflGraph->addCFLEdge(cflGraph->getGNode(edge->getDstID()), cflGraph->getGNode(CFLDerefNode->getId()), label2KindMap[key]);
|
|
328
|
+
}
|
|
329
|
+
else
|
|
330
|
+
{
|
|
331
|
+
CFLGrammar::Kind edgeLabel = edge->getEdgeKind();
|
|
332
|
+
// Need to get the offset from the Const Edge
|
|
333
|
+
// The offset present edge is only from Normal Gep CG at moment
|
|
334
|
+
if(NormalGepCGEdge::classof(edge))
|
|
335
|
+
{
|
|
336
|
+
NormalGepCGEdge *nGepEdge = SVFUtil::dyn_cast<NormalGepCGEdge>(edge);
|
|
337
|
+
CFLGrammar::Attribute attr = nGepEdge->getConstantFieldIdx();
|
|
338
|
+
addAttribute(edgeLabel, attr);
|
|
339
|
+
edgeLabel = CFLGrammar::getAttributedKind(attr, edgeLabel);
|
|
340
|
+
cflGraph->addCFLEdge(cflGraph->getGNode(edge->getSrcID()), cflGraph->getGNode(edge->getDstID()), edgeLabel);
|
|
341
|
+
std::string key = kind2LabelMap[edge->getEdgeKind()];
|
|
342
|
+
key.append("bar"); // for example Gep_i should be Gepbar_i, not Gep_ibar
|
|
343
|
+
cflGraph->addCFLEdge(cflGraph->getGNode(edge->getDstID()), cflGraph->getGNode(edge->getSrcID()), CFLGrammar::getAttributedKind(attr, label2KindMap[key]));
|
|
344
|
+
addAttribute(label2KindMap[key], attr);
|
|
345
|
+
}
|
|
346
|
+
else
|
|
347
|
+
{
|
|
348
|
+
cflGraph->addCFLEdge(cflGraph->getGNode(edge->getSrcID()), cflGraph->getGNode(edge->getDstID()), edgeLabel);
|
|
349
|
+
std::string key = kind2LabelMap[edge->getEdgeKind()];
|
|
350
|
+
key.append("bar");
|
|
351
|
+
cflGraph->addCFLEdge(cflGraph->getGNode(edge->getDstID()), cflGraph->getGNode(edge->getSrcID()), label2KindMap[key]);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
return cflGraph;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
|
|
225
360
|
} // end of SVF namespace
|
|
@@ -42,6 +42,7 @@ const inline std::string GrammarBuilder::parseProductionsString() const
|
|
|
42
42
|
std::string lineString;
|
|
43
43
|
std::string lines = "";
|
|
44
44
|
std::string startString;
|
|
45
|
+
std::string symbolString;
|
|
45
46
|
const std::string WHITESPACE = " \n\r\t\f\v";
|
|
46
47
|
int lineNum = 0;
|
|
47
48
|
while (getline(textFile, lineString))
|
|
@@ -50,25 +51,28 @@ const inline std::string GrammarBuilder::parseProductionsString() const
|
|
|
50
51
|
{
|
|
51
52
|
startString = stripSpace(lineString);
|
|
52
53
|
}
|
|
54
|
+
if(lineNum == 3)
|
|
55
|
+
{
|
|
56
|
+
symbolString = lineString.substr(lineString.find_first_not_of(WHITESPACE), lineString.find_last_not_of(WHITESPACE)+1);
|
|
57
|
+
}
|
|
53
58
|
|
|
54
59
|
lines.append(lineString.substr(lineString.find_first_not_of(WHITESPACE), lineString.find_last_not_of(WHITESPACE)+1));
|
|
55
60
|
lineNum++;
|
|
56
61
|
}
|
|
57
62
|
|
|
58
|
-
std::regex reg("Start:([\\s\\S]*)Terminal:(
|
|
63
|
+
std::regex reg("Start:([\\s\\S]*)Terminal:(.*)Productions:([\\s\\S]*)");
|
|
59
64
|
std::smatch matches;
|
|
60
65
|
if (std::regex_search(lines, matches, reg))
|
|
61
66
|
{
|
|
62
67
|
lines = matches.str(3);
|
|
63
68
|
}
|
|
64
|
-
std::string
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
while ((pos = terminalString.find(" ")) != std::string::npos)
|
|
69
|
+
std::string sString;
|
|
70
|
+
size_t pos = 0;
|
|
71
|
+
while ((pos = symbolString.find(" ")) != std::string::npos)
|
|
68
72
|
{
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
grammar->insertSymbol(
|
|
73
|
+
sString = stripSpace(symbolString.substr(0, pos));
|
|
74
|
+
symbolString.erase(0, pos + 1); //Capital is Nonterminal, Otherwise is terminal
|
|
75
|
+
grammar->insertSymbol(sString);
|
|
72
76
|
}
|
|
73
77
|
grammar->insertSymbol(symbolString);
|
|
74
78
|
grammar->setStartKind(grammar->insertSymbol(startString));
|
package/lib/MTA/LockAnalysis.cpp
CHANGED
package/lib/MTA/MHP.cpp
CHANGED
package/lib/Util/Options.cpp
CHANGED
|
@@ -790,25 +790,37 @@ const llvm::cl::opt<std::string> Options::GrammarFilename(
|
|
|
790
790
|
const llvm::cl::opt<std::string> Options::CFLGraph(
|
|
791
791
|
"cflgraph",
|
|
792
792
|
llvm::cl::init(""),
|
|
793
|
-
llvm::cl::desc("<
|
|
793
|
+
llvm::cl::desc("<Dot file as the CFLGraph input>")
|
|
794
794
|
);
|
|
795
795
|
|
|
796
796
|
const llvm::cl::opt<bool> Options::PrintCFL(
|
|
797
797
|
"print-cfl",
|
|
798
798
|
llvm::cl::init(false),
|
|
799
|
-
llvm::cl::desc("
|
|
799
|
+
llvm::cl::desc("Print ir, grammar and cflgraph for debug.")
|
|
800
800
|
);
|
|
801
801
|
|
|
802
802
|
const llvm::cl::opt<bool> Options::FlexSymMap(
|
|
803
803
|
"flex-symmap",
|
|
804
804
|
llvm::cl::init(false),
|
|
805
|
-
llvm::cl::desc("
|
|
805
|
+
llvm::cl::desc("Extend exist sym map while read graph from dot if sym not in map.")
|
|
806
|
+
);
|
|
807
|
+
|
|
808
|
+
const llvm::cl::opt<bool> Options::PEGTransfer(
|
|
809
|
+
"peg-transfer",
|
|
810
|
+
llvm::cl::init(false),
|
|
811
|
+
llvm::cl::desc("When explicit to true, cfl graph builder will transfer PAG load and store edges to copy and addr.")
|
|
812
|
+
);
|
|
813
|
+
|
|
814
|
+
const llvm::cl::opt<bool> Options::NullDummyNode(
|
|
815
|
+
"null-dummy",
|
|
816
|
+
llvm::cl::init(true),
|
|
817
|
+
llvm::cl::desc("When explicit to false, ir graph builder will skip null poiner assignment instead of generate new DummyValVarNode.")
|
|
806
818
|
);
|
|
807
819
|
|
|
808
820
|
const llvm::cl::opt<bool> Options::LoopAnalysis(
|
|
809
821
|
"loop-analysis",
|
|
810
822
|
llvm::cl::init(true),
|
|
811
|
-
llvm::cl::desc("
|
|
823
|
+
llvm::cl::desc("Analyze every func and get loop info and loop bounds.")
|
|
812
824
|
);
|
|
813
825
|
|
|
814
826
|
const llvm::cl::opt<unsigned> Options::LoopBound(
|
package/lib/Util/PTAStat.cpp
CHANGED
|
@@ -29,20 +29,20 @@
|
|
|
29
29
|
|
|
30
30
|
#include <iomanip>
|
|
31
31
|
#include "Graphs/PTACallGraph.h"
|
|
32
|
-
#include "
|
|
32
|
+
#include "Util/PTAStat.h"
|
|
33
33
|
#include "MemoryModel/PointerAnalysisImpl.h"
|
|
34
34
|
#include "MemoryModel/SVFIR.h"
|
|
35
35
|
#include "Util/Options.h"
|
|
36
36
|
|
|
37
37
|
using namespace SVF;
|
|
38
38
|
|
|
39
|
-
const char* PTAStat:: TotalAnalysisTime = "TotalTime"; ///< SVFIR value nodes
|
|
39
|
+
const char* PTAStat:: TotalAnalysisTime = "TotalTime"; ///< SVFIR value nodes ??
|
|
40
40
|
const char* PTAStat:: SCCDetectionTime = "SCCDetectTime"; ///< Total SCC detection time
|
|
41
41
|
const char* PTAStat:: SCCMergeTime = "SCCMergeTime"; ///< Total SCC merge time
|
|
42
42
|
|
|
43
43
|
const char* PTAStat:: ProcessLoadStoreTime = "LoadStoreTime"; ///< process load and store time
|
|
44
44
|
const char* PTAStat:: ProcessCopyGepTime = "CopyGepTime"; ///< process copy and gep time
|
|
45
|
-
const char* PTAStat:: UpdateCallGraphTime = "UpdateCGTime"; ///< process copy and gep time
|
|
45
|
+
const char* PTAStat:: UpdateCallGraphTime = "UpdateCGTime"; ///< process copy and gep time ??
|
|
46
46
|
|
|
47
47
|
const char* PTAStat:: TotalNumOfPointers = "TotalPointers"; ///< SVFIR value nodes
|
|
48
48
|
const char* PTAStat:: TotalNumOfObjects = "TotalObjects"; ///< Total SVFIR object node
|
|
@@ -113,6 +113,7 @@ PTAStat::PTAStat(PointerAnalysis* p) : startTime(0), endTime(0), pta(p)
|
|
|
113
113
|
|
|
114
114
|
double PTAStat::getClk(bool mark)
|
|
115
115
|
{
|
|
116
|
+
std::cout << Options::MarkedClocksOnly;
|
|
116
117
|
if (Options::MarkedClocksOnly && !mark) return 0.0;
|
|
117
118
|
|
|
118
119
|
if (Options::ClockType == ClockType::Wall)
|
package/lib/WPA/TypeAnalysis.cpp
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svf-tools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.540",
|
|
4
4
|
"description": "* <b>[TypeClone](https://github.com/SVF-tools/SVF/wiki/TypeClone) published in our [ECOOP paper](https://yuleisui.github.io/publications/ecoop20.pdf) is now available in SVF </b> * <b>SVF now uses a single script for its build. Just type [`source ./build.sh`](https://github.com/SVF-tools/SVF/blob/master/build.sh) in your terminal, that's it!</b> * <b>SVF now supports LLVM-10.0.0! </b> * <b>We thank [bsauce](https://github.com/bsauce) for writing a user manual of SVF ([link1](https://www.jianshu.com/p/068a08ec749c) and [link2](https://www.jianshu.com/p/777c30d4240e)) in Chinese </b> * <b>SVF now supports LLVM-9.0.0 (Thank [Byoungyoung Lee](https://github.com/SVF-tools/SVF/issues/142) for his help!). </b> * <b>SVF now supports a set of [field-sensitive pointer analyses](https://yuleisui.github.io/publications/sas2019a.pdf). </b> * <b>[Use SVF as an external lib](https://github.com/SVF-tools/SVF/wiki/Using-SVF-as-a-lib-in-your-own-tool) for your own project (Contributed by [Hongxu Chen](https://github.com/HongxuChen)). </b> * <b>SVF now supports LLVM-7.0.0. </b> * <b>SVF now supports Docker. [Try SVF in Docker](https://github.com/SVF-tools/SVF/wiki/Try-SVF-in-Docker)! </b> * <b>SVF now supports [LLVM-6.0.0](https://github.com/svf-tools/SVF/pull/38) (Contributed by [Jack Anthony](https://github.com/jackanth)). </b> * <b>SVF now supports [LLVM-4.0.0](https://github.com/svf-tools/SVF/pull/23) (Contributed by Jared Carlson. Thank [Jared](https://github.com/jcarlson23) and [Will](https://github.com/dtzWill) for their in-depth [discussions](https://github.com/svf-tools/SVF/pull/18) about updating SVF!) </b> * <b>SVF now supports analysis for C++ programs.</b> <br />",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|