mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-26 05:25:47 +00:00
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
This commit is contained in:
@@ -631,30 +631,34 @@ void MachineInstr::print(std::ostream &OS, const TargetMachine *TM) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (getNumMemOperands() > 0) {
|
if (getNumMemOperands() > 0) {
|
||||||
OS << ", SV:";
|
OS << ", Mem:";
|
||||||
for (unsigned i = 0; i < getNumMemOperands(); i++) {
|
for (unsigned i = 0; i < getNumMemOperands(); i++) {
|
||||||
const MemOperand &MRO = getMemOperand(i);
|
const MemOperand &MRO = getMemOperand(i);
|
||||||
const Value *V = MRO.getValue();
|
const Value *V = MRO.getValue();
|
||||||
|
|
||||||
assert(V && "SV missing.");
|
|
||||||
assert((MRO.isLoad() || MRO.isStore()) &&
|
assert((MRO.isLoad() || MRO.isStore()) &&
|
||||||
"SV has to be a load, store or both.");
|
"SV has to be a load, store or both.");
|
||||||
|
|
||||||
if (MRO.isVolatile())
|
if (MRO.isVolatile())
|
||||||
OS << "Volatile ";
|
OS << "Volatile ";
|
||||||
|
|
||||||
if (MRO.isLoad())
|
if (MRO.isLoad())
|
||||||
OS << "LD ";
|
OS << "LD";
|
||||||
if (MRO.isStore())
|
if (MRO.isStore())
|
||||||
OS << "ST ";
|
OS << "ST";
|
||||||
|
|
||||||
OS << MRO.getSize();
|
OS << "(" << MRO.getSize() << ") [";
|
||||||
|
|
||||||
if (!V->getName().empty())
|
if (!V)
|
||||||
OS << "[" << V->getName() << " + " << MRO.getOffset() << "]";
|
OS << "<unknown>";
|
||||||
|
else if (!V->getName().empty())
|
||||||
|
OS << V->getName();
|
||||||
else if (isa<PseudoSourceValue>(V))
|
else if (isa<PseudoSourceValue>(V))
|
||||||
OS << "[" << *V << " + " << MRO.getOffset() << "]";
|
OS << *V;
|
||||||
else
|
else
|
||||||
OS << "[" << V << " + " << MRO.getOffset() << "]";
|
OS << V;
|
||||||
|
|
||||||
|
OS << " + " << MRO.getOffset() << "]";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user