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

Have PseudoSourceValue override Value::dump, so that it works

on PseudoSourceValue values. This also fixes a FIXME in
lib/VMCode/AsmWriter.cpp.

llvm-svn: 60507
This commit is contained in:
Dan Gohman 2008-12-03 21:37:21 +00:00
parent a0b1516bdc
commit 0edbed16c7
3 changed files with 11 additions and 2 deletions

View File

@ -28,6 +28,12 @@ namespace llvm {
public:
PseudoSourceValue();
/// dump - Support for debugging, callable in GDB: V->dump()
//
virtual void dump() const;
/// print - Implement operator<< on PseudoSourceValue.
///
virtual void print(raw_ostream &OS) const;
/// isConstant - Test whether this PseudoSourceValue has a constant value.

View File

@ -41,6 +41,10 @@ static const char *const PSVNames[] = {
PseudoSourceValue::PseudoSourceValue() :
Value(PointerType::getUnqual(Type::Int8Ty), PseudoSourceValueVal) {}
void PseudoSourceValue::dump() const {
print(errs()); errs() << '\n'; errs().flush();
}
void PseudoSourceValue::print(raw_ostream &OS) const {
OS << PSVNames[this - *PSVs];
}

View File

@ -1759,8 +1759,7 @@ void Value::print(raw_ostream &OS, AssemblyAnnotationWriter *AAW) const {
} else if (isa<InlineAsm>(this)) {
WriteAsOperand(OS, this, true, 0);
} else {
// FIXME: PseudoSourceValue breaks this!
//assert(0 && "Unknown value to print out!");
assert(0 && "Unknown value to print out!");
}
}