mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
XCore target: remove incorrect DebugLoc entries from prologue
Summary: This was causing the prologue_end to be incorrectly positioned. Differential Revision: http://reviews.llvm.org/D4122 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212318 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -228,7 +228,9 @@ void XCoreFrameLowering::emitPrologue(MachineFunction &MF) const {
|
||||
const XCoreInstrInfo &TII =
|
||||
*static_cast<const XCoreInstrInfo*>(MF.getTarget().getInstrInfo());
|
||||
XCoreFunctionInfo *XFI = MF.getInfo<XCoreFunctionInfo>();
|
||||
DebugLoc dl = MBBI != MBB.end() ? MBBI->getDebugLoc() : DebugLoc();
|
||||
// Debug location must be unknown since the first debug location is used
|
||||
// to determine the end of the prologue.
|
||||
DebugLoc dl;
|
||||
|
||||
if (MFI->getMaxAlignment() > getStackAlignment())
|
||||
report_fatal_error("emitPrologue unsupported alignment: "
|
||||
@@ -416,7 +418,7 @@ spillCalleeSavedRegisters(MachineBasicBlock &MBB,
|
||||
bool emitFrameMoves = XCoreRegisterInfo::needsFrameMoves(*MF);
|
||||
|
||||
DebugLoc DL;
|
||||
if (MI != MBB.end())
|
||||
if (MI != MBB.end() && !MI->isDebugValue())
|
||||
DL = MI->getDebugLoc();
|
||||
|
||||
for (std::vector<CalleeSavedInfo>::const_iterator it = CSI.begin();
|
||||
|
@@ -373,7 +373,8 @@ void XCoreInstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||
const TargetRegisterInfo *TRI) const
|
||||
{
|
||||
DebugLoc DL;
|
||||
if (I != MBB.end()) DL = I->getDebugLoc();
|
||||
if (I != MBB.end() && !I->isDebugValue())
|
||||
DL = I->getDebugLoc();
|
||||
MachineFunction *MF = MBB.getParent();
|
||||
const MachineFrameInfo &MFI = *MF->getFrameInfo();
|
||||
MachineMemOperand *MMO =
|
||||
@@ -395,7 +396,8 @@ void XCoreInstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
const TargetRegisterInfo *TRI) const
|
||||
{
|
||||
DebugLoc DL;
|
||||
if (I != MBB.end()) DL = I->getDebugLoc();
|
||||
if (I != MBB.end() && !I->isDebugValue())
|
||||
DL = I->getDebugLoc();
|
||||
MachineFunction *MF = MBB.getParent();
|
||||
const MachineFrameInfo &MFI = *MF->getFrameInfo();
|
||||
MachineMemOperand *MMO =
|
||||
@@ -440,7 +442,8 @@ MachineBasicBlock::iterator XCoreInstrInfo::loadImmediate(
|
||||
MachineBasicBlock::iterator MI,
|
||||
unsigned Reg, uint64_t Value) const {
|
||||
DebugLoc dl;
|
||||
if (MI != MBB.end()) dl = MI->getDebugLoc();
|
||||
if (MI != MBB.end() && !MI->isDebugValue())
|
||||
dl = MI->getDebugLoc();
|
||||
if (isImmMskBitp(Value)) {
|
||||
int N = Log2_32(Value) + 1;
|
||||
return BuildMI(MBB, MI, dl, get(XCore::MKMSK_rus), Reg).addImm(N);
|
||||
|
Reference in New Issue
Block a user