[llvm] r185883 - Fix a bug in IRBuilder::ClearInsertionPoint. The IR Builder needs to reset both the BB and the insert point inside the BB.

Eric Christopher echristo at gmail.com
Mon Jul 8 17:11:42 PDT 2013


*looks at code*

Aha. Interesting. Why not just save the instruction that you'd like to
insert at on the side (or a stack of such if that's what's going on)?
I'm not clear on what BuilderLocGuard is doing other than the saving
of the instruction off to the side, but I admit that I've not looked a
whole lot :)

-eric

On Mon, Jul 8, 2013 at 5:06 PM, Nadav Rotem <nrotem at apple.com> wrote:
> SetInsertPoint does set both, but the GetInsertPoint returns only the
> Instruction (and not the BB).  I ran into this with the RAII class that
> saves the IRBuilder location.  Actually, Alexey's ASan bot helped me
> discover it :)
>
>
> On 07/08/13, Eric Christopher <echristo at gmail.com> wrote:
>
> On Mon, Jul 8, 2013 at 4:27 PM, Nadav Rotem <nrotem at apple.com> wrote:
>> Author: nadav
>> Date: Mon Jul  8 18:27:43 2013
>> New Revision: 185883
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=185883&view=rev
>> Log:
>> Fix a bug in IRBuilder::ClearInsertionPoint. The IR Builder needs to reset
>> both the BB and the insert point inside the BB.
>>
>
> I'd run into this in the past and didn't think much of it because all
> of the SetInsertPoint routines set both variables. How'd you run into
> this?
>
> -eric



More information about the llvm-commits mailing list