blob: 82fccb7e84e677a73e90748b4b7ebe1bc22172df [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 Lattnerbfeec102002-04-28 19:20:10 +00005#include "llvm/Value.h"
Chris Lattner697954c2002-01-20 22:54:45 +00006#include <iostream>
Ruchira Sasanka683847f2001-07-24 17:14:13 +00007
Chris Lattner1ddf6642002-02-24 23:01:21 +00008std::ostream &operator<<(std::ostream &O, RAV V) { // func to print a Value
Chris Lattner0665a5f2002-02-05 01:43:49 +00009 const Value *v = V.V;
Chris Lattner634b3522001-10-15 18:30:06 +000010 if (v->hasName())
Chris Lattnerbfeec102002-04-28 19:20:10 +000011 return O << (void*)v << "(" << v->getName() << ") ";
12 else if (isa<Constant>(v))
13 return O << (void*)v << "(" << v << ") ";
Ruchira Sasankae27c3442001-08-20 21:12:49 +000014 else
Chris Lattnerbfeec102002-04-28 19:20:10 +000015 return O << (void*)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