[llvm] r252578 - Support for emitting inline stack probes

Andy Ayers via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 21 17:58:40 PST 2016


We don't expect any bundles here, so the instr_iterator seems correct.

-----Original Message-----
From: dexonsmith at apple.com [mailto:dexonsmith at apple.com] 
Sent: Sunday, February 21, 2016 3:06 PM
To: Andy Ayers <andya at microsoft.com>
Cc: llvm-commits at lists.llvm.org
Subject: Re: [llvm] r252578 - Support for emitting inline stack probes


> On 2015-Nov-09, at 17:50, Andy Ayers via llvm-commits <llvm-commits at lists.llvm.org> wrote:
> 
> 
> +  if (ChkStkStub != nullptr) {
> +    MachineBasicBlock::iterator MBBI = 
> + std::next(ChkStkStub->getIterator());

I noticed this (and added a FIXME) in r261504.  getIterator() (now called getInstrIterator()) returns a MachineBasicBlock::instr_iterator.

Did you want to increment a MachineBasicBlock::iterator (a bundle iterator?).

- If so, there's now convenient API: getBundleIterator().
- If not, let me know, and I'll remove the FIXME I added.

> +    assert(std::prev(MBBI).operator==(ChkStkStub) &&
> +      "MBBI expected after __chkstk_stub.");
> +    DebugLoc DL = PrologMBB.findDebugLoc(MBBI);
> +    emitStackProbeInline(MF, PrologMBB, MBBI, DL, true);
> +    ChkStkStub->eraseFromParent();
> +  }




More information about the llvm-commits mailing list