// If we are inserting a LABEL and this happens to be the first label in
// the entry block, it is the "function start" label. Make sure there are
// no other instructions before it.
- bool SeenLabel = false;
+ unsigned NumLabels = 0;
MachineBasicBlock::iterator MBBI = BB->begin();
while (MBBI != BB->end()) {
if (MBBI->getOpcode() == TargetInstrInfo::LABEL) {
- SeenLabel = true;
- break;
+ if (++NumLabels > 1)
+ break;
}
++MBBI;
}
- if (!SeenLabel)
+ if (NumLabels <= 1)
BB->insert(BB->begin(), MI);
else
BB->push_back(MI);
X86FI->getCalleeSavedFrameSize() +(-TailCallReturnAddrDelta));
uint64_t NumBytes = StackSize - X86FI->getCalleeSavedFrameSize();
- // Skip over the label which mark the beginning of the function.
- if (MMI && MMI->needsFrameInfo() &&
- MBBI != MBB.end() &&
- MBBI->getOpcode() == X86::LABEL)
+ // Skip over the labels which mark the beginning of the function.
+ if (MMI && MMI->needsFrameInfo()) {
+ unsigned NumLabels = 0;
+ while (NumLabels <= 1 &&
+ MBBI != MBB.end() && MBBI->getOpcode() == X86::LABEL) {
+ ++NumLabels;
++MBBI;
+ }
+ }
// Insert stack pointer adjustment for later moving of return addr. Only
// applies to tail call optimized functions where the callee argument stack