aboutsummaryrefslogtreecommitdiff
path: root/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2007-10-04 23:45:31 +0000
committerDevang Patel <dpatel@apple.com>2007-10-04 23:45:31 +0000
commit51b09f2c528c8460b5465c676173324e44176d62 (patch)
treec5b00fdf16c14e53e9610b654c3b366a0113a0f0 /CodeGen/CodeGenFunction.h
parentb384d329e0b727d4f2effa28fbb9aba2ac420e7b (diff)
switch statement code gen.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42616 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CodeGen/CodeGenFunction.h')
-rw-r--r--CodeGen/CodeGenFunction.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/CodeGen/CodeGenFunction.h b/CodeGen/CodeGenFunction.h
index 2f7e0736e0..f804aaa626 100644
--- a/CodeGen/CodeGenFunction.h
+++ b/CodeGen/CodeGenFunction.h
@@ -41,7 +41,10 @@ namespace clang {
class ForStmt;
class ReturnStmt;
class DeclStmt;
-
+ class CaseStmt;
+ class DefaultStmt;
+ class SwitchStmt;
+
class Expr;
class DeclRefExpr;
class StringLiteral;
@@ -237,6 +240,10 @@ private:
};
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 @@ public:
/// 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 @@ public:
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
//===--------------------------------------------------------------------===//