mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Print out an informative comment for KILL instructions.
The KILL pseudo-instruction may survive to the asm printer pass, just like the IMPLICIT_DEF. Print the KILL as a comment instead of just leaving a blank line in the output. With -asm-verbose=0, a blank line is printed, like IMPLICIT?DEF. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86041 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0fb7e18edd
commit
ad68264f59
@ -375,6 +375,8 @@ namespace llvm {
|
||||
/// that is an implicit def.
|
||||
virtual void printImplicitDef(const MachineInstr *MI) const;
|
||||
|
||||
/// printKill - This method prints the specified kill machine instruction.
|
||||
virtual void printKill(const MachineInstr *MI) const;
|
||||
|
||||
/// printPICJumpTableSetLabel - This method prints a set label for the
|
||||
/// specified MachineBasicBlock for a jumptable entry.
|
||||
|
@ -1590,6 +1590,17 @@ void AsmPrinter::printImplicitDef(const MachineInstr *MI) const {
|
||||
<< TRI->getName(MI->getOperand(0).getReg());
|
||||
}
|
||||
|
||||
void AsmPrinter::printKill(const MachineInstr *MI) const {
|
||||
if (!VerboseAsm) return;
|
||||
O.PadToColumn(MAI->getCommentColumn());
|
||||
O << MAI->getCommentString() << " kill:";
|
||||
for (unsigned n = 0, e = MI->getNumOperands(); n != e; ++n) {
|
||||
const MachineOperand &op = MI->getOperand(n);
|
||||
assert(op.isReg() && "KILL instruction must have only register operands");
|
||||
O << ' ' << TRI->getName(op.getReg()) << (op.isDef() ? "<def>" : "<kill>");
|
||||
}
|
||||
}
|
||||
|
||||
/// printLabel - This method prints a local label used by debug and
|
||||
/// exception handling tables.
|
||||
void AsmPrinter::printLabel(const MachineInstr *MI) const {
|
||||
|
@ -1346,6 +1346,7 @@ void ARMAsmPrinter::printInstructionThroughMCStreamer(const MachineInstr *MI) {
|
||||
printLabel(MI);
|
||||
return;
|
||||
case TargetInstrInfo::KILL:
|
||||
printKill(MI);
|
||||
return;
|
||||
case TargetInstrInfo::INLINEASM:
|
||||
O << '\t';
|
||||
|
@ -306,6 +306,7 @@ void MSP430AsmPrinter::printInstructionThroughMCStreamer(const MachineInstr *MI)
|
||||
printLabel(MI);
|
||||
return;
|
||||
case TargetInstrInfo::KILL:
|
||||
printKill(MI);
|
||||
return;
|
||||
case TargetInstrInfo::INLINEASM:
|
||||
O << '\t';
|
||||
|
@ -412,6 +412,7 @@ void X86AsmPrinter::printInstructionThroughMCStreamer(const MachineInstr *MI) {
|
||||
printImplicitDef(MI);
|
||||
return;
|
||||
case TargetInstrInfo::KILL:
|
||||
printKill(MI);
|
||||
return;
|
||||
case X86::MOVPC32r: {
|
||||
MCInst TmpInst;
|
||||
|
Loading…
Reference in New Issue
Block a user