blob: 88dd25a0331cfdd8c97ee9b2b17eb59befbb47f1 [file] [log] [blame]
Ruchira Sasanka683847f2001-07-24 17:14:13 +00001
Chris Lattner0665a5f2002-02-05 01:43:49 +00002
3
Ruchira Sasanka683847f2001-07-24 17:14:13 +00004#include "llvm/Analysis/LiveVar/ValueSet.h"
Chris Lattnere9bb2df2001-12-03 22:26:30 +00005#include "llvm/ConstantVals.h"
Chris Lattner697954c2002-01-20 22:54:45 +00006#include <iostream>
Ruchira Sasanka683847f2001-07-24 17:14:13 +00007
Chris Lattner0665a5f2002-02-05 01:43:49 +00008ostream &operator<<(ostream &O, RAV V) { // func to print a Value
9 const Value *v = V.V;
Chris Lattner634b3522001-10-15 18:30:06 +000010 if (v->hasName())
Chris Lattner0665a5f2002-02-05 01:43:49 +000011 return O << v << "(" << v->getName() << ") ";
Chris Lattnere9bb2df2001-12-03 22:26:30 +000012 else if (Constant *C = dyn_cast<Constant>(v))
Chris Lattner0665a5f2002-02-05 01:43:49 +000013 return O << v << "(" << C->getStrValue() << ") ";
Ruchira Sasankae27c3442001-08-20 21:12:49 +000014 else
Chris Lattner0665a5f2002-02-05 01:43:49 +000015 return O << v << " ";
Ruchira Sasanka683847f2001-07-24 17:14:13 +000016}
17
Chris Lattner5e5dfa32002-02-05 02:51:01 +000018void printSet(const ValueSet &S) {
19 for (ValueSet::const_iterator I = S.begin(), E = S.end(); I != E; ++I)
Chris Lattner0665a5f2002-02-05 01:43:49 +000020 std::cerr << RAV(*I);
Ruchira Sasanka683847f2001-07-24 17:14:13 +000021}
Chris Lattner5e5dfa32002-02-05 02:51:01 +000022