[LLVMdev] convert switch stmts to If statements

Hal Finkel hfinkel at anl.gov
Mon May 6 13:20:23 PDT 2013


----- Original Message -----
> From: "George Baah" <georgebaah at gmail.com>
> To: "LLVM Developers Mailing List" <llvmdev at cs.uiuc.edu>
> Sent: Monday, May 6, 2013 3:09:33 PM
> Subject: [LLVMdev] convert switch stmts to If statements
> 
> 
> 
> 
> Hi All, Is there a pass in llvm that converts switch statements to if
> statements?
> 

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).

 -Hal

> 
> George
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> 



More information about the llvm-dev mailing list