svf-lib 1.0.2584 → 1.0.2586
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-aarch64/include/AE/Svfexe/AbsExtAPI.h +7 -0
- package/SVF-osx/include/AE/Core/AbstractState.h +1 -1
- package/SVF-osx/include/AE/Core/AddressValue.h +6 -6
- package/SVF-osx/include/AE/Core/IntervalValue.h +64 -64
- package/SVF-osx/include/AE/Core/NumericValue.h +45 -45
- package/SVF-osx/include/AE/Svfexe/AEDetector.h +7 -7
- package/SVF-osx/include/DDA/FlowDDA.h +2 -2
- package/SVF-osx/include/Graphs/CDG.h +3 -3
- package/SVF-osx/include/Graphs/CHG.h +3 -3
- package/SVF-osx/include/Graphs/IRGraph.h +3 -3
- package/SVF-osx/include/Graphs/VFG.h +6 -6
- package/SVF-osx/include/Graphs/WTO.h +1 -1
- package/SVF-osx/include/MTA/LockAnalysis.h +8 -8
- package/SVF-osx/include/MemoryModel/ConditionalPT.h +69 -69
- package/SVF-osx/include/MemoryModel/MutablePointsToDS.h +33 -33
- package/SVF-osx/include/MemoryModel/PersistentPointsToDS.h +18 -18
- package/SVF-osx/include/SABER/SaberCheckerAPI.h +2 -2
- package/SVF-osx/include/SVF-LLVM/GEPTypeBridgeIterator.h +13 -13
- package/SVF-osx/include/SVF-LLVM/LLVMModule.h +2 -2
- package/SVF-osx/include/SVFIR/SVFIR.h +3 -3
- package/SVF-osx/include/SVFIR/SVFVariables.h +1 -1
- package/SVF-osx/include/Util/CommandLine.h +10 -10
- package/SVF-osx/include/Util/SparseBitVector.h +29 -29
- package/SVF-osx/include/Util/iterator.h +15 -15
- package/SVF-osx/lib/libSvfLLVM.3.4.dylib +0 -0
- package/package.json +1 -1
|
@@ -261,13 +261,13 @@ public:
|
|
|
261
261
|
bool intersects(const CondStdSet<Element>& rhs) const
|
|
262
262
|
{
|
|
263
263
|
if (empty() && rhs.empty())
|
|
264
|
-
|
|
264
|
+
return false;
|
|
265
265
|
|
|
266
266
|
for (const_iterator i = rhs.begin(); i != rhs.end(); ++i)
|
|
267
267
|
{
|
|
268
268
|
if (elements.find(*i) != elements.end())
|
|
269
|
-
|
|
270
|
-
|
|
269
|
+
return true;
|
|
270
|
+
}
|
|
271
271
|
return false;
|
|
272
272
|
}
|
|
273
273
|
|
|
@@ -382,17 +382,17 @@ public:
|
|
|
382
382
|
inline unsigned numElement() const
|
|
383
383
|
{
|
|
384
384
|
if (_condPts.empty())
|
|
385
|
-
|
|
385
|
+
return 0;
|
|
386
386
|
else
|
|
387
387
|
{
|
|
388
388
|
unsigned num = 0;
|
|
389
389
|
for (CondPtsConstIter it = cptsBegin(); it != cptsEnd(); it++)
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
390
|
+
{
|
|
391
|
+
PointsTo pts = it->second;
|
|
392
|
+
num += pts.count();
|
|
393
|
+
}
|
|
394
|
+
return num;
|
|
393
395
|
}
|
|
394
|
-
return num;
|
|
395
|
-
}
|
|
396
396
|
}
|
|
397
397
|
/// Return true if no element in the set
|
|
398
398
|
inline bool empty() const
|
|
@@ -434,49 +434,49 @@ public:
|
|
|
434
434
|
inline bool aliased(const CondPointsToSet<Cond>& rhs) const
|
|
435
435
|
{
|
|
436
436
|
if (pointsTo().empty() || rhs.pointsTo().empty())
|
|
437
|
-
|
|
437
|
+
return false;
|
|
438
438
|
else
|
|
439
439
|
{
|
|
440
440
|
CondPtsConstIter lit = cptsBegin(), elit = cptsEnd();
|
|
441
|
-
|
|
442
|
-
{
|
|
443
|
-
const Cond& lc = lit->first;
|
|
444
|
-
const PointsTo& pts = lit->second;
|
|
445
|
-
CondPtsConstIter rit = rhs.pointsTo().find(lc);
|
|
446
|
-
if(rit !=rhs.pointsTo().end())
|
|
441
|
+
for (; lit != elit; ++lit)
|
|
447
442
|
{
|
|
448
|
-
const
|
|
449
|
-
|
|
450
|
-
|
|
443
|
+
const Cond& lc = lit->first;
|
|
444
|
+
const PointsTo& pts = lit->second;
|
|
445
|
+
CondPtsConstIter rit = rhs.pointsTo().find(lc);
|
|
446
|
+
if(rit !=rhs.pointsTo().end())
|
|
447
|
+
{
|
|
448
|
+
const PointsTo& rpts = rit->second;
|
|
449
|
+
if (pts.intersects(rpts))
|
|
450
|
+
return true;
|
|
451
|
+
}
|
|
451
452
|
}
|
|
453
|
+
return false;
|
|
452
454
|
}
|
|
453
|
-
return false;
|
|
454
|
-
}
|
|
455
455
|
}
|
|
456
456
|
|
|
457
457
|
/// Check whether this CondPointsToSet is a subset of RHS
|
|
458
458
|
inline bool isSubset(const CondPointsToSet<Cond>& rhs) const
|
|
459
459
|
{
|
|
460
460
|
if (pointsTo().size() > rhs.pointsTo().size())
|
|
461
|
-
|
|
461
|
+
return false;
|
|
462
462
|
else
|
|
463
463
|
{
|
|
464
464
|
CondPtsConstIter lit = cptsBegin(), elit = cptsEnd();
|
|
465
|
-
|
|
466
|
-
{
|
|
467
|
-
const Cond& lc = lit->first;
|
|
468
|
-
CondPtsConstIter rit = rhs.pointsTo().find(lc);
|
|
469
|
-
if (rit == rhs.pointsTo().end())
|
|
470
|
-
return false;
|
|
471
|
-
else
|
|
465
|
+
for (; lit != elit; ++lit)
|
|
472
466
|
{
|
|
473
|
-
const
|
|
474
|
-
|
|
475
|
-
if (
|
|
467
|
+
const Cond& lc = lit->first;
|
|
468
|
+
CondPtsConstIter rit = rhs.pointsTo().find(lc);
|
|
469
|
+
if (rit == rhs.pointsTo().end())
|
|
476
470
|
return false;
|
|
471
|
+
else
|
|
472
|
+
{
|
|
473
|
+
const PointsTo& pts = lit->second;
|
|
474
|
+
const PointsTo& rpts = rit->second;
|
|
475
|
+
if (!rpts.contains(pts))
|
|
476
|
+
return false;
|
|
477
|
+
}
|
|
477
478
|
}
|
|
478
479
|
}
|
|
479
|
-
}
|
|
480
480
|
return true;
|
|
481
481
|
}
|
|
482
482
|
|
|
@@ -485,20 +485,20 @@ public:
|
|
|
485
485
|
{
|
|
486
486
|
/// if either cpts is empty, just return.
|
|
487
487
|
if (pointsTo().empty() && rhs->pointsTo().empty())
|
|
488
|
-
|
|
488
|
+
return false;
|
|
489
489
|
|
|
490
490
|
CondPtsConstIter it = rhs->cptsBegin(), eit = rhs->cptsEnd();
|
|
491
491
|
for (; it != eit; ++it)
|
|
492
492
|
{
|
|
493
493
|
const Cond& cond = it->first;
|
|
494
494
|
if (hasPointsTo(cond))
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
495
|
+
{
|
|
496
|
+
const PointsTo& rhs_pts= it->second;
|
|
497
|
+
const PointsTo& pts= pointsTo(cond);
|
|
498
|
+
if (pts.intersects(rhs_pts))
|
|
499
|
+
return true;
|
|
500
|
+
}
|
|
500
501
|
}
|
|
501
|
-
}
|
|
502
502
|
|
|
503
503
|
return false;
|
|
504
504
|
}
|
|
@@ -634,44 +634,44 @@ public:
|
|
|
634
634
|
inline bool operator< (const CondPointsToSet<Cond>& rhs) const
|
|
635
635
|
{
|
|
636
636
|
if (pointsTo().size() < rhs.pointsTo().size())
|
|
637
|
-
|
|
637
|
+
return true;
|
|
638
638
|
else if (pointsTo().size() == rhs.pointsTo().size())
|
|
639
639
|
{
|
|
640
640
|
CondPtsConstIter lit = cptsBegin(), elit = cptsEnd();
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
{
|
|
644
|
-
const Cond& lc = lit->first;
|
|
645
|
-
const Cond& rc = rit->first;
|
|
646
|
-
if (lc < rc)
|
|
647
|
-
return true;
|
|
648
|
-
else if (lc == rc)
|
|
641
|
+
CondPtsConstIter rit = rhs.cptsBegin(), erit = rhs.cptsEnd();
|
|
642
|
+
for (; lit != elit && rit != erit; ++lit, ++rit)
|
|
649
643
|
{
|
|
650
|
-
const
|
|
651
|
-
const
|
|
652
|
-
if (
|
|
644
|
+
const Cond& lc = lit->first;
|
|
645
|
+
const Cond& rc = rit->first;
|
|
646
|
+
if (lc < rc)
|
|
653
647
|
return true;
|
|
654
|
-
else if (
|
|
648
|
+
else if (lc == rc)
|
|
655
649
|
{
|
|
656
|
-
PointsTo
|
|
657
|
-
PointsTo
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
650
|
+
const PointsTo& lpts = lit->second;
|
|
651
|
+
const PointsTo& rpts = rit->second;
|
|
652
|
+
if (lpts.count() < rpts.count())
|
|
653
|
+
return true;
|
|
654
|
+
else if (lpts.count() == rpts.count())
|
|
661
655
|
{
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
656
|
+
PointsTo::iterator bit = lpts.begin();
|
|
657
|
+
PointsTo::iterator eit = lpts.end();
|
|
658
|
+
PointsTo::iterator rbit = rpts.begin();
|
|
659
|
+
PointsTo::iterator reit = rpts.end();
|
|
660
|
+
for (; bit != eit && rbit != reit; bit++, rbit++)
|
|
661
|
+
{
|
|
662
|
+
if (*bit < *rbit)
|
|
663
|
+
return true;
|
|
664
|
+
else if (*bit > *rbit)
|
|
665
|
+
return false;
|
|
666
|
+
}
|
|
666
667
|
}
|
|
668
|
+
else
|
|
669
|
+
return false;
|
|
667
670
|
}
|
|
668
671
|
else
|
|
669
672
|
return false;
|
|
670
673
|
}
|
|
671
|
-
else
|
|
672
|
-
return false;
|
|
673
674
|
}
|
|
674
|
-
}
|
|
675
675
|
return false;
|
|
676
676
|
}
|
|
677
677
|
|
|
@@ -685,8 +685,8 @@ public:
|
|
|
685
685
|
inline bool test(const SingleCondVar& var) const
|
|
686
686
|
{
|
|
687
687
|
if (hasPointsTo(var.get_cond()))
|
|
688
|
-
|
|
689
|
-
|
|
688
|
+
{
|
|
689
|
+
const PointsTo& pts = pointsTo(var.get_cond());
|
|
690
690
|
return pts.test(var.get_id());
|
|
691
691
|
}
|
|
692
692
|
return false;
|
|
@@ -763,11 +763,11 @@ private:
|
|
|
763
763
|
{
|
|
764
764
|
// If they are both at the end, ignore the rest of the fields.
|
|
765
765
|
if (atEnd && RHS.atEnd)
|
|
766
|
-
|
|
766
|
+
return true;
|
|
767
767
|
// Otherwise they are the same if they have the same condVar
|
|
768
768
|
return atEnd == RHS.atEnd && RHS._curIter == _curIter && RHS._ptIter == _ptIter;
|
|
769
769
|
}
|
|
770
|
-
|
|
770
|
+
bool operator!=(const CondPtsSetIterator &RHS) const
|
|
771
771
|
{
|
|
772
772
|
return !(*this == RHS);
|
|
773
773
|
}
|
|
@@ -129,10 +129,10 @@ public:
|
|
|
129
129
|
|
|
130
130
|
virtual void remapAllPts(void) override
|
|
131
131
|
{
|
|
132
|
-
|
|
132
|
+
for (typename PtsMap::value_type &ppt : ptsMap) ppt.second.checkAndRemap();
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
|
|
135
|
+
virtual inline Map<DataSet, unsigned> getAllPts(bool liveOnly) const override
|
|
136
136
|
{
|
|
137
137
|
Map<DataSet, unsigned> allPts;
|
|
138
138
|
for (typename PtsMap::value_type ppt : ptsMap)
|
|
@@ -287,11 +287,11 @@ public:
|
|
|
287
287
|
virtual void remapAllPts(void) override
|
|
288
288
|
{
|
|
289
289
|
mutPTData.remapAllPts();
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
290
|
+
for (typename PtsMap::value_type &ppt : diffPtsMap) ppt.second.checkAndRemap();
|
|
291
|
+
for (typename PtsMap::value_type &ppt : propaPtsMap) ppt.second.checkAndRemap();
|
|
292
|
+
}
|
|
293
293
|
|
|
294
|
-
|
|
294
|
+
virtual inline void dumpPTData() override
|
|
295
295
|
{
|
|
296
296
|
mutPTData.dumpPTData();
|
|
297
297
|
}
|
|
@@ -546,14 +546,14 @@ public:
|
|
|
546
546
|
virtual void remapAllPts(void) override
|
|
547
547
|
{
|
|
548
548
|
mutPTData.remapAllPts();
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
549
|
+
for (typename DFPtsMap::value_type &lopt : dfInPtsMap)
|
|
550
|
+
{
|
|
551
|
+
for (typename PtsMap::value_type &opt : lopt.second) opt.second.checkAndRemap();
|
|
552
552
|
}
|
|
553
553
|
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
554
|
+
for (typename DFPtsMap::value_type &lopt : dfOutPtsMap)
|
|
555
|
+
{
|
|
556
|
+
for (typename PtsMap::value_type &opt : lopt.second) opt.second.checkAndRemap();
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
559
|
///@}
|
|
@@ -617,9 +617,9 @@ public:
|
|
|
617
617
|
std::error_code ErrInfo;
|
|
618
618
|
std::fstream f("svfg_pts.data", std::ios_base::out);
|
|
619
619
|
if (f.good())
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
620
|
+
{
|
|
621
|
+
NodeBS locs;
|
|
622
|
+
for(DFPtsMapconstIter it = dfInPtsMap.begin(), eit = dfInPtsMap.end(); it!=eit; ++it)
|
|
623
623
|
locs.set(it->first);
|
|
624
624
|
|
|
625
625
|
for(DFPtsMapconstIter it = dfOutPtsMap.begin(), eit = dfOutPtsMap.end(); it!=eit; ++it)
|
|
@@ -707,9 +707,9 @@ public:
|
|
|
707
707
|
virtual inline bool updateDFInFromIn(LocID srcLoc, const Key& srcVar, LocID dstLoc, const Key& dstVar) override
|
|
708
708
|
{
|
|
709
709
|
if(varHasNewDFInPts(srcLoc, srcVar) &&
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
710
|
+
this->unionPts(this->getDFInPtsSet(dstLoc,dstVar), this->getDFInPtsSet(srcLoc,srcVar)))
|
|
711
|
+
{
|
|
712
|
+
setVarDFInSetUpdated(dstLoc,dstVar);
|
|
713
713
|
return true;
|
|
714
714
|
}
|
|
715
715
|
return false;
|
|
@@ -718,9 +718,9 @@ public:
|
|
|
718
718
|
virtual inline bool updateDFInFromOut(LocID srcLoc, const Key& srcVar, LocID dstLoc, const Key& dstVar) override
|
|
719
719
|
{
|
|
720
720
|
if(varHasNewDFOutPts(srcLoc, srcVar) &&
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
721
|
+
this->unionPts(this->getDFInPtsSet(dstLoc,dstVar), this->getDFOutPtsSet(srcLoc,srcVar)))
|
|
722
|
+
{
|
|
723
|
+
setVarDFInSetUpdated(dstLoc,dstVar);
|
|
724
724
|
return true;
|
|
725
725
|
}
|
|
726
726
|
return false;
|
|
@@ -729,8 +729,8 @@ public:
|
|
|
729
729
|
virtual inline bool updateDFOutFromIn(LocID srcLoc, const Key& srcVar, LocID dstLoc, const Key& dstVar) override
|
|
730
730
|
{
|
|
731
731
|
if(varHasNewDFInPts(srcLoc,srcVar))
|
|
732
|
-
|
|
733
|
-
|
|
732
|
+
{
|
|
733
|
+
removeVarFromDFInUpdatedSet(srcLoc,srcVar);
|
|
734
734
|
if (this->unionPts(this->getDFOutPtsSet(dstLoc,dstVar), this->getDFInPtsSet(srcLoc,srcVar)))
|
|
735
735
|
{
|
|
736
736
|
setVarDFOutSetUpdated(dstLoc,dstVar);
|
|
@@ -743,8 +743,8 @@ public:
|
|
|
743
743
|
virtual inline bool updateAllDFInFromOut(LocID srcLoc, const Key& srcVar, LocID dstLoc, const Key& dstVar) override
|
|
744
744
|
{
|
|
745
745
|
if(this->unionPts(this->getDFInPtsSet(dstLoc,dstVar), this->getDFOutPtsSet(srcLoc,srcVar)))
|
|
746
|
-
|
|
747
|
-
|
|
746
|
+
{
|
|
747
|
+
setVarDFInSetUpdated(dstLoc,dstVar);
|
|
748
748
|
return true;
|
|
749
749
|
}
|
|
750
750
|
return false;
|
|
@@ -753,8 +753,8 @@ public:
|
|
|
753
753
|
virtual inline bool updateAllDFInFromIn(LocID srcLoc, const Key& srcVar, LocID dstLoc, const Key& dstVar) override
|
|
754
754
|
{
|
|
755
755
|
if(this->unionPts(this->getDFInPtsSet(dstLoc,dstVar), this->getDFInPtsSet(srcLoc,srcVar)))
|
|
756
|
-
|
|
757
|
-
|
|
756
|
+
{
|
|
757
|
+
setVarDFInSetUpdated(dstLoc,dstVar);
|
|
758
758
|
return true;
|
|
759
759
|
}
|
|
760
760
|
return false;
|
|
@@ -783,8 +783,8 @@ public:
|
|
|
783
783
|
virtual inline bool updateTLVPts(LocID srcLoc, const Key& srcVar, const Key& dstVar) override
|
|
784
784
|
{
|
|
785
785
|
if(varHasNewDFInPts(srcLoc,srcVar))
|
|
786
|
-
|
|
787
|
-
|
|
786
|
+
{
|
|
787
|
+
removeVarFromDFInUpdatedSet(srcLoc,srcVar);
|
|
788
788
|
return this->mutPTData.unionPts(dstVar, this->getDFInPtsSet(srcLoc,srcVar));
|
|
789
789
|
}
|
|
790
790
|
return false;
|
|
@@ -793,8 +793,8 @@ public:
|
|
|
793
793
|
virtual inline bool updateATVPts(const Key& srcVar, LocID dstLoc, const Key& dstVar) override
|
|
794
794
|
{
|
|
795
795
|
if (this->unionPts(this->getDFOutPtsSet(dstLoc, dstVar), this->mutPTData.getPts(srcVar)))
|
|
796
|
-
|
|
797
|
-
|
|
796
|
+
{
|
|
797
|
+
setVarDFOutSetUpdated(dstLoc, dstVar);
|
|
798
798
|
return true;
|
|
799
799
|
}
|
|
800
800
|
return false;
|
|
@@ -803,8 +803,8 @@ public:
|
|
|
803
803
|
virtual inline void clearAllDFOutUpdatedVar(LocID loc) override
|
|
804
804
|
{
|
|
805
805
|
if (this->hasDFOutSet(loc))
|
|
806
|
-
|
|
807
|
-
|
|
806
|
+
{
|
|
807
|
+
DataSet pts = getDFOutUpdatedVar(loc);
|
|
808
808
|
for (DataIter ptsIt = pts.begin(), ptsEit = pts.end(); ptsIt != ptsEit; ++ptsIt)
|
|
809
809
|
{
|
|
810
810
|
const Key var = *ptsIt;
|
|
@@ -599,9 +599,9 @@ public:
|
|
|
599
599
|
inline bool updateDFInFromIn(LocID srcLoc, const Key& srcVar, LocID dstLoc, const Key& dstVar) override
|
|
600
600
|
{
|
|
601
601
|
if (varHasNewDFInPts(srcLoc, srcVar)
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
602
|
+
&& this->unionPtsThroughIds(this->getDFInPtIdRef(dstLoc, dstVar), this->getDFInPtIdRef(srcLoc, srcVar)))
|
|
603
|
+
{
|
|
604
|
+
setVarDFInSetUpdated(dstLoc, dstVar);
|
|
605
605
|
return true;
|
|
606
606
|
}
|
|
607
607
|
|
|
@@ -611,9 +611,9 @@ public:
|
|
|
611
611
|
inline bool updateDFInFromOut(LocID srcLoc, const Key& srcVar, LocID dstLoc, const Key& dstVar) override
|
|
612
612
|
{
|
|
613
613
|
if (varHasNewDFOutPts(srcLoc, srcVar)
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
614
|
+
&& this->unionPtsThroughIds(this->getDFInPtIdRef(dstLoc, dstVar), this->getDFOutPtIdRef(srcLoc, srcVar)))
|
|
615
|
+
{
|
|
616
|
+
setVarDFInSetUpdated(dstLoc, dstVar);
|
|
617
617
|
return true;
|
|
618
618
|
}
|
|
619
619
|
|
|
@@ -623,8 +623,8 @@ public:
|
|
|
623
623
|
inline bool updateDFOutFromIn(LocID srcLoc, const Key& srcVar, LocID dstLoc, const Key& dstVar) override
|
|
624
624
|
{
|
|
625
625
|
if (varHasNewDFInPts(srcLoc, srcVar))
|
|
626
|
-
|
|
627
|
-
|
|
626
|
+
{
|
|
627
|
+
removeVarFromDFInUpdatedSet(srcLoc, srcVar);
|
|
628
628
|
if (this->unionPtsThroughIds(this->getDFOutPtIdRef(dstLoc, dstVar), this->getDFInPtIdRef(srcLoc, srcVar)))
|
|
629
629
|
{
|
|
630
630
|
setVarDFOutSetUpdated(dstLoc, dstVar);
|
|
@@ -638,8 +638,8 @@ public:
|
|
|
638
638
|
inline bool updateAllDFInFromOut(LocID srcLoc, const Key& srcVar, LocID dstLoc, const Key& dstVar) override
|
|
639
639
|
{
|
|
640
640
|
if (this->unionPtsThroughIds(this->getDFInPtIdRef(dstLoc, dstVar), this->getDFOutPtIdRef(srcLoc, srcVar)))
|
|
641
|
-
|
|
642
|
-
|
|
641
|
+
{
|
|
642
|
+
setVarDFInSetUpdated(dstLoc, dstVar);
|
|
643
643
|
return true;
|
|
644
644
|
}
|
|
645
645
|
|
|
@@ -649,8 +649,8 @@ public:
|
|
|
649
649
|
inline bool updateAllDFInFromIn(LocID srcLoc, const Key& srcVar, LocID dstLoc, const Key& dstVar) override
|
|
650
650
|
{
|
|
651
651
|
if (this->unionPtsThroughIds(this->getDFInPtIdRef(dstLoc, dstVar), this->getDFInPtIdRef(srcLoc, srcVar)))
|
|
652
|
-
|
|
653
|
-
|
|
652
|
+
{
|
|
653
|
+
setVarDFInSetUpdated(dstLoc, dstVar);
|
|
654
654
|
return true;
|
|
655
655
|
}
|
|
656
656
|
|
|
@@ -678,8 +678,8 @@ public:
|
|
|
678
678
|
inline bool updateTLVPts(LocID srcLoc, const Key& srcVar, const Key& dstVar) override
|
|
679
679
|
{
|
|
680
680
|
if (varHasNewDFInPts(srcLoc, srcVar))
|
|
681
|
-
|
|
682
|
-
|
|
681
|
+
{
|
|
682
|
+
removeVarFromDFInUpdatedSet(srcLoc, srcVar);
|
|
683
683
|
return this->unionPtsThroughIds(this->persPTData.ptsMap[dstVar], this->getDFInPtIdRef(srcLoc, srcVar));
|
|
684
684
|
}
|
|
685
685
|
|
|
@@ -689,8 +689,8 @@ public:
|
|
|
689
689
|
inline bool updateATVPts(const Key& srcVar, LocID dstLoc, const Key& dstVar) override
|
|
690
690
|
{
|
|
691
691
|
if (this->unionPtsThroughIds(this->getDFOutPtIdRef(dstLoc, dstVar), this->persPTData.ptsMap[srcVar]))
|
|
692
|
-
|
|
693
|
-
|
|
692
|
+
{
|
|
693
|
+
setVarDFOutSetUpdated(dstLoc, dstVar);
|
|
694
694
|
return true;
|
|
695
695
|
}
|
|
696
696
|
|
|
@@ -700,8 +700,8 @@ public:
|
|
|
700
700
|
inline void clearAllDFOutUpdatedVar(LocID loc) override
|
|
701
701
|
{
|
|
702
702
|
if (this->hasDFOutSet(loc))
|
|
703
|
-
|
|
704
|
-
|
|
703
|
+
{
|
|
704
|
+
const KeySet vars = getDFOutUpdatedVar(loc);
|
|
705
705
|
for (const Key &var : vars)
|
|
706
706
|
{
|
|
707
707
|
removeVarFromDFOutUpdatedSet(loc, var);
|
|
@@ -77,8 +77,8 @@ private:
|
|
|
77
77
|
inline CHECKER_TYPE getType(const FunObjVar* F) const
|
|
78
78
|
{
|
|
79
79
|
if(F)
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
{
|
|
81
|
+
TDAPIMap::const_iterator it= tdAPIMap.find(F->getName());
|
|
82
82
|
if(it != tdAPIMap.end())
|
|
83
83
|
return it->second;
|
|
84
84
|
}
|
|
@@ -63,34 +63,34 @@ public:
|
|
|
63
63
|
Type* operator*() const
|
|
64
64
|
{
|
|
65
65
|
if ( CurTy.getInt() )
|
|
66
|
-
|
|
66
|
+
return CurTy.getPointer()->getPointerTo(AddrSpace);
|
|
67
67
|
return CurTy.getPointer();
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
Type* getIndexedType() const
|
|
71
71
|
{
|
|
72
72
|
assert(false && "needs to be refactored");
|
|
73
73
|
if ( CurTy.getInt() )
|
|
74
|
-
|
|
74
|
+
return CurTy.getPointer();
|
|
75
75
|
#if LLVM_VERSION_MAJOR >= 11
|
|
76
76
|
Type* CT = CurTy.getPointer();
|
|
77
77
|
if (auto ST = dyn_cast<StructType>(CT))
|
|
78
78
|
return ST->getTypeAtIndex(getOperand());
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
79
|
+
else if (auto Array = dyn_cast<ArrayType>(CT))
|
|
80
|
+
return Array->getElementType();
|
|
81
|
+
else if (auto Vector = dyn_cast<VectorType>(CT))
|
|
82
|
+
return Vector->getElementType();
|
|
83
|
+
else
|
|
84
|
+
return CT;
|
|
85
85
|
#else
|
|
86
86
|
CompositeType *CT = llvm::cast<CompositeType>( CurTy.getPointer() );
|
|
87
87
|
return CT->getTypeAtIndex(getOperand());
|
|
88
88
|
#endif
|
|
89
|
-
|
|
89
|
+
}
|
|
90
90
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
// non-standard operators, these may not need be bridged but seems it's
|
|
92
|
+
// prudent to do so...
|
|
93
|
+
Type* operator->() const
|
|
94
94
|
{
|
|
95
95
|
return operator*();
|
|
96
96
|
}
|
|
@@ -367,8 +367,8 @@ public:
|
|
|
367
367
|
{
|
|
368
368
|
assert(!empty() && "empty LLVM module!!");
|
|
369
369
|
for (size_t i = 0; i < getModuleNum(); ++i)
|
|
370
|
-
|
|
371
|
-
|
|
370
|
+
{
|
|
371
|
+
Module& module = getModuleRef(i);
|
|
372
372
|
if (module.getName().str() != ExtAPI::getExtAPI()->getExtBcPath())
|
|
373
373
|
{
|
|
374
374
|
return &module;
|
|
@@ -259,9 +259,9 @@ public:
|
|
|
259
259
|
inline const std::string& getModuleIdentifier() const
|
|
260
260
|
{
|
|
261
261
|
if (pagReadFromTxt.empty())
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
262
|
+
{
|
|
263
|
+
assert(!moduleIdentifier.empty() &&
|
|
264
|
+
"No module found! Reading from a file other than LLVM-IR?");
|
|
265
265
|
return moduleIdentifier;
|
|
266
266
|
}
|
|
267
267
|
else
|
|
@@ -425,10 +425,10 @@ public:
|
|
|
425
425
|
|
|
426
426
|
virtual bool parseAndSetValue(const std::string s) override
|
|
427
427
|
{
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
428
|
+
for (const OptionPossibility<T> &op : possibilities)
|
|
429
|
+
{
|
|
430
|
+
// Check if the given string is a valid one.
|
|
431
|
+
if (s == std::get<1>(op))
|
|
432
432
|
{
|
|
433
433
|
// What that string maps to.
|
|
434
434
|
value = std::get<0>(op);
|
|
@@ -482,9 +482,9 @@ public:
|
|
|
482
482
|
virtual bool parseAndSetValue(const std::string s) override
|
|
483
483
|
{
|
|
484
484
|
// Like in OptionMap basically, except we can have many values.
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
485
|
+
for (const OptionPossibility<T> &op : possibilities)
|
|
486
|
+
{
|
|
487
|
+
if (s == std::get<1>(op))
|
|
488
488
|
{
|
|
489
489
|
optionValues[std::get<0>(op)] = true;
|
|
490
490
|
return true;
|
|
@@ -502,9 +502,9 @@ public:
|
|
|
502
502
|
/// If the bitset is empty.
|
|
503
503
|
bool nothingSet(void) const
|
|
504
504
|
{
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
505
|
+
for (const std::pair<T, bool> tb : optionValues)
|
|
506
|
+
{
|
|
507
|
+
if (tb.second) return false;
|
|
508
508
|
}
|
|
509
509
|
|
|
510
510
|
return true;
|