SVF
Public Types | Public Member Functions | Private Attributes | List of all members
SVF::TypeSet Class Reference

#include <PTAType.h>

Public Types

typedef OrderedSet< PTATypeTypeSetTy
 
typedef TypeSetTy::iterator iterator
 
typedef TypeSetTy::const_iterator const_iterator
 

Public Member Functions

u32_t size () const
 Number of types contained. More...
 
bool addType (const PTAType &type)
 Add a ptatype. More...
 
bool containType (const PTAType &type) const
 Contain a ptatype or not. More...
 
bool intersect (const TypeSet *typeset) const
 Intersect with another typeset or not. More...
 
void dumpTypes () const
 Dump all types in the typeset. More...
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 

Private Attributes

TypeSetTy typeSet
 

Detailed Description

Definition at line 88 of file PTAType.h.

Member Typedef Documentation

◆ const_iterator

typedef TypeSetTy::const_iterator SVF::TypeSet::const_iterator

Definition at line 95 of file PTAType.h.

◆ iterator

typedef TypeSetTy::iterator SVF::TypeSet::iterator

Definition at line 94 of file PTAType.h.

◆ TypeSetTy

Definition at line 92 of file PTAType.h.

Member Function Documentation

◆ addType()

bool SVF::TypeSet::addType ( const PTAType type)
inline

Add a ptatype.

Definition at line 124 of file PTAType.h.

125  {
126  std::pair<iterator, bool> ret = typeSet.insert(type);
127  return ret.second;
128  }
TypeSetTy typeSet
Definition: PTAType.h:186

◆ begin() [1/2]

iterator SVF::TypeSet::begin ( )
inline

Definition at line 99 of file PTAType.h.

100  {
101  return typeSet.begin();
102  }
TypeSetTy typeSet
Definition: PTAType.h:186

◆ begin() [2/2]

const_iterator SVF::TypeSet::begin ( ) const
inline

Definition at line 107 of file PTAType.h.

108  {
109  return typeSet.begin();
110  }
TypeSetTy typeSet
Definition: PTAType.h:186

◆ containType()

bool SVF::TypeSet::containType ( const PTAType type) const
inline

Contain a ptatype or not.

Definition at line 131 of file PTAType.h.

132  {
133  return typeSet.find(type) != typeSet.end();
134  }
TypeSetTy typeSet
Definition: PTAType.h:186

◆ dumpTypes()

void SVF::TypeSet::dumpTypes ( ) const
inline

Dump all types in the typeset.

Definition at line 176 of file PTAType.h.

177  {
178  for (const_iterator it = begin(), eit = end(); it != eit; ++it)
179  {
180  const PTAType &type = *it;
181  type.dump();
182  }
183  }
iterator begin()
Definition: PTAType.h:99
TypeSetTy::const_iterator const_iterator
Definition: PTAType.h:95
iterator end()
Definition: PTAType.h:103

◆ end() [1/2]

iterator SVF::TypeSet::end ( )
inline

Definition at line 103 of file PTAType.h.

104  {
105  return typeSet.end();
106  }
TypeSetTy typeSet
Definition: PTAType.h:186

◆ end() [2/2]

const_iterator SVF::TypeSet::end ( ) const
inline

Definition at line 111 of file PTAType.h.

112  {
113  return typeSet.end();
114  }
TypeSetTy typeSet
Definition: PTAType.h:186

◆ intersect()

bool SVF::TypeSet::intersect ( const TypeSet typeset) const
inline

Intersect with another typeset or not.

Definition at line 140 of file PTAType.h.

141  {
142  if (size() == 1)
143  {
144  const_iterator first = begin();
145  return typeset->containType(*first);
146  }
147  else if (typeset->size() == 1)
148  {
149  const_iterator first = typeset->begin();
150  return containType(*first);
151  }
152  else
153  {
154  const_iterator first1 = typeset->begin(), first2 = begin(),
155  last1 = typeset->end(), last2 = end();
156  const_iterator largest1 = last1, largest2 = last2;
157  largest1--;
158  largest2--;
159  if (*largest1 < *first2 || *largest2 < *first1)
160  return false;
161 
162  while (first1 != last1 && first2 != last2)
163  {
164  if (*first1 < *first2)
165  first1++;
166  else if (*first2 < *first1)
167  first2++;
168  else
169  return true;
170  }
171  return false;
172  }
173  }
bool containType(const PTAType &type) const
Contain a ptatype or not.
Definition: PTAType.h:131
iterator begin()
Definition: PTAType.h:99
TypeSetTy::const_iterator const_iterator
Definition: PTAType.h:95
iterator end()
Definition: PTAType.h:103
u32_t size() const
Number of types contained.
Definition: PTAType.h:118

◆ size()

u32_t SVF::TypeSet::size ( ) const
inline

Number of types contained.

Definition at line 118 of file PTAType.h.

119  {
120  return typeSet.size();
121  }
TypeSetTy typeSet
Definition: PTAType.h:186

Member Data Documentation

◆ typeSet

TypeSetTy SVF::TypeSet::typeSet
private

Definition at line 186 of file PTAType.h.


The documentation for this class was generated from the following file: