2 Author: Ruchira Sasanka
4 Purpose: Contains a mathematical set of Values. LiveVarSet is derived from
5 this. Contains both class and method definitions.
18 #include "llvm/Value.h"
21 //------------------------ Support functions ---------------------------------
23 struct hashFuncValue { // sturcture containing the hash func
24 inline size_t operator () (const Value *const val) const
25 { return (size_t) val; }
30 //------------------- Class Definition for ValueSet --------------------------
32 void printValue( const Value *const v); // func to print a Value
36 class ValueSet : public hash_set<const Value *, hashFuncValue >
40 ValueSet(); // constructor
42 inline void add(const Value *const val)
43 { assert( val ); insert(val);} // for adding a live variable to set
45 inline void remove(const Value *const val)
46 { assert( val ); erase(val); } // for removing a live var from set
48 bool setUnion( const ValueSet *const set1); // for performing set union
49 void setSubtract( const ValueSet *const set1); // for performing set diff
52 void setDifference( const ValueSet *const set1, const ValueSet *const set2);
54 void printSet() const; // for printing a live variable set