<div dir="ltr">I mean an llvm Pass that transforms switch statements into if statements. For example, if I have code with switch statements then running the pass will convert all switches to ifs in the bytecode.<div><br></div>
<div style>George</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 6, 2013 at 4:20 PM, Hal Finkel <span dir="ltr"><<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">----- Original Message -----<br>
> From: "George Baah" <<a href="mailto:georgebaah@gmail.com">georgebaah@gmail.com</a>><br>
> To: "LLVM Developers Mailing List" <<a href="mailto:llvmdev@cs.uiuc.edu">llvmdev@cs.uiuc.edu</a>><br>
> Sent: Monday, May 6, 2013 3:09:33 PM<br>
> Subject: [LLVMdev] convert switch stmts to If statements<br>
><br>
><br>
><br>
><br>
> Hi All, Is there a pass in llvm that converts switch statements to if<br>
> statements?<br>
><br>
<br>
</div></div>What do you mean by convert? SelectionDAGBuilder::visitSwitch in lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp converts the switch statements for code generation either into indirect jump tables or into binary-search trees (which I suppose you could call if statements).<br>
<br>
-Hal<br>
<br>
><br>
> George<br>
> _______________________________________________<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>
><br>
</blockquote></div><br></div>