On Dec 29, 6:12 pm, Baptiste Lepilleur <baptiste.lepill...@gmail.com>
wrote:
> I wanted to change the basic block the builder was working on to a newly
> created basic block.
>
> I basically add something like this:
>
> basic_block_then = self.l_func.append_basic_block( '%s_then' % if_id )
> self.builder.position_at_beginning( basic_block_then )
>
> but Builder.position_at_beginning translated into a no op. I managed to get
> this to work using:
> self.builder.position_at_end( basic_block_then )
>
> Shouldn't position_at_beginning semantic be the same as position_at_end when
> the block contains no instruction? (or at least blow up with an exception).
Throwing an exception seems to be the proper thing to do, as
positioning is valid only when the basic block contains instructions.
Please raise an issue in the tracker; if possible include patch to
code and unit tests.
Thanks & Regards,
-Mahadevan.