Static Value-Flow Analysis
ConditionalPT.h
Go to the documentation of this file.
1 //===- ConditionalPT.h -- Conditional points-to data structure----------------//
2 //
3 // SVF: Static Value-Flow Analysis
4 //
5 // Copyright (C) <2013-> <Yulei Sui>
6 //
7 
8 // This program is free software: you can redistribute it and/or modify
9 // it under the terms of the GNU Affero General Public License as published by
10 // the Free Software Foundation, either version 3 of the License, or
11 // (at your option) any later version.
12 
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU Affero General Public License for more details.
17 
18 // You should have received a copy of the GNU Affero General Public License
19 // along with this program. If not, see <http://www.gnu.org/licenses/>.
20 //
21 //===----------------------------------------------------------------------===//
22 
23 /*
24  * ConditionalPT.h
25  *
26  * Created on: 22/03/2014
27  * Author: Yulei Sui
28  */
29 
30 #ifndef CONDVAR_H_
31 #define CONDVAR_H_
32 
33 #include "Util/SVFUtil.h"
34 #include "MemoryModel/PointsTo.h"
35 #include <sstream>
36 
37 namespace SVF
38 {
39 
45 template<class Cond>
46 class CondVar
47 {
48 public:
50  CondVar(const Cond& cond, NodeID id) : m_cond(cond),m_id(id)
51  {
52  }
54  CondVar(const CondVar& conVar) : m_cond(conVar.m_cond), m_id(conVar.m_id)
55  {
56  }
58  CondVar() : m_cond(), m_id(0) {}
59 
60  ~CondVar() {}
61 
66  inline bool operator == (const CondVar & rhs) const
67  {
68  return (m_id == rhs.get_id() && m_cond == rhs.get_cond());
69  }
70 
71  inline bool operator != (const CondVar & rhs) const
72  {
73  return !(*this == rhs);
74  }
76 
77 
78  inline CondVar& operator= (const CondVar& rhs)
79  {
80  if(*this!=rhs)
81  {
82  m_cond = rhs.get_cond();
83  m_id = rhs.get_id();
84  }
85  return *this;
86  }
87 
88 
92  inline bool operator < (const CondVar & rhs) const
93  {
94  if(m_id != rhs.get_id())
95  return m_id < rhs.get_id();
96  else
97  return m_cond < rhs.get_cond();
98  }
99 
100  inline const Cond& get_cond() const
101  {
102  return m_cond;
103  }
104  inline NodeID get_id() const
105  {
106  return m_id;
107  }
108 
109  inline std::string toString() const
110  {
111  std::string str;
112  std::stringstream rawstr(str);
113  rawstr << "<" << m_id << " " << m_cond.toString() << "> ";
114  return rawstr.str();
115  }
116 
117  friend OutStream& operator<< (OutStream &o, const CondVar<Cond> &cvar)
118  {
119  o << cvar.toString();
120  return o;
121  }
122 private:
123  Cond m_cond;
125 };
126 
130 template<class Element>
132 {
134 
135 public:
138 
141 
144  {
145  }
146 
148  inline bool test_and_set(const Element& var)
149  {
150  return elements.insert(var).second;
151  }
153  inline bool test(const Element& var) const
154  {
155  return (elements.find(var) != elements.end());
156  }
158  inline void set(const Element& var)
159  {
160  elements.insert(var);
161  }
163  inline void reset(const Element& var)
164  {
165  elements.erase(var);
166  }
167 
169 
170  inline bool empty() const
171  {
172  return elements.empty();
173  }
174  inline unsigned size() const
175  {
176  return elements.size();
177  }
178  inline unsigned count() const
179  {
180  return size();
181  }
183 
185  inline void clear()
186  {
187  elements.clear();
188  }
189 
191 
192  inline iterator begin()
193  {
194  return elements.begin();
195  }
196  inline iterator end()
197  {
198  return elements.end();
199  }
200  inline iterator begin() const
201  {
202  return elements.begin();
203  }
204  inline iterator end() const
205  {
206  return elements.end();
207  }
209 
211 
212  inline bool operator|=(const CondStdSet<Element>& rhs)
213  {
214  const ElementSet& rhsElementSet = rhs.getElementSet();
215  if(rhsElementSet.empty() || (*this==rhs))
216  return false;
217  u32_t oldSize = elements.size();
218  elements.insert(rhsElementSet.begin(),rhsElementSet.end());
219  return oldSize!=elements.size();
220  }
221  inline bool operator&=(const CondStdSet<Element>& rhs)
222  {
223  if(rhs.empty() || (*this == rhs))
224  return false;
225  bool changed = false;
226  for (const_iterator i = rhs.begin(); i != rhs.end(); ++i)
227  {
228  if (elements.find(*i) == elements.end())
229  {
230  elements.erase(*i);
231  changed = true;
232  }
233  }
234  return changed;
235  }
236  inline bool operator!=(const CondStdSet<Element>& rhs) const
237  {
238  return elements!=rhs.getElementSet();
239  }
240  inline bool operator==(const CondStdSet<Element>& rhs) const
241  {
242  return ((*this != rhs) == false);
243  }
245  {
246  if(*this!=rhs)
247  {
248  elements = rhs.getElementSet();
249  }
250  return *this;
251  }
252  inline bool operator<(const CondStdSet<Element>& rhs) const
253  {
254  return elements < rhs.getElementSet();
255  }
257 
261  bool intersects(const CondStdSet<Element>& rhs) const
262  {
263  if (empty() && rhs.empty())
264  return false;
265 
266  for (const_iterator i = rhs.begin(); i != rhs.end(); ++i)
267  {
268  if (elements.find(*i) != elements.end())
269  return true;
270  }
271  return false;
272  }
273 
274  inline std::string toString() const
275  {
276  std::string str;
277  std::stringstream rawstr(str);
278  rawstr << "{ ";
279  for (const_iterator i = elements.begin(); i != elements.end(); ++i)
280  {
281  rawstr << (*i).toString() << " ";
282  }
283  rawstr << "} ";
284  return rawstr.str();
285  }
286 
287  inline const ElementSet& getElementSet() const
288  {
289  return elements;
290  }
291 
293  void checkAndRemap(void) const { }
294 
295 private:
297 };
298 
299 
303 template<class Cond>
305 {
306 public:
308  typedef typename CondPts::iterator CondPtsIter;
309  typedef typename CondPts::const_iterator CondPtsConstIter;
311 
313 
315  {
316  }
317  CondPointsToSet(const Cond& cond, const PointsTo& pts)
318  {
319  _condPts[cond] |= pts;
320  }
322 
325 
326  {
327  _condPts = cptsSet.pointsTo();
328  }
329 
331 
332  inline CondPts &pointsTo(void)
333  {
334  return _condPts;
335  }
336  inline const CondPts &pointsTo(void) const
337  {
338  return _condPts;
339  }
340  inline const PointsTo &pointsTo(Cond cond) const
341  {
342  CondPtsConstIter it = _condPts.find(cond);
343  assert(it!=_condPts.end() && "do not have pts of such condition!");
344  return it->second;
345  }
346  inline bool hasPointsTo(Cond cond) const
347  {
348  return (_condPts.find(cond) != _condPts.end());
349  }
350  inline PointsTo &pointsTo(Cond cond)
351  {
352  return _condPts[cond];
353  }
355 
357 
359  {
360  return _condPts.begin();
361  }
363  {
364  return _condPts.end();
365  }
367  {
368  return _condPts.begin();
369  }
370  inline CondPtsConstIter cptsEnd() const
371  {
372  return _condPts.end();
373  }
375 
376  inline void clear()
377  {
378  _condPts.clear();
379  }
380 
382  inline unsigned numElement() const
383  {
384  if (_condPts.empty())
385  return 0;
386  else
387  {
388  unsigned num = 0;
389  for (CondPtsConstIter it = cptsBegin(); it != cptsEnd(); it++)
390  {
391  PointsTo pts = it->second;
392  num += pts.count();
393  }
394  return num;
395  }
396  }
398  inline bool empty() const
399  {
400  return numElement()==0;
401  }
402 
403 
405 
407  const CondPointsToSet<Cond>& other)
408  {
409  _condPts = other.pointsTo();
410  return *this;
411  }
412 
414  inline bool operator==(const CondPointsToSet<Cond>& rhs) const
415  {
416  // Always remember give the typename when define a template variable
417  if (pointsTo().size() != rhs.pointsTo().size())
418  return false;
419  CondPtsConstIter lit = cptsBegin(), elit = cptsEnd();
420  CondPtsConstIter rit = rhs.cptsBegin(), erit = rhs.cptsEnd();
421  for (; lit != elit && rit != erit; ++lit, ++rit)
422  {
423  const Cond& lc = lit->first;
424  const Cond& rc = rit->first;
425  if (lc != rc || lit->second != rit->second)
426  return false;
427  }
428  return true;
429  }
431 
434  inline bool aliased(const CondPointsToSet<Cond>& rhs) const
435  {
436  if (pointsTo().empty() || rhs.pointsTo().empty())
437  return false;
438  else
439  {
440  CondPtsConstIter lit = cptsBegin(), elit = cptsEnd();
441  for (; lit != elit; ++lit)
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())
447  {
448  const PointsTo& rpts = rit->second;
449  if (pts.intersects(rpts))
450  return true;
451  }
452  }
453  return false;
454  }
455  }
456 
458  inline bool isSubset(const CondPointsToSet<Cond>& rhs) const
459  {
460  if (pointsTo().size() > rhs.pointsTo().size())
461  return false;
462  else
463  {
464  CondPtsConstIter lit = cptsBegin(), elit = cptsEnd();
465  for (; lit != elit; ++lit)
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
472  {
473  const PointsTo& pts = lit->second;
474  const PointsTo& rpts = rit->second;
475  if (!rpts.contains(pts))
476  return false;
477  }
478  }
479  }
480  return true;
481  }
482 
484  bool intersects(const CondPointsToSet<Cond>* rhs) const
485  {
487  if (pointsTo().empty() && rhs->pointsTo().empty())
488  return false;
489 
490  CondPtsConstIter it = rhs->cptsBegin(), eit = rhs->cptsEnd();
491  for (; it != eit; ++it)
492  {
493  const Cond& cond = it->first;
494  if (hasPointsTo(cond))
495  {
496  const PointsTo& rhs_pts= it->second;
497  const PointsTo& pts= pointsTo(cond);
498  if (pts.intersects(rhs_pts))
499  return true;
500  }
501  }
502 
503  return false;
504  }
505 
508  {
509  if (cpts1.pointsTo().empty())
510  {
511  clear();
512  return;
513  }
514  else if (cpts2.pointsTo().empty())
515  {
516  (*this) = cpts1;
517  }
518  else
519  {
520  CondPtsConstIter it1 = cpts1.cptsBegin(), eit1 = cpts1.cptsEnd();
521  for (; it1 != eit1; ++it1)
522  {
523  const Cond& cond = it1->first;
524  const PointsTo& pts1 = it1->second;
525  PointsTo& pts = pointsTo(cond);
526  if (cpts2.hasPointsTo(cond))
527  {
528  const PointsTo& pts2 = cpts2.pointsTo(cond);
529  pts.intersectWithComplement(pts1, pts2);
530  }
531  else
532  {
533  pts = pts1;
534  }
535  }
536  }
537  }
538 
541  {
543  if (empty() || cpts1.pointsTo().empty())
544  {
545  return;
546  }
547  else
548  {
549  CondPtsIter it = cptsBegin(), eit = cptsEnd();
550  for (; it != eit; ++it)
551  {
552  const Cond& cond = it->first;
553  PointsTo& pts = it->second;
554  if (cpts1.hasPointsTo(cond))
555  {
556  const PointsTo& pts1 = cpts1.pointsTo(cond);
557  pts.intersectWithComplement(pts1);
558  }
559  }
560  }
561  }
562 
564  inline bool operator &= (const CondPointsToSet<Cond>& rhs)
565  {
566  if (empty())
567  {
568  return false;
569  }
570  else if (rhs.empty())
571  {
572  clear();
573  return true;
574  }
575  else
576  {
577  bool changed = false;
578  for (CondPtsIter it = cptsBegin(), eit = cptsEnd(); it != eit; ++it)
579  {
580  const Cond& cond = it->first;
581  PointsTo& pts = it->second;
582  if (rhs.hasPointsTo(cond))
583  {
584  if (pts &= rhs.pointsTo(cond))
585  changed = true;
586  }
587  else
588  {
589  if (!pts.empty())
590  {
591  pts.clear();
592  changed = true;
593  }
594  }
595  }
596  return changed;
597  }
598  }
599 
601  inline bool operator!=(const CondPointsToSet<Cond>& rhs)
602  {
603  return !(*this == rhs);
604  }
606 
607 
610  inline bool operator |= (const CondPointsToSet<Cond>& rhs)
611  {
612  bool changed = false;
613  CondPtsConstIter rhsIt = rhs.cptsBegin();
614  CondPtsConstIter rhsEit = rhs.cptsEnd();
615  for (; rhsIt != rhsEit; ++rhsIt)
616  {
617  const Cond& cond = rhsIt->first;
618  const PointsTo& rhsPts = rhsIt->second;
619  PointsTo& pts = pointsTo(cond);
620  if ((pts |= rhsPts))
621  changed = true;
622  }
623  return changed;
624  }
625 
633  // TODO: try to use an efficient method to compare two conditional points-to set.
634  inline bool operator< (const CondPointsToSet<Cond>& rhs) const
635  {
636  if (pointsTo().size() < rhs.pointsTo().size())
637  return true;
638  else if (pointsTo().size() == rhs.pointsTo().size())
639  {
640  CondPtsConstIter lit = cptsBegin(), elit = cptsEnd();
641  CondPtsConstIter rit = rhs.cptsBegin(), erit = rhs.cptsEnd();
642  for (; lit != elit && rit != erit; ++lit, ++rit)
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)
649  {
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())
655  {
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  }
667  }
668  else
669  return false;
670  }
671  else
672  return false;
673  }
674  }
675  return false;
676  }
677 
679 
680  inline bool test_and_set(const SingleCondVar& var)
681  {
682  PointsTo& pts = pointsTo(var.get_cond());
683  return pts.test_and_set(var.get_id());
684  }
685  inline bool test(const SingleCondVar& var) const
686  {
687  if (hasPointsTo(var.get_cond()))
688  {
689  const PointsTo& pts = pointsTo(var.get_cond());
690  return pts.test(var.get_id());
691  }
692  return false;
693  }
694  inline void set(const SingleCondVar& var)
695  {
696  PointsTo& pts = pointsTo(var.get_cond());
697  pts.set(var.get_id());
698  }
699  inline void reset(const SingleCondVar& var)
700  {
701  if (hasPointsTo(var.get_cond()))
702  {
703  PointsTo& pts = pointsTo(var.get_cond());
704  pts.reset(var.get_id());
705  }
706  }
708 
709  // Print all points-to targets
711  inline void dump(OutStream & O) const
712  {
714  CondPtsConstIter eit = cptsEnd();
715  for (; it != eit; it++)
716  {
717  const PointsTo& pts = it->second;
718  O << "pts{";
719  SVFUtil::dumpSet(pts, O);
720  O << "}";
721  }
722  }
723  inline std::string dumpStr() const
724  {
725  std::string str;
727  CondPtsConstIter eit = cptsEnd();
728  for (; it != eit; it++)
729  {
730  const PointsTo& pts = it->second;
731  str += "pts{";
732  for (PointsTo::iterator ii = pts.begin(), ie = pts.end();
733  ii != ie; ii++)
734  {
735  char int2str[16];
736  snprintf(int2str, sizeof(int2str), "%d", *ii);
737  str += int2str;
738  str += " ";
739  }
740  str += "}";
741  }
742  return str;
743  }
745 
746 private:
747 
750  {
751  public:
754  _ptIter(_curIter->second.begin()), _ptEndIter(_curIter->second.end()), atEnd(ae) {}
756  bool operator != (int val)
757  {
758  return _curIter != _endIter;
759  }
761 
762  bool operator==(const CondPtsSetIterator &RHS) const
763  {
764  // If they are both at the end, ignore the rest of the fields.
765  if (atEnd && RHS.atEnd)
766  return true;
767  // Otherwise they are the same if they have the same condVar
768  return atEnd == RHS.atEnd && RHS._curIter == _curIter && RHS._ptIter == _ptIter;
769  }
770  bool operator!=(const CondPtsSetIterator &RHS) const
771  {
772  return !(*this == RHS);
773  }
774 
775  void operator ++(void)
776  {
777  if(atEnd == true)
778  return;
779 
780  if(_ptIter==_ptEndIter)
781  {
782  if(_curIter == _endIter)
783  {
784  atEnd = true;
785  return;
786  }
787  _curIter++;
788  _ptIter = _curIter->second.begin();
789  _ptIter = _curIter->second.end();
790  }
791  else
792  _ptIter++;
793  }
795  {
796  SingleCondVar temp_var(cond(), *_ptIter);
797  return temp_var;
798  }
800 
801  Cond cond(void)
802  {
803  return _curIter->first;
804  }
805 
806  private:
811  bool atEnd;
812  };
813 
814 public:
817 
818  inline iterator begin()
819  {
820  return iterator(this);
821  }
822 
823  inline iterator end()
824  {
825  return iterator(this,true);
826  }
827 
828  inline iterator begin() const
829  {
830  return iterator(this);
831  }
832 
833  inline iterator end() const
834  {
835  return iterator(this,true);
836  }
838 
839 private:
841 };
842 
843 } // End namespace SVF
844 
846 template <typename Cond>
847 struct std::hash<const SVF::CondVar<Cond>>
848 {
849  size_t operator()(const SVF::CondVar<Cond> &cv) const
850  {
851  std::hash<Cond> h;
852  return h(cv.get_cond());
853  }
854 };
855 
856 template <typename Cond>
857 struct std::hash<SVF::CondVar<Cond>>
858 {
859  size_t operator()(const SVF::CondVar<Cond> &cv) const
860  {
861  std::hash<Cond> h;
862  return h(cv.get_cond());
863  }
864 };
865 
866 template <typename Element>
867 struct std::hash<SVF::CondStdSet<Element>>
868 {
869  size_t operator()(const SVF::CondStdSet<Element> &css) const
870  {
871  // TODO: this is not a very good hash, but we probably won't be
872  // using it for now. Needed for other templates to compile...
874  return h(std::make_pair(*css.begin(), css.size()));
875  }
876 };
877 
878 #endif /* CONDVAR_H_ */
cJSON * n
Definition: cJSON.cpp:2558
const char *const string
Definition: cJSON.h:172
Conditional Points-to Set Iterator.
bool operator!=(const CondPtsSetIterator &RHS) const
CondPtsSetIterator(CondPointsToSet< Cond > &n, bool ae=false)
CondPointsToSet< Cond >::CondPtsIter _curIter
CondPointsToSet< Cond >::CondPtsIter _endIter
bool operator==(const CondPtsSetIterator &RHS) const
Operator overloading.
const PointsTo & pointsTo(Cond cond) const
bool operator&=(const CondPointsToSet< Cond > &rhs)
Overloading operator &=.
CondVar< Cond > SingleCondVar
bool test(const SingleCondVar &var) const
CondPtsIter cptsEnd()
iterator begin()
iterators
CondPointsToSet()
Constructor.
CondPointsToSet< Cond > & operator=(const CondPointsToSet< Cond > &other)
Overloading operators.
void dump(OutStream &O) const
iterator end() const
bool operator<(const CondPointsToSet< Cond > &rhs) const
void intersectWithComplement(const CondPointsToSet< Cond > &cpts1, const CondPointsToSet< Cond > &cpts2)
Result of cpts1 & ~cpts2 is stored into this bitmap.
void intersectWithComplement(const CondPointsToSet< Cond > &cpts1)
Result of cur & ~cpts1 is stored into this bitmap.
CondPts & pointsTo(void)
Get Conditional PointsTo and standard points-to.
CondPointsToSet(const Cond &cond, const PointsTo &pts)
bool operator|=(const CondPointsToSet< Cond > &rhs)
CondPtsSetIterator iterator
PointsTo & pointsTo(Cond cond)
bool intersects(const CondPointsToSet< Cond > *rhs) const
Return TRUE if this and RHS share any common element.
unsigned numElement() const
Get number of points-to targets.
CondPtsConstIter cptsEnd() const
CondPts::const_iterator CondPtsConstIter
CondPointsToSet(const CondPointsToSet< Cond > &cptsSet)
Copy constructor.
Map< Cond, PointsTo > CondPts
void set(const SingleCondVar &var)
bool hasPointsTo(Cond cond) const
std::string dumpStr() const
bool operator==(const CondPointsToSet< Cond > &rhs) const
Overloading operator ==.
bool test_and_set(const SingleCondVar &var)
Test and set.
bool empty() const
Return true if no element in the set.
CondPtsIter cptsBegin()
iterators
iterator begin() const
void reset(const SingleCondVar &var)
bool isSubset(const CondPointsToSet< Cond > &rhs) const
Check whether this CondPointsToSet is a subset of RHS.
CondPtsConstIter cptsBegin() const
CondPts::iterator CondPtsIter
const CondPts & pointsTo(void) const
bool operator!=(const CondPointsToSet< Cond > &rhs)
Overloading operator !=.
bool aliased(const CondPointsToSet< Cond > &rhs) const
bool empty() const
Set size.
bool operator!=(const CondStdSet< Element > &rhs) const
std::string toString() const
ElementSet elements
const ElementSet & getElementSet() const
void checkAndRemap(void) const
TODO: dummy to use for PointsTo in the various PTData.
bool test_and_set(const Element &var)
Return true if the element is added.
CondStdSet(const CondStdSet< Element > &cptsSet)
Copy constructor.
OrderedSet< Element > ElementSet
void clear()
Clear set.
OrderedSet< Element >::const_iterator const_iterator
bool operator==(const CondStdSet< Element > &rhs) const
bool test(const Element &var) const
Return true if the element is in the set.
OrderedSet< Element >::iterator iterator
iterator begin() const
void reset(const Element &var)
Remove var from the set.
bool operator|=(const CondStdSet< Element > &rhs)
Overload operators.
iterator end()
CondStdSet< Element > & operator=(const CondStdSet< Element > &rhs)
bool operator&=(const CondStdSet< Element > &rhs)
unsigned count() const
bool intersects(const CondStdSet< Element > &rhs) const
iterator end() const
bool operator<(const CondStdSet< Element > &rhs) const
iterator begin()
Iterators.
void set(const Element &var)
Add the element into set.
unsigned size() const
friend OutStream & operator<<(OutStream &o, const CondVar< Cond > &cvar)
CondVar(const Cond &cond, NodeID id)
Constructor.
Definition: ConditionalPT.h:50
std::string toString() const
bool operator!=(const CondVar &rhs) const
Definition: ConditionalPT.h:71
NodeID get_id() const
bool operator==(const CondVar &rhs) const
Definition: ConditionalPT.h:66
CondVar & operator=(const CondVar &rhs)
Definition: ConditionalPT.h:78
CondVar()
Default constructor.
Definition: ConditionalPT.h:58
bool operator<(const CondVar &rhs) const
Definition: ConditionalPT.h:92
const Cond & get_cond() const
CondVar(const CondVar &conVar)
Copy constructor.
Definition: ConditionalPT.h:54
bool test_and_set(u32_t n)
Definition: PointsTo.cpp:144
bool empty() const
Returns true if set is empty.
Definition: PointsTo.cpp:98
void clear()
Empty the set.
Definition: PointsTo.cpp:123
void reset(u32_t n)
Removes n from the set.
Definition: PointsTo.cpp:166
const_iterator end() const
Definition: PointsTo.h:132
u32_t count() const
Returns number of elements.
Definition: PointsTo.cpp:111
void set(u32_t n)
Inserts n in the set.
Definition: PointsTo.cpp:157
bool contains(const PointsTo &rhs) const
Returns true if this set is a superset of rhs.
Definition: PointsTo.cpp:175
const_iterator begin() const
Definition: PointsTo.h:128
bool intersects(const PointsTo &rhs) const
Returns true if this set and rhs share any elements.
Definition: PointsTo.cpp:189
bool test(u32_t n) const
Returns true if n is in this set.
Definition: PointsTo.cpp:131
bool intersectWithComplement(const PointsTo &rhs)
Definition: PointsTo.cpp:286
void dumpSet(NodeBS To, OutStream &O=SVFUtil::outs())
Dump sparse bitvector set.
Definition: SVFUtil.cpp:147
for isBitcode
Definition: BasicTypes.h:68
u32_t NodeID
Definition: GeneralType.h:55
std::set< Key, Compare, Allocator > OrderedSet
Definition: GeneralType.h:105
std::unordered_map< Key, Value, Hash, KeyEqual, Allocator > Map
Definition: GeneralType.h:101
std::ostream OutStream
Definition: GeneralType.h:45
unsigned u32_t
Definition: GeneralType.h:46
provide extra hash function for std::pair handling
Definition: GeneralType.h:85
size_t operator()(const SVF::CondStdSet< Element > &css) const
size_t operator()(const SVF::CondVar< Cond > &cv) const
size_t operator()(const SVF::CondVar< Cond > &cv) const