mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-13 08:26:02 +00:00
DEBUG_VALUE is now variable sized, as it has a
target-dependent memory address representation in it. Restore X86 printing of DEBUG_VALUE; lowering is done in X86RegisterInfo using the normal algorithm. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93565 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -479,7 +479,7 @@ def COPY_TO_REGCLASS : Instruction {
|
|||||||
}
|
}
|
||||||
def DEBUG_VALUE : Instruction {
|
def DEBUG_VALUE : Instruction {
|
||||||
let OutOperandList = (ops);
|
let OutOperandList = (ops);
|
||||||
let InOperandList = (ops unknown:$value, i64imm:$offset, unknown:$meta);
|
let InOperandList = (ops variable_ops);
|
||||||
let AsmString = "DEBUG_VALUE";
|
let AsmString = "DEBUG_VALUE";
|
||||||
let Namespace = "TargetInstrInfo";
|
let Namespace = "TargetInstrInfo";
|
||||||
let isAsCheapAsAMove = 1;
|
let isAsCheapAsAMove = 1;
|
||||||
|
@@ -25,6 +25,7 @@
|
|||||||
#include "llvm/Support/FormattedStream.h"
|
#include "llvm/Support/FormattedStream.h"
|
||||||
#include "llvm/Support/Mangler.h"
|
#include "llvm/Support/Mangler.h"
|
||||||
#include "llvm/ADT/SmallString.h"
|
#include "llvm/ADT/SmallString.h"
|
||||||
|
#include "llvm/Analysis/DebugInfo.h"
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
|
|
||||||
@@ -420,6 +421,29 @@ void X86AsmPrinter::printInstructionThroughMCStreamer(const MachineInstr *MI) {
|
|||||||
case TargetInstrInfo::GC_LABEL:
|
case TargetInstrInfo::GC_LABEL:
|
||||||
printLabel(MI);
|
printLabel(MI);
|
||||||
return;
|
return;
|
||||||
|
case TargetInstrInfo::DEBUG_VALUE: {
|
||||||
|
if (!VerboseAsm)
|
||||||
|
return;
|
||||||
|
O << '\t' << MAI->getCommentString() << "DEBUG_VALUE: ";
|
||||||
|
unsigned NOps = MI->getNumOperands();
|
||||||
|
// cast away const; DIetc do not take const operands for some reason
|
||||||
|
DIVariable V((MDNode*)(MI->getOperand(NOps-1).getMetadata()));
|
||||||
|
O << V.getName();
|
||||||
|
O << " <- ";
|
||||||
|
if (NOps==3) {
|
||||||
|
// Variable is in register
|
||||||
|
assert(MI->getOperand(0).getType()==MachineOperand::MO_Register);
|
||||||
|
printOperand(MI, 0);
|
||||||
|
} else {
|
||||||
|
// Frame address. Currently handles ESP or ESP + offset only
|
||||||
|
assert(MI->getOperand(0).getType()==MachineOperand::MO_Register);
|
||||||
|
assert(MI->getOperand(3).getType()==MachineOperand::MO_Immediate);
|
||||||
|
O << '['; printOperand(MI, 0); O << '+'; printOperand(MI, 3); O << ']';
|
||||||
|
}
|
||||||
|
O << "+";
|
||||||
|
printOperand(MI, NOps-2);
|
||||||
|
return;
|
||||||
|
}
|
||||||
case TargetInstrInfo::INLINEASM:
|
case TargetInstrInfo::INLINEASM:
|
||||||
printInlineAsm(MI);
|
printInlineAsm(MI);
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user