Ruchira Sasanka | 683847f | 2001-07-24 17:14:13 +0000 | [diff] [blame] | 1 | |
Chris Lattner | 0665a5f | 2002-02-05 01:43:49 +0000 | [diff] [blame] | 2 | |
3 | |||||
Ruchira Sasanka | 683847f | 2001-07-24 17:14:13 +0000 | [diff] [blame] | 4 | #include "llvm/Analysis/LiveVar/ValueSet.h" |
Chris Lattner | bfeec10 | 2002-04-28 19:20:10 +0000 | [diff] [blame^] | 5 | #include "llvm/Value.h" |
Chris Lattner | 697954c | 2002-01-20 22:54:45 +0000 | [diff] [blame] | 6 | #include <iostream> |
Ruchira Sasanka | 683847f | 2001-07-24 17:14:13 +0000 | [diff] [blame] | 7 | |
Chris Lattner | 1ddf664 | 2002-02-24 23:01:21 +0000 | [diff] [blame] | 8 | std::ostream &operator<<(std::ostream &O, RAV V) { // func to print a Value |
Chris Lattner | 0665a5f | 2002-02-05 01:43:49 +0000 | [diff] [blame] | 9 | const Value *v = V.V; |
Chris Lattner | 634b352 | 2001-10-15 18:30:06 +0000 | [diff] [blame] | 10 | if (v->hasName()) |
Chris Lattner | bfeec10 | 2002-04-28 19:20:10 +0000 | [diff] [blame^] | 11 | return O << (void*)v << "(" << v->getName() << ") "; |
12 | else if (isa<Constant>(v)) | ||||
13 | return O << (void*)v << "(" << v << ") "; | ||||
Ruchira Sasanka | e27c344 | 2001-08-20 21:12:49 +0000 | [diff] [blame] | 14 | else |
Chris Lattner | bfeec10 | 2002-04-28 19:20:10 +0000 | [diff] [blame^] | 15 | return O << (void*)v << " "; |
Ruchira Sasanka | 683847f | 2001-07-24 17:14:13 +0000 | [diff] [blame] | 16 | } |
17 | |||||
Chris Lattner | 5e5dfa3 | 2002-02-05 02:51:01 +0000 | [diff] [blame] | 18 | void printSet(const ValueSet &S) { |
19 | for (ValueSet::const_iterator I = S.begin(), E = S.end(); I != E; ++I) | ||||
Chris Lattner | 0665a5f | 2002-02-05 01:43:49 +0000 | [diff] [blame] | 20 | std::cerr << RAV(*I); |
Ruchira Sasanka | 683847f | 2001-07-24 17:14:13 +0000 | [diff] [blame] | 21 | } |
Chris Lattner | 5e5dfa3 | 2002-02-05 02:51:01 +0000 | [diff] [blame] | 22 |