<div dir="ltr"><div>Actually, I am trying to implement a frontend for conversion from binary to LLVM. In binary, we would encounter branch indirect instructions like,  Br Reg, where Reg would be an equivalent virtual register in LLVM. So, we can't directly implement Switch block method here to represent this instruction as we don't know how the values of Reg are mapped to basic blocks. </div>

<div> </div>
<div>I was going through the documentation and found that indirect branch are produced by virtual function calls. Are there any other cases which result into CodeGen procuding Indirect Branch?<br><br></div>
<div class="gmail_quote">On Thu, Jul 24, 2008 at 12:06 PM, David Greene <<a href="mailto:dag@cray.com">dag@cray.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="Ih2E3d">On Thursday 24 July 2008 01:47, Chris Lattner wrote:<br>> On Jul 23, 2008, at 8:47 PM, kapil anand wrote:<br>> > Specifically, I need a way to represent indirect branch instruction<br>> > (in binary) as an equivalent LLVM instruction. With switch<br>
> > instruction , I would have to list all the possible targets and then<br>> > initialize the corresponding instruction. I was just thinking<br>> > whether it might be possible to have some kind of indirect branch<br>
> > where label is a "variable" and not an explicit label present in<br>> > module.<br>><br>> No, and there never will be a way.  In the future, we will probably<br>> extend the CFG to better model the GCC "address of label + indirect<br>
> goto" extension.  However, even with that, all the possible<br>> destinations of an indirect goto must be explicitly known.<br><br></div>This would also help with Fortran assigned gotos.<br><br>                                             -Dave<br>

<div>
<div></div>
<div class="Wj3C7c">_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu/" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></div></div></blockquote></div><br></div>