mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-09 22:24:37 +00:00
Add special handling for pseudo-instructions (print them as comments).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14882 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -455,6 +455,19 @@ static bool isStoreInstruction (const MachineInstr *MI) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool isPseudoInstruction (const MachineInstr *MI) {
|
||||||
|
switch (MI->getOpcode ()) {
|
||||||
|
case V8::PHI:
|
||||||
|
case V8::ADJCALLSTACKUP:
|
||||||
|
case V8::ADJCALLSTACKDOWN:
|
||||||
|
case V8::IMPLICIT_USE:
|
||||||
|
case V8::IMPLICIT_DEF:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// printBaseOffsetPair - Print two consecutive operands of MI, starting at #i,
|
/// printBaseOffsetPair - Print two consecutive operands of MI, starting at #i,
|
||||||
/// which form a base + offset pair (which may have brackets around it, if
|
/// which form a base + offset pair (which may have brackets around it, if
|
||||||
/// brackets is true, or may be in the form base - constant, if offset is a
|
/// brackets is true, or may be in the form base - constant, if offset is a
|
||||||
@ -484,6 +497,11 @@ void V8Printer::printMachineInstruction(const MachineInstr *MI) {
|
|||||||
unsigned Opcode = MI->getOpcode();
|
unsigned Opcode = MI->getOpcode();
|
||||||
const TargetInstrInfo &TII = *TM.getInstrInfo();
|
const TargetInstrInfo &TII = *TM.getInstrInfo();
|
||||||
const TargetInstrDescriptor &Desc = TII.get(Opcode);
|
const TargetInstrDescriptor &Desc = TII.get(Opcode);
|
||||||
|
|
||||||
|
// If it's a pseudo-instruction, comment it out.
|
||||||
|
if (isPseudoInstruction (MI))
|
||||||
|
O << "! ";
|
||||||
|
|
||||||
O << Desc.Name << " ";
|
O << Desc.Name << " ";
|
||||||
|
|
||||||
// Printing memory instructions is a special case.
|
// Printing memory instructions is a special case.
|
||||||
|
@ -455,6 +455,19 @@ static bool isStoreInstruction (const MachineInstr *MI) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool isPseudoInstruction (const MachineInstr *MI) {
|
||||||
|
switch (MI->getOpcode ()) {
|
||||||
|
case V8::PHI:
|
||||||
|
case V8::ADJCALLSTACKUP:
|
||||||
|
case V8::ADJCALLSTACKDOWN:
|
||||||
|
case V8::IMPLICIT_USE:
|
||||||
|
case V8::IMPLICIT_DEF:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// printBaseOffsetPair - Print two consecutive operands of MI, starting at #i,
|
/// printBaseOffsetPair - Print two consecutive operands of MI, starting at #i,
|
||||||
/// which form a base + offset pair (which may have brackets around it, if
|
/// which form a base + offset pair (which may have brackets around it, if
|
||||||
/// brackets is true, or may be in the form base - constant, if offset is a
|
/// brackets is true, or may be in the form base - constant, if offset is a
|
||||||
@ -484,6 +497,11 @@ void V8Printer::printMachineInstruction(const MachineInstr *MI) {
|
|||||||
unsigned Opcode = MI->getOpcode();
|
unsigned Opcode = MI->getOpcode();
|
||||||
const TargetInstrInfo &TII = *TM.getInstrInfo();
|
const TargetInstrInfo &TII = *TM.getInstrInfo();
|
||||||
const TargetInstrDescriptor &Desc = TII.get(Opcode);
|
const TargetInstrDescriptor &Desc = TII.get(Opcode);
|
||||||
|
|
||||||
|
// If it's a pseudo-instruction, comment it out.
|
||||||
|
if (isPseudoInstruction (MI))
|
||||||
|
O << "! ";
|
||||||
|
|
||||||
O << Desc.Name << " ";
|
O << Desc.Name << " ";
|
||||||
|
|
||||||
// Printing memory instructions is a special case.
|
// Printing memory instructions is a special case.
|
||||||
|
Reference in New Issue
Block a user