mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-15 07:39:31 +00:00
CodeGen: Use MachineInstr& in LDVImpl::handleDebugValue, NFC
Avoid another implicit conversion from iterator to pointer. llvm-svn: 274294
This commit is contained in:
parent
1e3982dae5
commit
a7c67ff659
@ -314,7 +314,7 @@ class LDVImpl {
|
|||||||
/// @param MI DBG_VALUE instruction
|
/// @param MI DBG_VALUE instruction
|
||||||
/// @param Idx Last valid SLotIndex before instruction.
|
/// @param Idx Last valid SLotIndex before instruction.
|
||||||
/// @return True if the DBG_VALUE instruction should be deleted.
|
/// @return True if the DBG_VALUE instruction should be deleted.
|
||||||
bool handleDebugValue(MachineInstr *MI, SlotIndex Idx);
|
bool handleDebugValue(MachineInstr &MI, SlotIndex Idx);
|
||||||
|
|
||||||
/// collectDebugValues - Collect and erase all DBG_VALUE instructions, adding
|
/// collectDebugValues - Collect and erase all DBG_VALUE instructions, adding
|
||||||
/// a UserValue def for each instruction.
|
/// a UserValue def for each instruction.
|
||||||
@ -488,24 +488,23 @@ UserValue *LDVImpl::lookupVirtReg(unsigned VirtReg) {
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LDVImpl::handleDebugValue(MachineInstr *MI, SlotIndex Idx) {
|
bool LDVImpl::handleDebugValue(MachineInstr &MI, SlotIndex Idx) {
|
||||||
// DBG_VALUE loc, offset, variable
|
// DBG_VALUE loc, offset, variable
|
||||||
if (MI->getNumOperands() != 4 ||
|
if (MI.getNumOperands() != 4 ||
|
||||||
!(MI->getOperand(1).isReg() || MI->getOperand(1).isImm()) ||
|
!(MI.getOperand(1).isReg() || MI.getOperand(1).isImm()) ||
|
||||||
!MI->getOperand(2).isMetadata()) {
|
!MI.getOperand(2).isMetadata()) {
|
||||||
DEBUG(dbgs() << "Can't handle " << *MI);
|
DEBUG(dbgs() << "Can't handle " << MI);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get or create the UserValue for (variable,offset).
|
// Get or create the UserValue for (variable,offset).
|
||||||
bool IsIndirect = MI->isIndirectDebugValue();
|
bool IsIndirect = MI.isIndirectDebugValue();
|
||||||
unsigned Offset = IsIndirect ? MI->getOperand(1).getImm() : 0;
|
unsigned Offset = IsIndirect ? MI.getOperand(1).getImm() : 0;
|
||||||
const MDNode *Var = MI->getDebugVariable();
|
const MDNode *Var = MI.getDebugVariable();
|
||||||
const MDNode *Expr = MI->getDebugExpression();
|
const MDNode *Expr = MI.getDebugExpression();
|
||||||
//here.
|
//here.
|
||||||
UserValue *UV =
|
UserValue *UV = getUserValue(Var, Expr, Offset, IsIndirect, MI.getDebugLoc());
|
||||||
getUserValue(Var, Expr, Offset, IsIndirect, MI->getDebugLoc());
|
UV->addDef(Idx, MI.getOperand(0));
|
||||||
UV->addDef(Idx, MI->getOperand(0));
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -527,7 +526,7 @@ bool LDVImpl::collectDebugValues(MachineFunction &mf) {
|
|||||||
: LIS->getInstructionIndex(*std::prev(MBBI)).getRegSlot();
|
: LIS->getInstructionIndex(*std::prev(MBBI)).getRegSlot();
|
||||||
// Handle consecutive DBG_VALUE instructions with the same slot index.
|
// Handle consecutive DBG_VALUE instructions with the same slot index.
|
||||||
do {
|
do {
|
||||||
if (handleDebugValue(MBBI, Idx)) {
|
if (handleDebugValue(*MBBI, Idx)) {
|
||||||
MBBI = MBB->erase(MBBI);
|
MBBI = MBB->erase(MBBI);
|
||||||
Changed = true;
|
Changed = true;
|
||||||
} else
|
} else
|
||||||
|
Loading…
Reference in New Issue
Block a user