Chris Lattner | 4ee3632 | 2004-01-09 18:15:24 +0000 | [diff] [blame] | 1 | // |
| 2 | // The LLVM Compiler Infrastructure |
| 3 | // |
| 4 | // This file was developed by the LLVM research group and is distributed under |
| 5 | // the University of Illinois Open Source License. See LICENSE.TXT for details. |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | // FIXME: Eliminate this file. |
| 9 | |
| 10 | #include "llvm/CodeGen/ValueSet.h" |
| 11 | #include "llvm/Value.h" |
| 12 | #include <iostream> |
| 13 | |
| 14 | namespace llvm { |
| 15 | |
| 16 | std::ostream &operator<<(std::ostream &O, RAV V) { // func to print a Value |
| 17 | const Value &v = V.V; |
| 18 | if (v.hasName()) |
| 19 | return O << (void*)&v << "(" << v.getName() << ") "; |
Reid Spencer | 3074d3c | 2004-07-18 00:37:35 +0000 | [diff] [blame] | 20 | else if (isa<Constant>(v) && !isa<GlobalValue>(v)) |
Chris Lattner | 4ee3632 | 2004-01-09 18:15:24 +0000 | [diff] [blame] | 21 | return O << (void*)&v << "(" << v << ") "; |
| 22 | else |
| 23 | return O << (void*)&v << " "; |
| 24 | } |
| 25 | |
| 26 | void printSet(const ValueSet &S) { |
| 27 | for (ValueSet::const_iterator I = S.begin(), E = S.end(); I != E; ++I) |
| 28 | std::cerr << RAV(*I); |
| 29 | } |
| 30 | |
| 31 | } // End llvm namespace |