[llvm-commits] [llvm] r60507 - in /llvm/trunk: include/llvm/CodeGen/PseudoSourceValue.h lib/CodeGen/PseudoSourceValue.cpp lib/VMCore/AsmWriter.cpp
Dan Gohman
gohman at apple.com
Wed Dec 3 13:37:29 PST 2008
Author: djg
Date: Wed Dec 3 15:37:21 2008
New Revision: 60507
URL: http://llvm.org/viewvc/llvm-project?rev=60507&view=rev
Log:
Have PseudoSourceValue override Value::dump, so that it works
on PseudoSourceValue values. This also fixes a FIXME in
lib/VMCode/AsmWriter.cpp.
Modified:
llvm/trunk/include/llvm/CodeGen/PseudoSourceValue.h
llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp
llvm/trunk/lib/VMCore/AsmWriter.cpp
Modified: llvm/trunk/include/llvm/CodeGen/PseudoSourceValue.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/PseudoSourceValue.h?rev=60507&r1=60506&r2=60507&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/PseudoSourceValue.h (original)
+++ llvm/trunk/include/llvm/CodeGen/PseudoSourceValue.h Wed Dec 3 15:37:21 2008
@@ -28,6 +28,12 @@
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.
Modified: llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp?rev=60507&r1=60506&r2=60507&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp (original)
+++ llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp Wed Dec 3 15:37:21 2008
@@ -41,6 +41,10 @@
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];
}
Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=60507&r1=60506&r2=60507&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/AsmWriter.cpp (original)
+++ llvm/trunk/lib/VMCore/AsmWriter.cpp Wed Dec 3 15:37:21 2008
@@ -1759,8 +1759,7 @@
} 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!");
}
}
More information about the llvm-commits
mailing list