1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

Fix up code a bit, remove operator<< to Assembly/Writer.h

llvm-svn: 628
This commit is contained in:
Chris Lattner 2001-09-18 17:03:59 +00:00
parent 30d7546b7d
commit 86ecc9630a

View File

@ -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