mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-22 10:33:23 +00:00
Debug info: Factor the retrieving of the DIVariable from a MachineInstr
into a function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205973 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f0aeabb5a6
commit
b7b9bf458b
@ -24,6 +24,7 @@
|
|||||||
#include "llvm/ADT/ilist_node.h"
|
#include "llvm/ADT/ilist_node.h"
|
||||||
#include "llvm/ADT/iterator_range.h"
|
#include "llvm/ADT/iterator_range.h"
|
||||||
#include "llvm/CodeGen/MachineOperand.h"
|
#include "llvm/CodeGen/MachineOperand.h"
|
||||||
|
#include "llvm/IR/DebugInfo.h"
|
||||||
#include "llvm/IR/DebugLoc.h"
|
#include "llvm/IR/DebugLoc.h"
|
||||||
#include "llvm/IR/InlineAsm.h"
|
#include "llvm/IR/InlineAsm.h"
|
||||||
#include "llvm/MC/MCInstrDesc.h"
|
#include "llvm/MC/MCInstrDesc.h"
|
||||||
@ -243,6 +244,14 @@ public:
|
|||||||
///
|
///
|
||||||
DebugLoc getDebugLoc() const { return debugLoc; }
|
DebugLoc getDebugLoc() const { return debugLoc; }
|
||||||
|
|
||||||
|
/// getDebugVariable() - Return the debug variable referenced by
|
||||||
|
/// this DBG_VALUE instruction.
|
||||||
|
DIVariable getDebugVariable() const {
|
||||||
|
assert(isDebugValue() && "not a DBG_VALUE");
|
||||||
|
const MDNode *Var = getOperand(getNumOperands() - 1).getMetadata();
|
||||||
|
return DIVariable(Var);
|
||||||
|
}
|
||||||
|
|
||||||
/// emitError - Emit an error referring to the source location of this
|
/// emitError - Emit an error referring to the source location of this
|
||||||
/// instruction. This should only be used for inline assembly that is somehow
|
/// instruction. This should only be used for inline assembly that is somehow
|
||||||
/// impossible to compile. Other errors should have been handled much
|
/// impossible to compile. Other errors should have been handled much
|
||||||
|
@ -1198,7 +1198,7 @@ static DebugLocEntry getDebugLocEntry(AsmPrinter *Asm,
|
|||||||
const MCSymbol *SLabel,
|
const MCSymbol *SLabel,
|
||||||
const MachineInstr *MI,
|
const MachineInstr *MI,
|
||||||
DwarfCompileUnit *Unit) {
|
DwarfCompileUnit *Unit) {
|
||||||
const MDNode *Var = MI->getOperand(MI->getNumOperands() - 1).getMetadata();
|
const MDNode *Var = MI->getDebugVariable();
|
||||||
|
|
||||||
assert(MI->getNumOperands() == 3);
|
assert(MI->getNumOperands() == 3);
|
||||||
if (MI->getOperand(0).isReg()) {
|
if (MI->getOperand(0).isReg()) {
|
||||||
@ -1493,8 +1493,7 @@ void DwarfDebug::beginFunction(const MachineFunction *MF) {
|
|||||||
assert(MI->getNumOperands() > 1 && "Invalid machine instruction!");
|
assert(MI->getNumOperands() > 1 && "Invalid machine instruction!");
|
||||||
|
|
||||||
// Keep track of user variables.
|
// Keep track of user variables.
|
||||||
const MDNode *Var =
|
const MDNode *Var = MI->getDebugVariable();
|
||||||
MI->getOperand(MI->getNumOperands() - 1).getMetadata();
|
|
||||||
|
|
||||||
// Variable is in a register, we need to check for clobbers.
|
// Variable is in a register, we need to check for clobbers.
|
||||||
if (isDbgValueInDefinedReg(MI))
|
if (isDbgValueInDefinedReg(MI))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user