diff options
author | Ruchira Sasanka <sasanka@students.uiuc.edu> | 2001-07-24 17:14:13 +0000 |
---|---|---|
committer | Ruchira Sasanka <sasanka@students.uiuc.edu> | 2001-07-24 17:14:13 +0000 |
commit | 683847fb751890fb0ca16657be68f769bdff786c (patch) | |
tree | 7bdc59d4565c8d04335ddae7d2b5114292f51320 /include/llvm/CodeGen/ValueSet.h | |
parent | 2233a07b686ead865b0bfeed5a50d178d05f9549 (diff) |
*** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/ValueSet.h')
-rw-r--r-- | include/llvm/CodeGen/ValueSet.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/ValueSet.h b/include/llvm/CodeGen/ValueSet.h new file mode 100644 index 0000000000..02d3906178 --- /dev/null +++ b/include/llvm/CodeGen/ValueSet.h @@ -0,0 +1,62 @@ +/* Title: ValueSet.h + Author: Ruchira Sasanka + Date: Jun 30, 01 + Purpose: Contains a mathematical set of Values. LiveVarSet is derived from + this. Contains both class and method definitions +*/ + +#ifndef VALUE_SET_H +#define VALUE_SET_H + +#include <stdlib.h> + +#include <hash_set> +#include <algorithm> +#include <fstream> +#include <iostream> + +#include "llvm/Value.h" + + +//------------------------ Support functions --------------------------------- + +struct hashFuncValue { // sturcture containing the hash function. + inline size_t operator () (const Value *const val) const + { return (size_t) val; } +}; + + + +//------------------- Class Definition for ValueSet ---------------------------- + +void printValue( const Value *const v); // func to print a Value + + + +class ValueSet : public hash_set<const Value *, hashFuncValue > +{ + + public: + ValueSet(); // constructor + + inline void add(const Value *const val) + { assert( val ); insert(val);} // for adding a live variable to set + + inline void remove(const Value *const val) + { assert( val ); erase(val); } // for removing a live variable from set + + bool setUnion( const ValueSet *const set1); // for performing two set unions + void setSubtract( const ValueSet *const set1); // for performing set difference + + // for performing set difference + void setDifference( const ValueSet *const set1, const ValueSet *const set2); + + void printSet() const; // for printing a live variable set +}; + + + + + + +#endif |