diff options
author | Akira Hatanaka <ahatanak@gmail.com> | 2011-07-01 01:04:43 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanak@gmail.com> | 2011-07-01 01:04:43 +0000 |
commit | c4f24eb584f6b4dba3caba2ed766c7c4bf1bf8af (patch) | |
tree | 026b0f8b76975dcd8eb398566db1aa58a674b2c5 /lib/Target/Mips/MipsAsmPrinter.cpp | |
parent | 68c0dbc14fb7599987fb3e27be4e12c1ac36535e (diff) |
Improve Mips back-end's handling of DBG_VALUE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134224 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips/MipsAsmPrinter.cpp')
-rw-r--r-- | lib/Target/Mips/MipsAsmPrinter.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/Target/Mips/MipsAsmPrinter.cpp b/lib/Target/Mips/MipsAsmPrinter.cpp index 6f69ba388f..78f69eaa25 100644 --- a/lib/Target/Mips/MipsAsmPrinter.cpp +++ b/lib/Target/Mips/MipsAsmPrinter.cpp @@ -38,6 +38,8 @@ #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/Twine.h" #include "llvm/Support/raw_ostream.h" +#include "llvm/Analysis/DebugInfo.h" + using namespace llvm; namespace { @@ -75,6 +77,10 @@ namespace { void EmitInstruction(const MachineInstr *MI) { SmallString<128> Str; raw_svector_ostream OS(Str); + + if (MI->isDebugValue()) + PrintDebugValueComment(MI, OS); + printInstruction(MI, OS); OutStreamer.EmitRawText(OS.str()); } @@ -86,6 +92,9 @@ namespace { virtual void EmitFunctionEntryLabel(); void EmitStartOfAsmFile(Module &M); + virtual MachineLocation getDebugValueLocation(const MachineInstr *MI) const; + + void PrintDebugValueComment(const MachineInstr *MI, raw_ostream &OS); }; } // end of anonymous namespace @@ -441,6 +450,21 @@ void MipsAsmPrinter::EmitStartOfAsmFile(Module &M) { OutStreamer.EmitRawText(StringRef("\t.previous")); } +MachineLocation +MipsAsmPrinter::getDebugValueLocation(const MachineInstr *MI) const { + // Handles frame addresses emitted in MipsInstrInfo::emitFrameIndexDebugValue. + assert(MI->getNumOperands() == 4 && "Invalid no. of machine operands!"); + assert(MI->getOperand(0).isReg() && MI->getOperand(1).isImm() && + "Unexpected MachineOperand types"); + return MachineLocation(MI->getOperand(0).getReg(), + MI->getOperand(1).getImm()); +} + +void MipsAsmPrinter::PrintDebugValueComment(const MachineInstr *MI, + raw_ostream &OS) { + // TODO: implement +} + // Force static initialization. extern "C" void LLVMInitializeMipsAsmPrinter() { RegisterAsmPrinter<MipsAsmPrinter> X(TheMipsTarget); |