aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/Value.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-09-18 17:03:59 +0000
committerChris Lattner <sabre@nondot.org>2001-09-18 17:03:59 +0000
commitbcbb6b3fac7259e8364b462c3fb6f4379e3508e5 (patch)
tree891b9b0b022c27291a3c5f4d930c6089e3b69334 /lib/VMCore/Value.cpp
parent767b78fb39aeaee63e9eb168d0c79fb3692aa74e (diff)
downloadexternal_llvm-bcbb6b3fac7259e8364b462c3fb6f4379e3508e5.zip
external_llvm-bcbb6b3fac7259e8364b462c3fb6f4379e3508e5.tar.gz
external_llvm-bcbb6b3fac7259e8364b462c3fb6f4379e3508e5.tar.bz2
Fix up code a bit, remove operator<< to Assembly/Writer.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@628 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Value.cpp')
-rw-r--r--lib/VMCore/Value.cpp36
1 files changed, 7 insertions, 29 deletions
diff --git a/lib/VMCore/Value.cpp b/lib/VMCore/Value.cpp
index 723a71c..b137c62 100644
--- a/lib/VMCore/Value.cpp
+++ b/lib/VMCore/Value.cpp
@@ -83,44 +83,22 @@ User *Value::use_remove(use_iterator &I) {
return i;
}
-void
-Value::dump() const
-{
- DebugValue(*this);
-}
-
-ostream&
-operator<<(ostream &o, const Value& I)
-{
- switch (I.getValueType()) {
- case Value::TypeVal: return o << I.castTypeAsserting();
- case Value::ConstantVal: WriteToAssembly((const ConstPoolVal*)&I,o);break;
- case Value::MethodArgumentVal: return o << I.getType() << " "<< I.getName();
- case Value::InstructionVal:WriteToAssembly((const Instruction *)&I, o);break;
- case Value::BasicBlockVal: WriteToAssembly((const BasicBlock *)&I, o);break;
- case Value::MethodVal: WriteToAssembly((const Method *)&I, o);break;
- case Value::GlobalVal: WriteToAssembly((const GlobalVariable*)&I,o);break;
- case Value::ModuleVal: WriteToAssembly((const Module *)&I,o); break;
- default: return o << "<unknown value type: " << I.getValueType() << ">";
- }
- return o;
-}
-
-void
-DebugValue(const Value* V)
-{
+#ifndef NDEBUG // Only in -g mode...
+void DebugValue(const Value *V) {
if (V)
cerr << *V << endl;
else
cerr << "<NULL value>" << endl;
}
-void
-DebugValue(const Value& V)
-{
+void DebugValue(const Value &V) {
cerr << V << endl;
}
+void Value::dump() const {
+ DebugValue(*this);
+}
+#endif
//===----------------------------------------------------------------------===//
// User Class