svf-lib 1.0.1289 → 1.0.1291
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-linux/Release-build/lib/libSvf.a +0 -0
- package/SVF-linux/include/CFL/CFLAlias.h +1 -1
- package/SVF-linux/include/CFL/CFLBase.h +1 -1
- package/SVF-linux/include/CFL/CFLGrammar.h +1 -1
- package/SVF-linux/include/DDA/DDAClient.h +2 -2
- package/SVF-linux/include/DDA/DDAPass.h +3 -3
- package/SVF-linux/include/Graphs/CHG.h +5 -5
- package/SVF-linux/include/Graphs/ConsG.h +1 -1
- package/SVF-linux/include/Graphs/ConsGEdge.h +1 -1
- package/SVF-linux/include/Graphs/GenericGraph.h +1 -1
- package/SVF-linux/include/Graphs/ICFG.h +1 -1
- package/SVF-linux/include/Graphs/ICFGEdge.h +3 -3
- package/SVF-linux/include/Graphs/IRGraph.h +13 -9
- package/SVF-linux/include/Graphs/PTACallGraph.h +1 -1
- package/SVF-linux/include/Graphs/SVFGOPT.h +2 -2
- package/SVF-linux/include/Graphs/ThreadCallGraph.h +2 -2
- package/SVF-linux/include/Graphs/VFG.h +1 -1
- package/SVF-linux/include/Graphs/VFGNode.h +7 -7
- package/SVF-linux/include/MSSA/MemRegion.h +2 -2
- package/SVF-linux/include/MTA/LockAnalysis.h +1 -4
- package/SVF-linux/include/MTA/MHP.h +22 -31
- package/SVF-linux/include/MTA/MTA.h +13 -32
- package/SVF-linux/include/MTA/MTAResultValidator.h +17 -16
- package/SVF-linux/include/MTA/MTAStat.h +1 -1
- package/SVF-linux/include/MTA/TCT.h +25 -18
- package/SVF-linux/include/MemoryModel/AbstractPointsToDS.h +1 -1
- package/SVF-linux/include/MemoryModel/ConditionalPT.h +3 -2
- package/SVF-linux/include/MemoryModel/LocationSet.h +4 -4
- package/SVF-linux/include/MemoryModel/MutablePointsToDS.h +1 -1
- package/SVF-linux/include/MemoryModel/PersistentPointsToCache.h +1 -1
- package/SVF-linux/include/MemoryModel/PointerAnalysis.h +5 -4
- package/SVF-linux/include/MemoryModel/PointerAnalysisImpl.h +4 -4
- package/SVF-linux/include/MemoryModel/PointsTo.h +1 -1
- package/SVF-linux/include/MemoryModel/SVFLoop.h +1 -1
- package/SVF-linux/include/SABER/DoubleFreeChecker.h +2 -2
- package/SVF-linux/include/SABER/FileChecker.h +2 -2
- package/SVF-linux/include/SABER/LeakChecker.h +2 -2
- package/SVF-linux/include/SABER/ProgSlice.h +0 -3
- package/SVF-linux/include/SABER/SaberCondAllocator.h +7 -9
- package/SVF-linux/include/SABER/SaberSVFGBuilder.h +1 -1
- package/SVF-linux/include/SVF-LLVM/BasicTypes.h +248 -0
- package/SVF-linux/include/SVF-LLVM/BreakConstantExpr.h +94 -0
- package/SVF-linux/include/SVF-LLVM/CHGBuilder.h +73 -0
- package/SVF-linux/include/SVF-LLVM/CPPUtil.h +130 -0
- package/SVF-linux/include/SVF-LLVM/DCHG.h +481 -0
- package/SVF-linux/include/SVF-LLVM/GEPTypeBridgeIterator.h +183 -0
- package/SVF-linux/include/SVF-LLVM/ICFGBuilder.h +106 -0
- package/SVF-linux/include/SVF-LLVM/IRAnnotator.h +323 -0
- package/SVF-linux/include/SVF-LLVM/LLVMLoopAnalysis.h +59 -0
- package/SVF-linux/include/SVF-LLVM/LLVMModule.h +358 -0
- package/SVF-linux/include/SVF-LLVM/LLVMUtil.h +405 -0
- package/SVF-linux/include/SVF-LLVM/SVFIRBuilder.h +413 -0
- package/SVF-linux/include/SVF-LLVM/SymbolTableBuilder.h +113 -0
- package/SVF-linux/include/SVFIR/PAGBuilderFromFile.h +80 -0
- package/SVF-linux/include/SVFIR/SVFIR.h +661 -0
- package/SVF-linux/include/SVFIR/SVFModule.h +233 -0
- package/SVF-linux/include/SVFIR/SVFStatements.h +1101 -0
- package/SVF-linux/include/SVFIR/SVFType.h +514 -0
- package/SVF-linux/include/SVFIR/SVFValue.h +1129 -0
- package/SVF-linux/include/SVFIR/SVFVariables.h +721 -0
- package/SVF-linux/include/SVFIR/SymbolTableInfo.h +597 -0
- package/SVF-linux/include/Util/Annotator.h +1 -1
- package/SVF-linux/include/Util/CallGraphBuilder.h +74 -0
- package/SVF-linux/include/Util/Casting.h +1 -3
- package/SVF-linux/include/Util/CoreBitVector.h +1 -1
- package/SVF-linux/include/Util/CxtStmt.h +8 -8
- package/SVF-linux/include/Util/DPItem.h +1 -1
- package/SVF-linux/include/Util/ExtAPI.h +1 -1
- package/SVF-linux/include/Util/NodeIDAllocator.h +1 -1
- package/SVF-linux/include/Util/Options.h +1 -0
- package/SVF-linux/include/Util/PTAStat.h +1 -1
- package/SVF-linux/include/Util/SCC.h +1 -1
- package/SVF-linux/include/Util/SVFUtil.h +26 -95
- package/SVF-linux/include/Util/ThreadAPI.h +27 -27
- package/SVF-linux/include/Util/WorkList.h +1 -1
- package/SVF-linux/include/Util/Z3Expr.h +1 -1
- package/SVF-linux/include/WPA/Andersen.h +1 -1
- package/SVF-linux/include/WPA/CSC.h +1 -1
- package/SVF-linux/include/WPA/TypeAnalysis.h +0 -3
- package/SVF-linux/include/WPA/WPAPass.h +8 -8
- package/SVF-osx/Release-build/lib/libSvf.a +0 -0
- package/SVF-osx/include/CFL/CFLAlias.h +1 -1
- package/SVF-osx/include/CFL/CFLBase.h +1 -1
- package/SVF-osx/include/CFL/CFLGrammar.h +1 -1
- package/SVF-osx/include/DDA/DDAClient.h +2 -2
- package/SVF-osx/include/DDA/DDAPass.h +3 -3
- package/SVF-osx/include/Graphs/CHG.h +5 -5
- package/SVF-osx/include/Graphs/ConsG.h +1 -1
- package/SVF-osx/include/Graphs/ConsGEdge.h +1 -1
- package/SVF-osx/include/Graphs/GenericGraph.h +1 -1
- package/SVF-osx/include/Graphs/ICFG.h +1 -1
- package/SVF-osx/include/Graphs/ICFGEdge.h +3 -3
- package/SVF-osx/include/Graphs/IRGraph.h +13 -9
- package/SVF-osx/include/Graphs/PTACallGraph.h +1 -1
- package/SVF-osx/include/Graphs/SVFGOPT.h +2 -2
- package/SVF-osx/include/Graphs/ThreadCallGraph.h +2 -2
- package/SVF-osx/include/Graphs/VFG.h +1 -1
- package/SVF-osx/include/Graphs/VFGNode.h +7 -7
- package/SVF-osx/include/MSSA/MemRegion.h +2 -2
- package/SVF-osx/include/MTA/LockAnalysis.h +1 -4
- package/SVF-osx/include/MTA/MHP.h +22 -31
- package/SVF-osx/include/MTA/MTA.h +13 -32
- package/SVF-osx/include/MTA/MTAResultValidator.h +17 -16
- package/SVF-osx/include/MTA/MTAStat.h +1 -1
- package/SVF-osx/include/MTA/TCT.h +25 -18
- package/SVF-osx/include/MemoryModel/AbstractPointsToDS.h +1 -1
- package/SVF-osx/include/MemoryModel/ConditionalPT.h +3 -2
- package/SVF-osx/include/MemoryModel/LocationSet.h +4 -4
- package/SVF-osx/include/MemoryModel/MutablePointsToDS.h +1 -1
- package/SVF-osx/include/MemoryModel/PersistentPointsToCache.h +1 -1
- package/SVF-osx/include/MemoryModel/PointerAnalysis.h +5 -4
- package/SVF-osx/include/MemoryModel/PointerAnalysisImpl.h +4 -4
- package/SVF-osx/include/MemoryModel/PointsTo.h +1 -1
- package/SVF-osx/include/MemoryModel/SVFLoop.h +1 -1
- package/SVF-osx/include/SABER/DoubleFreeChecker.h +2 -2
- package/SVF-osx/include/SABER/FileChecker.h +2 -2
- package/SVF-osx/include/SABER/LeakChecker.h +2 -2
- package/SVF-osx/include/SABER/ProgSlice.h +0 -3
- package/SVF-osx/include/SABER/SaberCondAllocator.h +7 -9
- package/SVF-osx/include/SABER/SaberSVFGBuilder.h +1 -1
- package/SVF-osx/include/SVF-LLVM/BasicTypes.h +248 -0
- package/SVF-osx/include/SVF-LLVM/BreakConstantExpr.h +94 -0
- package/SVF-osx/include/SVF-LLVM/CHGBuilder.h +73 -0
- package/SVF-osx/include/SVF-LLVM/CPPUtil.h +130 -0
- package/SVF-osx/include/SVF-LLVM/DCHG.h +481 -0
- package/SVF-osx/include/SVF-LLVM/GEPTypeBridgeIterator.h +183 -0
- package/SVF-osx/include/SVF-LLVM/ICFGBuilder.h +106 -0
- package/SVF-osx/include/SVF-LLVM/IRAnnotator.h +323 -0
- package/SVF-osx/include/SVF-LLVM/LLVMLoopAnalysis.h +59 -0
- package/SVF-osx/include/SVF-LLVM/LLVMModule.h +358 -0
- package/SVF-osx/include/SVF-LLVM/LLVMUtil.h +405 -0
- package/SVF-osx/include/SVF-LLVM/SVFIRBuilder.h +413 -0
- package/SVF-osx/include/SVF-LLVM/SymbolTableBuilder.h +113 -0
- package/SVF-osx/include/SVFIR/PAGBuilderFromFile.h +80 -0
- package/SVF-osx/include/SVFIR/SVFIR.h +661 -0
- package/SVF-osx/include/SVFIR/SVFModule.h +233 -0
- package/SVF-osx/include/SVFIR/SVFStatements.h +1101 -0
- package/SVF-osx/include/SVFIR/SVFType.h +514 -0
- package/SVF-osx/include/SVFIR/SVFValue.h +1129 -0
- package/SVF-osx/include/SVFIR/SVFVariables.h +721 -0
- package/SVF-osx/include/SVFIR/SymbolTableInfo.h +597 -0
- package/SVF-osx/include/Util/Annotator.h +1 -1
- package/SVF-osx/include/Util/CallGraphBuilder.h +74 -0
- package/SVF-osx/include/Util/Casting.h +1 -3
- package/SVF-osx/include/Util/CoreBitVector.h +1 -1
- package/SVF-osx/include/Util/CxtStmt.h +8 -8
- package/SVF-osx/include/Util/DPItem.h +1 -1
- package/SVF-osx/include/Util/ExtAPI.h +1 -1
- package/SVF-osx/include/Util/NodeIDAllocator.h +1 -1
- package/SVF-osx/include/Util/Options.h +1 -0
- package/SVF-osx/include/Util/PTAStat.h +1 -1
- package/SVF-osx/include/Util/SCC.h +1 -1
- package/SVF-osx/include/Util/SVFUtil.h +26 -95
- package/SVF-osx/include/Util/ThreadAPI.h +27 -27
- package/SVF-osx/include/Util/WorkList.h +1 -1
- package/SVF-osx/include/Util/Z3Expr.h +1 -1
- package/SVF-osx/include/WPA/Andersen.h +1 -1
- package/SVF-osx/include/WPA/CSC.h +1 -1
- package/SVF-osx/include/WPA/TypeAnalysis.h +0 -3
- package/SVF-osx/include/WPA/WPAPass.h +8 -8
- package/package.json +1 -1
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
#define MTARESULTVALIDATOR_H_
|
|
10
10
|
|
|
11
11
|
#include "MTA/MHP.h"
|
|
12
|
+
#include "SVF-LLVM/LLVMUtil.h"
|
|
12
13
|
|
|
13
14
|
/*!
|
|
14
15
|
* Validate the result of context-sensitive analysis, including context-sensitive
|
|
@@ -52,9 +53,9 @@ protected:
|
|
|
52
53
|
std::vector<std::string> split(const std::string &s, char delim);
|
|
53
54
|
|
|
54
55
|
// Get special arguments of given call sites
|
|
55
|
-
NodeID getIntArg(const
|
|
56
|
-
std::vector<std::string> getStringArg(const
|
|
57
|
-
CallStrCxt getCxtArg(const
|
|
56
|
+
NodeID getIntArg(const Instruction* inst, unsigned int arg_num);
|
|
57
|
+
std::vector<std::string> getStringArg(const Instruction* inst, unsigned int arg_num);
|
|
58
|
+
CallStrCxt getCxtArg(const Instruction* inst, unsigned int arg_num);
|
|
58
59
|
|
|
59
60
|
/*
|
|
60
61
|
* Get the previous LoadInst or StoreInst from Instruction "I" in the
|
|
@@ -274,7 +275,7 @@ protected:
|
|
|
274
275
|
void collectValidationTargets()
|
|
275
276
|
{
|
|
276
277
|
// Collect call sites of all RC_ACCESS function calls.
|
|
277
|
-
std::vector<
|
|
278
|
+
std::vector<const CallBase*> csInsts;
|
|
278
279
|
const Function* F = nullptr;
|
|
279
280
|
for (Module &M : LLVMModuleSet::getLLVMModuleSet()->getLLVMModules())
|
|
280
281
|
{
|
|
@@ -295,9 +296,9 @@ protected:
|
|
|
295
296
|
{
|
|
296
297
|
const Use *u = &*it;
|
|
297
298
|
const Value *user = u->getUser();
|
|
298
|
-
if(
|
|
299
|
+
if(LLVMUtil::isCallSite(user))
|
|
299
300
|
{
|
|
300
|
-
|
|
301
|
+
const CallBase* csInst = LLVMUtil::getLLVMCallSite(user);
|
|
301
302
|
csInsts.push_back(csInst);
|
|
302
303
|
}
|
|
303
304
|
}
|
|
@@ -309,12 +310,12 @@ protected:
|
|
|
309
310
|
// Generate access pairs.
|
|
310
311
|
for (int i = 0, e = csInsts.size(); i != e;)
|
|
311
312
|
{
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
const ConstantInt* C = SVFUtil::dyn_cast<ConstantInt>(CI1
|
|
313
|
+
const CallBase* CI1 = csInsts[i++];
|
|
314
|
+
const CallBase* CI2 = csInsts[i++];
|
|
315
|
+
const ConstantInt* C = SVFUtil::dyn_cast<ConstantInt>(CI1->getArgOperand(1));
|
|
315
316
|
assert(C);
|
|
316
|
-
const Instruction* I1 = getPreviousMemoryAccessInst(CI1
|
|
317
|
-
const Instruction* I2 = getPreviousMemoryAccessInst(CI2
|
|
317
|
+
const Instruction* I1 = getPreviousMemoryAccessInst(CI1);
|
|
318
|
+
const Instruction* I2 = getPreviousMemoryAccessInst(CI2);
|
|
318
319
|
assert(I1 && I2 && "RC_ACCESS should be placed immediately after the target memory access.");
|
|
319
320
|
RC_FLAG flags = C->getZExtValue();
|
|
320
321
|
accessPairs.push_back(AccessPair(I1, I2, flags));
|
|
@@ -339,8 +340,8 @@ protected:
|
|
|
339
340
|
bool racy = mayHaveDataRace(I1, I2);
|
|
340
341
|
|
|
341
342
|
SVFUtil::outs() << "For the memory access pair at ("
|
|
342
|
-
<<
|
|
343
|
-
<<
|
|
343
|
+
<< LLVMModuleSet::getLLVMModuleSet()->getSVFValue(I1)->getSourceLoc() << ", "
|
|
344
|
+
<< LLVMModuleSet::getLLVMModuleSet()->getSVFValue(I2)->getSourceLoc() << ")\n";
|
|
344
345
|
if (selectedValidationScenarios & RC_ALIASES)
|
|
345
346
|
{
|
|
346
347
|
SVFUtil::outs() << "\t"
|
|
@@ -395,10 +396,10 @@ private:
|
|
|
395
396
|
* Comparison function to sort the validation targets in ascending order of
|
|
396
397
|
* the validation id (i.e., the 1st argument of RC_ACCESS function call).
|
|
397
398
|
*/
|
|
398
|
-
static bool compare(
|
|
399
|
+
static bool compare(const CallBase* CI1, const CallBase* CI2)
|
|
399
400
|
{
|
|
400
|
-
const Value *V1 = CI1
|
|
401
|
-
const Value *V2 = CI2
|
|
401
|
+
const Value *V1 = CI1->getArgOperand(0);
|
|
402
|
+
const Value *V2 = CI2->getArgOperand(0);
|
|
402
403
|
const ConstantInt* C1 = SVFUtil::dyn_cast<ConstantInt>(V1);
|
|
403
404
|
const ConstantInt* C2 = SVFUtil::dyn_cast<ConstantInt>(V2);
|
|
404
405
|
assert(0 != C1 && 0 != C2);
|
|
@@ -60,7 +60,7 @@ public:
|
|
|
60
60
|
/// Statistics for MHP statement pairs
|
|
61
61
|
void performMHPPairStat(MHP* mhp, LockAnalysis* lsa);
|
|
62
62
|
/// Statistics for annotation
|
|
63
|
-
void performAnnotationStat(MTAAnnotator* anno);
|
|
63
|
+
//void performAnnotationStat(MTAAnnotator* anno);
|
|
64
64
|
|
|
65
65
|
double TCTTime;
|
|
66
66
|
double MHPTime;
|
|
@@ -34,7 +34,6 @@
|
|
|
34
34
|
#include "Util/SVFUtil.h"
|
|
35
35
|
#include "Graphs/ThreadCallGraph.h"
|
|
36
36
|
#include "Util/CxtStmt.h"
|
|
37
|
-
#include "SVF-FE/DataFlowUtil.h"
|
|
38
37
|
#include <set>
|
|
39
38
|
#include <vector>
|
|
40
39
|
|
|
@@ -137,6 +136,7 @@ class TCT: public GenericThreadCreateTreeTy
|
|
|
137
136
|
{
|
|
138
137
|
|
|
139
138
|
public:
|
|
139
|
+
typedef SVFLoopAndDomInfo::LoopBBs LoopBBs;
|
|
140
140
|
typedef TCTEdge::ThreadCreateEdgeSet ThreadCreateEdgeSet;
|
|
141
141
|
typedef ThreadCreateEdgeSet::iterator TCTNodeIter;
|
|
142
142
|
typedef Set<const SVFFunction*> FunSet;
|
|
@@ -146,7 +146,7 @@ public:
|
|
|
146
146
|
typedef Map<CxtThread,TCTNode*> CxtThreadToNodeMap;
|
|
147
147
|
typedef Map<CxtThread,CallStrCxt> CxtThreadToForkCxt;
|
|
148
148
|
typedef Map<CxtThread,const SVFFunction*> CxtThreadToFun;
|
|
149
|
-
typedef Map<const SVFInstruction*,
|
|
149
|
+
typedef Map<const SVFInstruction*, LoopBBs> InstToLoopMap;
|
|
150
150
|
typedef FIFOWorkList<CxtThreadProc> CxtThreadProcVec;
|
|
151
151
|
typedef Set<CxtThreadProc> CxtThreadProcSet;
|
|
152
152
|
typedef SCCDetection<PTACallGraph*> ThreadCallGraphSCC;
|
|
@@ -355,29 +355,37 @@ public:
|
|
|
355
355
|
}
|
|
356
356
|
|
|
357
357
|
/// Get loop for join site
|
|
358
|
-
inline
|
|
358
|
+
inline LoopBBs& getJoinLoop(const SVFInstruction* join)
|
|
359
|
+
{
|
|
360
|
+
assert(tcg->getThreadAPI()->isTDJoin(join) && "not a join site");
|
|
361
|
+
InstToLoopMap::iterator it = joinSiteToLoopMap.find(join);
|
|
362
|
+
assert(it!=joinSiteToLoopMap.end() && "loop not found");
|
|
363
|
+
return it->second;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
inline bool hasJoinLoop(const SVFInstruction* join) const
|
|
359
367
|
{
|
|
360
368
|
assert(tcg->getThreadAPI()->isTDJoin(join) && "not a join site");
|
|
361
369
|
InstToLoopMap::const_iterator it = joinSiteToLoopMap.find(join);
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
370
|
+
return it!=joinSiteToLoopMap.end();
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
bool hasLoop(const SVFBasicBlock* bb) const
|
|
374
|
+
{
|
|
375
|
+
const SVFFunction* fun = bb->getParent();
|
|
376
|
+
return fun->hasLoopInfo(bb);
|
|
377
|
+
}
|
|
378
|
+
bool hasLoop(const SVFInstruction* inst) const
|
|
379
|
+
{
|
|
380
|
+
return hasLoop(inst->getParent());
|
|
365
381
|
}
|
|
366
382
|
/// Return true if a join instruction must be executed inside a loop
|
|
367
|
-
bool isJoinMustExecutedInLoop(const
|
|
383
|
+
bool isJoinMustExecutedInLoop(const LoopBBs& lp,const SVFInstruction* join);
|
|
368
384
|
/// Get loop for an instruction
|
|
369
|
-
const
|
|
370
|
-
/// Get dominator for a function
|
|
371
|
-
const DominatorTree* getDT(const Function* fun);
|
|
372
|
-
/// Get dominator for a function
|
|
373
|
-
const PostDominatorTree* getPostDT(const Function* fun);
|
|
385
|
+
const LoopBBs& getLoop(const SVFInstruction* inst);
|
|
374
386
|
/// Get loop for fork/join site
|
|
375
|
-
const
|
|
376
|
-
/// Get SE for function
|
|
377
|
-
ScalarEvolution* getSE(const SVFInstruction* inst);
|
|
387
|
+
const LoopBBs& getLoop(const SVFBasicBlock* bb);
|
|
378
388
|
|
|
379
|
-
/// Get the next instructions following control flow
|
|
380
|
-
void getNextInsts(const SVFInstruction* inst, InstVec& instSet);
|
|
381
389
|
/// Push calling context
|
|
382
390
|
void pushCxt(CallStrCxt& cxt, const SVFInstruction* call, const SVFFunction* callee);
|
|
383
391
|
/// Match context
|
|
@@ -558,7 +566,6 @@ private:
|
|
|
558
566
|
CxtThreadToNodeMap ctpToNodeMap; /// Map a ctp to its graph node
|
|
559
567
|
CxtThreadToForkCxt ctToForkCxtMap; /// Map a CxtThread to the context at its spawning site (fork site).
|
|
560
568
|
CxtThreadToFun ctToRoutineFunMap; /// Map a CxtThread to its start routine function.
|
|
561
|
-
PTACFInfoBuilder loopInfoBuilder; ///< LoopInfo
|
|
562
569
|
InstToLoopMap joinSiteToLoopMap; ///< map an inloop join to its loop class
|
|
563
570
|
InstSet inRecurJoinSites; ///< Fork or Join sites in recursions
|
|
564
571
|
};
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
#include "Util/SVFUtil.h"
|
|
34
34
|
#include "MemoryModel/PointsTo.h"
|
|
35
|
+
#include <sstream>
|
|
35
36
|
|
|
36
37
|
namespace SVF
|
|
37
38
|
{
|
|
@@ -108,7 +109,7 @@ public:
|
|
|
108
109
|
inline std::string toString() const
|
|
109
110
|
{
|
|
110
111
|
std::string str;
|
|
111
|
-
|
|
112
|
+
std::stringstream rawstr(str);
|
|
112
113
|
rawstr << "<" << m_id << " " << m_cond.toString() << "> ";
|
|
113
114
|
return rawstr.str();
|
|
114
115
|
}
|
|
@@ -273,7 +274,7 @@ public:
|
|
|
273
274
|
inline std::string toString() const
|
|
274
275
|
{
|
|
275
276
|
std::string str;
|
|
276
|
-
|
|
277
|
+
std::stringstream rawstr(str);
|
|
277
278
|
rawstr << "{ ";
|
|
278
279
|
for (const_iterator i = elements.begin(); i != elements.end(); ++i)
|
|
279
280
|
{
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
#define LOCATIONSET_H_
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
#include "
|
|
37
|
+
#include "SVFIR/SVFValue.h"
|
|
38
38
|
|
|
39
39
|
namespace SVF
|
|
40
40
|
{
|
|
@@ -54,7 +54,7 @@ public:
|
|
|
54
54
|
NonOverlap, Overlap, Subset, Superset, Same
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
-
typedef std::vector<std::pair<const
|
|
57
|
+
typedef std::vector<std::pair<const SVFValue*, const SVFType*> > OffsetValueVec;
|
|
58
58
|
|
|
59
59
|
/// Constructor
|
|
60
60
|
LocationSet(s32_t o = 0) : fldIdx(o)
|
|
@@ -105,9 +105,9 @@ public:
|
|
|
105
105
|
s32_t accumulateConstantOffset() const;
|
|
106
106
|
|
|
107
107
|
/// Return element number of a type.
|
|
108
|
-
u32_t getElementNum(const
|
|
108
|
+
u32_t getElementNum(const SVFType* type) const;
|
|
109
109
|
|
|
110
|
-
bool addOffsetValue(const
|
|
110
|
+
bool addOffsetValue(const SVFValue* offsetValue, const SVFType* type);
|
|
111
111
|
|
|
112
112
|
/// Return TRUE if this is a constant location set.
|
|
113
113
|
bool isConstantOffset() const;
|
|
@@ -33,12 +33,13 @@
|
|
|
33
33
|
#include <unistd.h>
|
|
34
34
|
#include <signal.h>
|
|
35
35
|
|
|
36
|
-
#include "
|
|
36
|
+
#include "SVFIR/SVFIR.h"
|
|
37
37
|
#include "MemoryModel/ConditionalPT.h"
|
|
38
38
|
#include "MemoryModel/AbstractPointsToDS.h"
|
|
39
39
|
#include "MemoryModel/MutablePointsToDS.h"
|
|
40
40
|
#include "MemoryModel/PersistentPointsToDS.h"
|
|
41
41
|
#include "Graphs/PTACallGraph.h"
|
|
42
|
+
#include "Graphs/CHG.h"
|
|
42
43
|
#include "Util/SCC.h"
|
|
43
44
|
#include "MemoryModel/PointsTo.h"
|
|
44
45
|
|
|
@@ -104,7 +105,7 @@ public:
|
|
|
104
105
|
typedef Set<const SVFFunction*> FunctionSet;
|
|
105
106
|
typedef OrderedMap<const CallICFGNode*, FunctionSet> CallEdgeMap;
|
|
106
107
|
typedef SCCDetection<PTACallGraph*> CallGraphSCC;
|
|
107
|
-
typedef Set<const
|
|
108
|
+
typedef Set<const SVFGlobalValue*> VTableSet;
|
|
108
109
|
typedef Set<const SVFFunction*> VFunSet;
|
|
109
110
|
//@}
|
|
110
111
|
|
|
@@ -235,8 +236,8 @@ public:
|
|
|
235
236
|
virtual void computeDDAPts(NodeID) {}
|
|
236
237
|
|
|
237
238
|
/// Interface exposed to users of our pointer analysis, given Value infos
|
|
238
|
-
virtual AliasResult alias(const
|
|
239
|
-
const
|
|
239
|
+
virtual AliasResult alias(const SVFValue* V1,
|
|
240
|
+
const SVFValue* V2) = 0;
|
|
240
241
|
|
|
241
242
|
/// Interface exposed to users of our pointer analysis, given PAGNodeID
|
|
242
243
|
virtual AliasResult alias(NodeID node1, NodeID node2) = 0;
|
|
@@ -218,8 +218,8 @@ private:
|
|
|
218
218
|
|
|
219
219
|
public:
|
|
220
220
|
/// Interface expose to users of our pointer analysis, given Value infos
|
|
221
|
-
virtual AliasResult alias(const
|
|
222
|
-
const
|
|
221
|
+
virtual AliasResult alias(const SVFValue* V1,
|
|
222
|
+
const SVFValue* V2);
|
|
223
223
|
|
|
224
224
|
/// Interface expose to users of our pointer analysis, given PAGNodeID
|
|
225
225
|
virtual AliasResult alias(NodeID node1, NodeID node2);
|
|
@@ -504,7 +504,7 @@ public:
|
|
|
504
504
|
}
|
|
505
505
|
|
|
506
506
|
/// Interface expose to users of our pointer analysis, given Value infos
|
|
507
|
-
virtual inline AliasResult alias(const
|
|
507
|
+
virtual inline AliasResult alias(const SVFValue* V1, const SVFValue* V2)
|
|
508
508
|
{
|
|
509
509
|
return alias(pag->getValueNode(V1),pag->getValueNode(V2));
|
|
510
510
|
}
|
|
@@ -573,7 +573,7 @@ public:
|
|
|
573
573
|
}
|
|
574
574
|
else if (!SVFUtil::isa<DummyValVar>(node))
|
|
575
575
|
{
|
|
576
|
-
SVFUtil::outs() << "##<" << node->getValue()->getName()
|
|
576
|
+
SVFUtil::outs() << "##<" << node->getValue()->getName() << "> ";
|
|
577
577
|
//SVFUtil::outs() << "Source Loc: " << SVFUtil::getSourceLoc(node->getValue());
|
|
578
578
|
}
|
|
579
579
|
|
|
@@ -54,10 +54,10 @@ public:
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
/// We start from here
|
|
57
|
-
virtual bool runOnModule(
|
|
57
|
+
virtual bool runOnModule(SVFIR* pag) override
|
|
58
58
|
{
|
|
59
59
|
/// start analysis
|
|
60
|
-
analyze(
|
|
60
|
+
analyze(pag->getModule());
|
|
61
61
|
return false;
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -30,9 +30,8 @@
|
|
|
30
30
|
#ifndef PATHALLOCATOR_H_
|
|
31
31
|
#define PATHALLOCATOR_H_
|
|
32
32
|
|
|
33
|
-
#include "
|
|
34
|
-
#include "
|
|
35
|
-
#include "SVF-FE/BasicTypes.h"
|
|
33
|
+
#include "SVFIR/SVFModule.h"
|
|
34
|
+
#include "SVFIR/SVFValue.h"
|
|
36
35
|
#include "Util/WorkList.h"
|
|
37
36
|
#include "Graphs/SVFG.h"
|
|
38
37
|
#include "Util/Z3Expr.h"
|
|
@@ -272,15 +271,15 @@ private:
|
|
|
272
271
|
/// Evaluate test null/not null like expressions
|
|
273
272
|
//@{
|
|
274
273
|
/// Return true if the predicate of this compare instruction is equal
|
|
275
|
-
bool isEQCmp(const
|
|
274
|
+
bool isEQCmp(const CmpStmt* cmp) const;
|
|
276
275
|
/// Return true if the predicate of this compare instruction is not equal
|
|
277
|
-
bool isNECmp(const
|
|
276
|
+
bool isNECmp(const CmpStmt* cmp) const;
|
|
278
277
|
/// Return true if this is a test null expression
|
|
279
|
-
bool isTestNullExpr(const
|
|
278
|
+
bool isTestNullExpr(const SVFValue* test) const;
|
|
280
279
|
/// Return true if this is a test not null expression
|
|
281
|
-
bool isTestNotNullExpr(const
|
|
280
|
+
bool isTestNotNullExpr(const SVFValue* test) const;
|
|
282
281
|
/// Return true if two values on the predicate are what we want
|
|
283
|
-
bool isTestContainsNullAndTheValue(const
|
|
282
|
+
bool isTestContainsNullAndTheValue(const CmpStmt* cmp) const;
|
|
284
283
|
//@}
|
|
285
284
|
|
|
286
285
|
/// Release memory
|
|
@@ -293,7 +292,6 @@ private:
|
|
|
293
292
|
void extractSubConds(const Condition &condition, NodeBS &support) const;
|
|
294
293
|
|
|
295
294
|
|
|
296
|
-
PTACFInfoBuilder cfInfoBuilder; ///< map a function to its loop info
|
|
297
295
|
FunToExitBBsMap funToExitBBsMap; ///< map a function to all its basic blocks calling program exit
|
|
298
296
|
BBToCondMap bbToCondMap; ///< map a basic block to its path condition starting from root
|
|
299
297
|
const SVFGNode* curEvalSVFGNode{}; ///< current llvm value to evaluate branch condition when computing guards
|