From 86a87d9ba1faf153e0e6eaddfd3e95595c83bcb1 Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Tue, 30 Apr 2013 22:35:14 +0000 Subject: Temporarily revert "Change the informal convention of DBG_VALUE so that we can express a" because it breaks some buildbots. This reverts commit 180816. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180819 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/LiveDebugVariables.cpp | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) (limited to 'lib/CodeGen/LiveDebugVariables.cpp') diff --git a/lib/CodeGen/LiveDebugVariables.cpp b/lib/CodeGen/LiveDebugVariables.cpp index d54a013..0b117ac 100644 --- a/lib/CodeGen/LiveDebugVariables.cpp +++ b/lib/CodeGen/LiveDebugVariables.cpp @@ -108,7 +108,6 @@ class LDVImpl; class UserValue { const MDNode *variable; ///< The debug info variable we are part of. unsigned offset; ///< Byte offset into variable. - bool Indirect; ///< true if this is a register-indirect+offset value. DebugLoc dl; ///< The debug location for the variable. This is ///< used by dwarf writer to find lexical scope. UserValue *leader; ///< Equivalence class leader. @@ -135,10 +134,9 @@ class UserValue { public: /// UserValue - Create a new UserValue. - UserValue(const MDNode *var, unsigned o, bool i, DebugLoc L, + UserValue(const MDNode *var, unsigned o, DebugLoc L, LocMap::Allocator &alloc) - : variable(var), offset(o), Indirect(i), dl(L), leader(this), - next(0), locInts(alloc) + : variable(var), offset(o), dl(L), leader(this), next(0), locInts(alloc) {} /// getLeader - Get the leader of this value's equivalence class. @@ -301,8 +299,7 @@ class LDVImpl { UVMap userVarMap; /// getUserValue - Find or create a UserValue. - UserValue *getUserValue(const MDNode *Var, unsigned Offset, - bool Indirect, DebugLoc DL); + UserValue *getUserValue(const MDNode *Var, unsigned Offset, DebugLoc DL); /// lookupVirtReg - Find the EC leader for VirtReg or null. UserValue *lookupVirtReg(unsigned VirtReg); @@ -417,7 +414,7 @@ void UserValue::mapVirtRegs(LDVImpl *LDV) { } UserValue *LDVImpl::getUserValue(const MDNode *Var, unsigned Offset, - bool Indirect, DebugLoc DL) { + DebugLoc DL) { UserValue *&Leader = userVarMap[Var]; if (Leader) { UserValue *UV = Leader->getLeader(); @@ -427,7 +424,7 @@ UserValue *LDVImpl::getUserValue(const MDNode *Var, unsigned Offset, return UV; } - UserValue *UV = new UserValue(Var, Offset, Indirect, DL, allocator); + UserValue *UV = new UserValue(Var, Offset, DL, allocator); userValues.push_back(UV); Leader = UserValue::merge(Leader, UV); return UV; @@ -448,17 +445,15 @@ UserValue *LDVImpl::lookupVirtReg(unsigned VirtReg) { bool LDVImpl::handleDebugValue(MachineInstr *MI, SlotIndex Idx) { // DBG_VALUE loc, offset, variable if (MI->getNumOperands() != 3 || - !(MI->getOperand(1).isReg() || MI->getOperand(1).isImm()) || - !MI->getOperand(2).isMetadata()) { + !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 Indirect = MI->getOperand(1).isImm(); - unsigned Offset = Indirect ? MI->getOperand(1).getImm() : 0; + unsigned Offset = MI->getOperand(1).getImm(); const MDNode *Var = MI->getOperand(2).getMetadata(); - UserValue *UV = getUserValue(Var, Offset, Indirect, MI->getDebugLoc()); + UserValue *UV = getUserValue(Var, Offset, MI->getDebugLoc()); UV->addDef(Idx, MI->getOperand(0)); return true; } @@ -929,8 +924,7 @@ void UserValue::insertDebugValue(MachineBasicBlock *MBB, SlotIndex Idx, // Frame index locations may require a target callback. if (Loc.isFI()) { MachineInstr *MI = TII.emitFrameIndexDebugValue(*MBB->getParent(), - Loc.getIndex(), - offset, variable, + Loc.getIndex(), offset, variable, findDebugLoc()); if (MI) { MBB->insert(I, MI); @@ -938,13 +932,8 @@ void UserValue::insertDebugValue(MachineBasicBlock *MBB, SlotIndex Idx, } } // This is not a frame index, or the target is happy with a standard FI. - - if (Loc.isReg()) - BuildMI(*MBB, I, findDebugLoc(), TII.get(TargetOpcode::DBG_VALUE), - Indirect, Loc.getReg(), offset, variable); - else - BuildMI(*MBB, I, findDebugLoc(), TII.get(TargetOpcode::DBG_VALUE)) - .addOperand(Loc).addImm(offset).addMetadata(variable); + BuildMI(*MBB, I, findDebugLoc(), TII.get(TargetOpcode::DBG_VALUE)) + .addOperand(Loc).addImm(offset).addMetadata(variable); } void UserValue::emitDebugValues(VirtRegMap *VRM, LiveIntervals &LIS, -- cgit v1.1