73 return !(*
this == rhs);
112 std::stringstream rawstr(str);
113 rawstr <<
"<" <<
m_id <<
" " <<
m_cond.toString() <<
"> ";
130 template<
class Element>
153 inline bool test(
const Element& var)
const
158 inline void set(
const Element& var)
163 inline void reset(
const Element& var)
215 if(rhsElementSet.empty() || (*
this==rhs))
218 elements.insert(rhsElementSet.begin(),rhsElementSet.end());
223 if(rhs.
empty() || (*
this == rhs))
225 bool changed =
false;
242 return ((*
this != rhs) ==
false);
277 std::stringstream rawstr(str);
281 rawstr << (*i).toString() <<
" ";
343 assert(it!=
_condPts.end() &&
"do not have pts of such condition!");
421 for (; lit != elit && rit != erit; ++lit, ++rit)
423 const Cond& lc = lit->first;
424 const Cond& rc = rit->first;
425 if (lc != rc || lit->second != rit->second)
441 for (; lit != elit; ++lit)
443 const Cond& lc = lit->first;
465 for (; lit != elit; ++lit)
467 const Cond& lc = lit->first;
491 for (; it != eit; ++it)
493 const Cond& cond = it->first;
496 const PointsTo& rhs_pts= it->second;
521 for (; it1 != eit1; ++it1)
523 const Cond& cond = it1->first;
550 for (; it != eit; ++it)
552 const Cond& cond = it->first;
570 else if (rhs.
empty())
577 bool changed =
false;
580 const Cond& cond = it->first;
603 return !(*
this == rhs);
612 bool changed =
false;
615 for (; rhsIt != rhsEit; ++rhsIt)
617 const Cond& cond = rhsIt->first;
618 const PointsTo& rhsPts = rhsIt->second;
642 for (; lit != elit && rit != erit; ++lit, ++rit)
644 const Cond& lc = lit->first;
645 const Cond& rc = rit->first;
660 for (; bit != eit && rbit != reit; bit++, rbit++)
664 else if (*bit > *rbit)
715 for (; it != eit; it++)
728 for (; it != eit; it++)
736 snprintf(int2str,
sizeof(int2str),
"%d", *ii);
772 return !(*
this == RHS);
846 template <
typename Cond>
847 struct std::hash<const
SVF::CondVar<Cond>>
856 template <
typename Cond>
857 struct std::hash<
SVF::CondVar<Cond>>
866 template <
typename Element>
867 struct std::hash<
SVF::CondStdSet<Element>>
874 return h(std::make_pair(*css.
begin(), css.
size()));
Conditional Points-to Set Iterator.
PointsTo::iterator _ptIter
bool operator!=(const CondPtsSetIterator &RHS) const
CondPtsSetIterator(CondPointsToSet< Cond > &n, bool ae=false)
CondPointsToSet< Cond >::CondPtsIter _curIter
CondPointsToSet< Cond >::CondPtsIter _endIter
SingleCondVar operator*(void)
bool operator==(const CondPtsSetIterator &RHS) const
Operator overloading.
PointsTo::iterator _ptEndIter
const PointsTo & pointsTo(Cond cond) const
bool operator&=(const CondPointsToSet< Cond > &rhs)
Overloading operator &=.
CondVar< Cond > SingleCondVar
bool test(const SingleCondVar &var) const
iterator begin()
iterators
CondPointsToSet()
Constructor.
CondPointsToSet< Cond > & operator=(const CondPointsToSet< Cond > &other)
Overloading operators.
void dump(OutStream &O) 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
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
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
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
void reset(const Element &var)
Remove var from the set.
bool operator|=(const CondStdSet< Element > &rhs)
Overload operators.
CondStdSet< Element > & operator=(const CondStdSet< Element > &rhs)
bool operator&=(const CondStdSet< Element > &rhs)
bool intersects(const CondStdSet< Element > &rhs) const
bool operator<(const CondStdSet< Element > &rhs) const
iterator begin()
Iterators.
void set(const Element &var)
Add the element into set.
friend OutStream & operator<<(OutStream &o, const CondVar< Cond > &cvar)
CondVar(const Cond &cond, NodeID id)
Constructor.
std::string toString() const
bool operator!=(const CondVar &rhs) const
bool operator==(const CondVar &rhs) const
CondVar & operator=(const CondVar &rhs)
CondVar()
Default constructor.
bool operator<(const CondVar &rhs) const
const Cond & get_cond() const
CondVar(const CondVar &conVar)
Copy constructor.
bool test_and_set(u32_t n)
bool empty() const
Returns true if set is empty.
void clear()
Empty the set.
void reset(u32_t n)
Removes n from the set.
const_iterator end() const
u32_t count() const
Returns number of elements.
void set(u32_t n)
Inserts n in the set.
bool contains(const PointsTo &rhs) const
Returns true if this set is a superset of rhs.
const_iterator begin() const
bool intersects(const PointsTo &rhs) const
Returns true if this set and rhs share any elements.
bool test(u32_t n) const
Returns true if n is in this set.
bool intersectWithComplement(const PointsTo &rhs)
void dumpSet(NodeBS To, OutStream &O=SVFUtil::outs())
Dump sparse bitvector set.
std::set< Key, Compare, Allocator > OrderedSet
std::unordered_map< Key, Value, Hash, KeyEqual, Allocator > Map
provide extra hash function for std::pair handling
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