[LLVMdev] Emit a jump instruction to a place inside basicblock
Robin Morisset
morisset at google.com
Thu Oct 30 11:33:16 PDT 2014
Hi,
>From my understanding of the LLVM IR, it is impossible to jump to the
middle of a Basic Block, only to its beginning. But there is a
splitBasicBlock function that seems like it might be useful to you, to make
sure a basic block is starting at the exact place you want to jump.
Best regards,
Robin
On Wed Oct 29 2014 at 2:28:09 PM Xiaoguang Wang <xgwang09 at gmail.com> wrote:
> Hi all,
>
> I'm a beginner in LLVM. Currently, I want to implement a pass that
> generates a jump table. The entry in that table is a jump to some place
> (may be an instruction) in a basic block.
>
> I'm reading the JumpTable code in llvm 3.5, there is a table which
> contains jump entries to functions. In AsmPrinter::doFinalization function
> from file lib/CodeGen/AsmPrinter/AsmPrinter.cpp, it gets a MCSymbolRefExpr
> from the function symbol.
>
> While my question is, is there a way to insert jump to place inside a
> basic block?
>
> Thanks!
>
> Xiaoguang
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141030/174c96d6/attachment.html>
More information about the llvm-dev
mailing list