mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
Handle target-specific form of DBG_VALUE in AsmPrinter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102373 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fdb42fa5fe
commit
3f282aa94b
@ -21,6 +21,7 @@
|
||||
#include "ARMMachineFunctionInfo.h"
|
||||
#include "ARMMCInstLower.h"
|
||||
#include "ARMTargetMachine.h"
|
||||
#include "llvm/Analysis/DebugInfo.h"
|
||||
#include "llvm/Constants.h"
|
||||
#include "llvm/Module.h"
|
||||
#include "llvm/Type.h"
|
||||
@ -1108,6 +1109,24 @@ void ARMAsmPrinter::EmitInstruction(const MachineInstr *MI) {
|
||||
|
||||
SmallString<128> Str;
|
||||
raw_svector_ostream OS(Str);
|
||||
if (MI->getOpcode() == ARM::DBG_VALUE) {
|
||||
unsigned NOps = MI->getNumOperands();
|
||||
assert(NOps==4);
|
||||
OS << '\t' << MAI->getCommentString() << "DEBUG_VALUE: ";
|
||||
// cast away const; DIetc do not take const operands for some reason.
|
||||
DIVariable V(const_cast<MDNode *>(MI->getOperand(NOps-1).getMetadata()));
|
||||
OS << V.getName();
|
||||
OS << " <- ";
|
||||
// Frame address. Currently handles register +- offset only.
|
||||
assert(MI->getOperand(0).isReg() && MI->getOperand(1).isImm());
|
||||
OS << '['; printOperand(MI, 0, OS); OS << '+'; printOperand(MI, 1, OS);
|
||||
OS << ']';
|
||||
OS << "+";
|
||||
printOperand(MI, NOps-2, OS);
|
||||
OutStreamer.EmitRawText(OS.str());
|
||||
return;
|
||||
}
|
||||
|
||||
printInstruction(MI, OS);
|
||||
OutStreamer.EmitRawText(OS.str());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user