[llvm-commits] [llvm] r46853 - /llvm/trunk/lib/CodeGen/MachineInstr.cpp
Dan Gohman
gohman at apple.com
Thu Feb 7 08:18:00 PST 2008
Author: djg
Date: Thu Feb 7 10:18:00 2008
New Revision: 46853
URL: http://llvm.org/viewvc/llvm-project?rev=46853&view=rev
Log:
Don't abort if a MemOperand is missing a SourceValue; just print it
as <unknown>. And make some minor adjustments to the MemOperand
dump format.
Modified:
llvm/trunk/lib/CodeGen/MachineInstr.cpp
Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstr.cpp?rev=46853&r1=46852&r2=46853&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Thu Feb 7 10:18:00 2008
@@ -631,30 +631,34 @@
}
if (getNumMemOperands() > 0) {
- OS << ", SV:";
+ OS << ", Mem:";
for (unsigned i = 0; i < getNumMemOperands(); i++) {
const MemOperand &MRO = getMemOperand(i);
const Value *V = MRO.getValue();
- assert(V && "SV missing.");
assert((MRO.isLoad() || MRO.isStore()) &&
"SV has to be a load, store or both.");
if (MRO.isVolatile())
OS << "Volatile ";
+
if (MRO.isLoad())
- OS << "LD ";
+ OS << "LD";
if (MRO.isStore())
- OS << "ST ";
+ OS << "ST";
- OS << MRO.getSize();
+ OS << "(" << MRO.getSize() << ") [";
- if (!V->getName().empty())
- OS << "[" << V->getName() << " + " << MRO.getOffset() << "]";
+ if (!V)
+ OS << "<unknown>";
+ else if (!V->getName().empty())
+ OS << V->getName();
else if (isa<PseudoSourceValue>(V))
- OS << "[" << *V << " + " << MRO.getOffset() << "]";
+ OS << *V;
else
- OS << "[" << V << " + " << MRO.getOffset() << "]";
+ OS << V;
+
+ OS << " + " << MRO.getOffset() << "]";
}
}
More information about the llvm-commits
mailing list