aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorDan Gohman <djg@cray.com>2008-02-07 16:18:00 +0000
committerDan Gohman <djg@cray.com>2008-02-07 16:18:00 +0000
commitf738b656206a75c6f553b8e16c3a8db0e07b4cac (patch)
tree7476b810be083dde250d6e0ff68f889760fa026a /lib/CodeGen
parent3b5a12701e3d8df43d7cbc7e744eb1997ca2f75f (diff)
downloadexternal_llvm-f738b656206a75c6f553b8e16c3a8db0e07b4cac.zip
external_llvm-f738b656206a75c6f553b8e16c3a8db0e07b4cac.tar.gz
external_llvm-f738b656206a75c6f553b8e16c3a8db0e07b4cac.tar.bz2
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46853 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/MachineInstr.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp
index c455b02..6d4bc30 100644
--- a/lib/CodeGen/MachineInstr.cpp
+++ b/lib/CodeGen/MachineInstr.cpp
@@ -631,30 +631,34 @@ void MachineInstr::print(std::ostream &OS, const TargetMachine *TM) const {
}
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() << "]";
}
}