diff options
author | Brian Gaeke <gaeke@uiuc.edu> | 2004-07-16 10:31:47 +0000 |
---|---|---|
committer | Brian Gaeke <gaeke@uiuc.edu> | 2004-07-16 10:31:47 +0000 |
commit | d303a2058cdfac5f11ae65762d68577f34e9abdb (patch) | |
tree | 945e2c0239555cc9c88ccc6e8e673487e19eaed6 /lib/Target/Sparc | |
parent | 22b5cd8ac755359a6ba0b9492d376d5ca46ede12 (diff) |
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
Diffstat (limited to 'lib/Target/Sparc')
-rw-r--r-- | lib/Target/Sparc/SparcAsmPrinter.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/Target/Sparc/SparcAsmPrinter.cpp b/lib/Target/Sparc/SparcAsmPrinter.cpp index 64060abae6..34cdade711 100644 --- a/lib/Target/Sparc/SparcAsmPrinter.cpp +++ b/lib/Target/Sparc/SparcAsmPrinter.cpp @@ -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, /// 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 @@ -484,6 +497,11 @@ void V8Printer::printMachineInstruction(const MachineInstr *MI) { unsigned Opcode = MI->getOpcode(); const TargetInstrInfo &TII = *TM.getInstrInfo(); const TargetInstrDescriptor &Desc = TII.get(Opcode); + + // If it's a pseudo-instruction, comment it out. + if (isPseudoInstruction (MI)) + O << "! "; + O << Desc.Name << " "; // Printing memory instructions is a special case. |