diff options
author | Chris Lattner <sabre@nondot.org> | 2002-10-29 20:07:16 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-10-29 20:07:16 +0000 |
commit | 495fe2e087c5f4ec4372d8f6d2fdc27ff93c61c5 (patch) | |
tree | 44ad92e43c59368ce85877283e4cd64b04e3969d /lib/CodeGen/MFunction.cpp | |
parent | a2bae305fb5a870c4ef753ed290a7ddea73ec82b (diff) |
X86 merge is complete, eliminate unused code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4400 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MFunction.cpp')
-rw-r--r-- | lib/CodeGen/MFunction.cpp | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/lib/CodeGen/MFunction.cpp b/lib/CodeGen/MFunction.cpp deleted file mode 100644 index f586f4c598..0000000000 --- a/lib/CodeGen/MFunction.cpp +++ /dev/null @@ -1,76 +0,0 @@ -//===-- MFunction.cpp - Implementation code for the MFunction class -------===// -// -// This file contains a printer that converts from our internal representation -// of LLVM code to a nice human readable form that is suitable for debuggging. -// -//===----------------------------------------------------------------------===// - -#include "llvm/CodeGen/MFunction.h" -#include "llvm/Target/MInstructionInfo.h" -#include "llvm/Target/MRegisterInfo.h" -#include <iostream> - -static void printMRegister(unsigned RegNo, const MRegisterInfo &MRI, - std::ostream &OS) { - if (RegNo < MRegisterInfo::FirstVirtualRegister) { - OS << "%" << MRI[RegNo].Name; // Hard registers are prefixed with % - } else { - OS << "reg" << RegNo; // SSA registers are printed with 'reg' prefix - } -} - -static void printMInstruction(const MInstruction &MI, std::ostream &OS, - const MInstructionInfo &MII) { - const MRegisterInfo &MRI = MII.getRegisterInfo(); - OS << "\t"; - if (MI.getDestinationReg() != MRegisterInfo::NoRegister) {// Produces a value? - printMRegister(MI.getDestinationReg(), MRI, OS); - OS << " = "; - } - - OS << MII[MI.getOpcode()].Name << " "; - - for (unsigned i = 0, e = MI.getNumOperands(); i != e; ++i) { - if (i != 0) OS << ", "; - switch (MI.getOperandInterpretation(i)) { - case MOperand::Register: - printMRegister(MI.getRegisterOperand(i), MRI, OS); - break; - case MOperand::SignExtImmediate: - OS << MI.getSignExtOperand(i) << "s"; - break; - case MOperand::ZeroExtImmediate: - OS << MI.getZeroExtOperand(i) << "z"; - break; - case MOperand::PCRelativeDisp: - if (MI.getPCRelativeOperand(i) >= 0) - OS << "pc+" << MI.getPCRelativeOperand(i); - else - OS << "pc" << MI.getPCRelativeOperand(i); - break; - default: - OS << "*UNKNOWN OPERAND INTERPRETATION*"; - break; - } - } - OS << "\n"; -} - -/// print - Provide a way to get a simple debugging dump. This dumps the -/// machine code in a simple "assembly" language that is not really suitable -/// for an assembler, but is useful for debugging. This is completely target -/// independant. -/// -void MFunction::print(std::ostream &OS, const MInstructionInfo &MII) const { - for (const_iterator I = begin(), E = end(); I != E; ++I) { - for (MBasicBlock::const_iterator II = I->begin(), IE = I->end(); - II != IE; ++II) - printMInstruction(*II, OS, MII); - OS << "\n"; // blank line between basic blocks... - } -} - -void MFunction::dump(const MInstructionInfo &MII) const { - print(std::cerr, MII); -} - |