diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-06-30 23:13:38 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-06-30 23:13:38 +0000 |
commit | fb612acff75a24059508602b5a65df4a959939cd (patch) | |
tree | 4b094877ca47ba8aa4cd6275a1efb7171358ec3b /llvm/lib/CodeGen | |
parent | 08debb0244fa1e4ca4a3b50dc726608ee34f0be6 (diff) | |
download | bcm5719-llvm-fb612acff75a24059508602b5a65df4a959939cd.tar.gz bcm5719-llvm-fb612acff75a24059508602b5a65df4a959939cd.zip |
CodeGen: Use MachineInstr& in LDVImpl::handleDebugValue, NFC
Avoid another implicit conversion from iterator to pointer.
llvm-svn: 274294
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/LiveDebugVariables.cpp | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugVariables.cpp b/llvm/lib/CodeGen/LiveDebugVariables.cpp index 69297a339d7..966b4f1f4e4 100644 --- a/llvm/lib/CodeGen/LiveDebugVariables.cpp +++ b/llvm/lib/CodeGen/LiveDebugVariables.cpp @@ -314,7 +314,7 @@ class LDVImpl { /// @param MI DBG_VALUE instruction /// @param Idx Last valid SLotIndex before instruction. /// @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 /// a UserValue def for each instruction. @@ -488,24 +488,23 @@ UserValue *LDVImpl::lookupVirtReg(unsigned VirtReg) { return nullptr; } -bool LDVImpl::handleDebugValue(MachineInstr *MI, SlotIndex Idx) { +bool LDVImpl::handleDebugValue(MachineInstr &MI, SlotIndex Idx) { // DBG_VALUE loc, offset, variable - if (MI->getNumOperands() != 4 || - !(MI->getOperand(1).isReg() || MI->getOperand(1).isImm()) || - !MI->getOperand(2).isMetadata()) { - DEBUG(dbgs() << "Can't handle " << *MI); + if (MI.getNumOperands() != 4 || + !(MI.getOperand(1).isReg() || MI.getOperand(1).isImm()) || + !MI.getOperand(2).isMetadata()) { + DEBUG(dbgs() << "Can't handle " << MI); return false; } // Get or create the UserValue for (variable,offset). - bool IsIndirect = MI->isIndirectDebugValue(); - unsigned Offset = IsIndirect ? MI->getOperand(1).getImm() : 0; - const MDNode *Var = MI->getDebugVariable(); - const MDNode *Expr = MI->getDebugExpression(); + bool IsIndirect = MI.isIndirectDebugValue(); + unsigned Offset = IsIndirect ? MI.getOperand(1).getImm() : 0; + const MDNode *Var = MI.getDebugVariable(); + const MDNode *Expr = MI.getDebugExpression(); //here. - UserValue *UV = - getUserValue(Var, Expr, Offset, IsIndirect, MI->getDebugLoc()); - UV->addDef(Idx, MI->getOperand(0)); + UserValue *UV = getUserValue(Var, Expr, Offset, IsIndirect, MI.getDebugLoc()); + UV->addDef(Idx, MI.getOperand(0)); return true; } @@ -527,7 +526,7 @@ bool LDVImpl::collectDebugValues(MachineFunction &mf) { : LIS->getInstructionIndex(*std::prev(MBBI)).getRegSlot(); // Handle consecutive DBG_VALUE instructions with the same slot index. do { - if (handleDebugValue(MBBI, Idx)) { + if (handleDebugValue(*MBBI, Idx)) { MBBI = MBB->erase(MBBI); Changed = true; } else |