switch statement code gen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42616 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/CodeGen/CodeGenFunction.h b/CodeGen/CodeGenFunction.h
index 2f7e073..f804aaa 100644
--- a/CodeGen/CodeGenFunction.h
+++ b/CodeGen/CodeGenFunction.h
@@ -41,7 +41,10 @@
   class ForStmt;
   class ReturnStmt;
   class DeclStmt;
-  
+  class CaseStmt;
+  class DefaultStmt;
+  class SwitchStmt;
+
   class Expr;
   class DeclRefExpr;
   class StringLiteral;
@@ -237,6 +240,10 @@
   }; 
   llvm::SmallVector<BreakContinue, 8> BreakContinueStack;
   
+  // SwitchInsn - This is used by EmitCaseStmt() and EmitDefaultStmt() to
+  // populate switch instruction
+  llvm::SwitchInst *SwitchInsn;
+
 public:
   CodeGenFunction(CodeGenModule &cgm);
   
@@ -281,6 +288,10 @@
   /// with no predecessors.
   static bool isDummyBlock(const llvm::BasicBlock *BB);
 
+  /// StartBlock - Start new block named N. If insert block is a dummy block
+  /// then reuse it.
+  void StartBlock(const char *N);
+
   //===--------------------------------------------------------------------===//
   //                            Declaration Emission
   //===--------------------------------------------------------------------===//
@@ -308,7 +319,10 @@
   void EmitDeclStmt(const DeclStmt &S);
   void EmitBreakStmt();
   void EmitContinueStmt();
-  
+  void EmitSwitchStmt(const SwitchStmt &S);
+  void EmitDefaultStmt(const DefaultStmt &S);
+  void EmitCaseStmt(const CaseStmt &S);
+
   //===--------------------------------------------------------------------===//
   //                         LValue Expression Emission
   //===--------------------------------------------------------------------===//