mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 08:17:40 +00:00
Only call isUse/isDef on register operands
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30118 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -158,7 +158,7 @@ void MachineInstr::print(std::ostream &OS, const TargetMachine *TM) const {
|
||||
unsigned StartOp = 0;
|
||||
|
||||
// Specialize printing if op#0 is definition
|
||||
if (getNumOperands() && getOperand(0).isDef() && !getOperand(0).isUse()) {
|
||||
if (getNumOperands() && getOperand(0).isReg() && getOperand(0).isDef()) {
|
||||
::print(getOperand(0), OS, TM);
|
||||
OS << " = ";
|
||||
++StartOp; // Don't print this operand again!
|
||||
@@ -176,11 +176,8 @@ void MachineInstr::print(std::ostream &OS, const TargetMachine *TM) const {
|
||||
OS << " ";
|
||||
::print(mop, OS, TM);
|
||||
|
||||
if (mop.isDef())
|
||||
if (mop.isUse())
|
||||
OS << "<def&use>";
|
||||
else
|
||||
OS << "<def>";
|
||||
if (mop.isReg() && mop.isDef())
|
||||
OS << "<def>";
|
||||
}
|
||||
|
||||
OS << "\n";
|
||||
@@ -204,11 +201,8 @@ std::ostream &llvm::operator<<(std::ostream &os, const MachineInstr &MI) {
|
||||
|
||||
for (unsigned i = 0, N = MI.getNumOperands(); i < N; i++) {
|
||||
os << "\t" << MI.getOperand(i);
|
||||
if (MI.getOperand(i).isDef())
|
||||
if (MI.getOperand(i).isUse())
|
||||
os << "<d&u>";
|
||||
else
|
||||
os << "<d>";
|
||||
if (MI.getOperand(i).isReg() && MI.getOperand(i).isDef())
|
||||
os << "<d>";
|
||||
}
|
||||
|
||||
return os << "\n";
|
||||
|
||||
Reference in New Issue
Block a user