diff options
author | Dale Johannesen <dalej@apple.com> | 2010-01-20 00:19:24 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2010-01-20 00:19:24 +0000 |
commit | 918f0f0beab7401172b0b17aeb04e8d757e97a10 (patch) | |
tree | 14a0ca432f5a6920f393499865a2eeb9c6e007a1 /lib/Target | |
parent | cd9e155755dab1913238ffc0374111a39d500adf (diff) | |
download | llvm-918f0f0beab7401172b0b17aeb04e8d757e97a10.tar.gz llvm-918f0f0beab7401172b0b17aeb04e8d757e97a10.tar.bz2 llvm-918f0f0beab7401172b0b17aeb04e8d757e97a10.tar.xz |
Move findDebugLoc somewhere more central. Fix
more cases where debug declarations affect
debug line info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93953 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/X86/X86InstrInfo.cpp | 6 | ||||
-rw-r--r-- | lib/Target/X86/X86RegisterInfo.cpp | 17 |
2 files changed, 2 insertions, 21 deletions
diff --git a/lib/Target/X86/X86InstrInfo.cpp b/lib/Target/X86/X86InstrInfo.cpp index 8b9d0b80ba..9501ace8d3 100644 --- a/lib/Target/X86/X86InstrInfo.cpp +++ b/lib/Target/X86/X86InstrInfo.cpp @@ -2200,8 +2200,7 @@ bool X86InstrInfo::spillCalleeSavedRegisters(MachineBasicBlock &MBB, if (CSI.empty()) return false; - DebugLoc DL = DebugLoc::getUnknownLoc(); - if (MI != MBB.end()) DL = MI->getDebugLoc(); + DebugLoc DL = findDebugLoc(MI, MBB); bool is64Bit = TM.getSubtarget<X86Subtarget>().is64Bit(); bool isWin64 = TM.getSubtarget<X86Subtarget>().isTargetWin64(); @@ -2239,8 +2238,7 @@ bool X86InstrInfo::restoreCalleeSavedRegisters(MachineBasicBlock &MBB, if (CSI.empty()) return false; - DebugLoc DL = DebugLoc::getUnknownLoc(); - if (MI != MBB.end()) DL = MI->getDebugLoc(); + DebugLoc DL = findDebugLoc(MI, MBB); MachineFunction &MF = *MBB.getParent(); unsigned FPReg = RI.getFrameRegister(MF); diff --git a/lib/Target/X86/X86RegisterInfo.cpp b/lib/Target/X86/X86RegisterInfo.cpp index 60e69e8d51..6962b8cef9 100644 --- a/lib/Target/X86/X86RegisterInfo.cpp +++ b/lib/Target/X86/X86RegisterInfo.cpp @@ -666,23 +666,6 @@ X86RegisterInfo::processFunctionBeforeCalleeSavedScan(MachineFunction &MF, } } -/// findDebugLoc - find the next valid DebugLoc starting at MBBI, skipping -/// any DEBUG_VALUE instructions. Return UnknownLoc if there is none. -static -DebugLoc findDebugLoc(MachineBasicBlock::iterator &MBBI, MachineBasicBlock &MBB) { - DebugLoc DL; - if (MBBI != MBB.end()) { - // Skip debug declarations, we don't want a DebugLoc from them. - MachineBasicBlock::iterator MBBI2 = MBBI; - while (MBBI2 != MBB.end() && - MBBI2->getOpcode()==TargetInstrInfo::DEBUG_VALUE) - MBBI2++; - if (MBBI2 != MBB.end()) - DL = MBBI2->getDebugLoc(); - } - return DL; -} - /// emitSPUpdate - Emit a series of instructions to increment / decrement the /// stack pointer by a constant value. static |