diff options
author | Devang Patel <dpatel@apple.com> | 2007-10-04 23:45:31 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2007-10-04 23:45:31 +0000 |
commit | 51b09f2c528c8460b5465c676173324e44176d62 (patch) | |
tree | c5b00fdf16c14e53e9610b654c3b366a0113a0f0 /CodeGen/CodeGenFunction.cpp | |
parent | b384d329e0b727d4f2effa28fbb9aba2ac420e7b (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.cpp')
-rw-r--r-- | CodeGen/CodeGenFunction.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/CodeGen/CodeGenFunction.cpp b/CodeGen/CodeGenFunction.cpp index 363d299c26..e8a00c89ea 100644 --- a/CodeGen/CodeGenFunction.cpp +++ b/CodeGen/CodeGenFunction.cpp @@ -115,3 +115,13 @@ bool CodeGenFunction::isDummyBlock(const llvm::BasicBlock *BB) { return false; } +/// StartBlock - Start new block named N. If insert block is a dummy block +/// then reuse it. +void CodeGenFunction::StartBlock(const char *N) { + llvm::BasicBlock *BB = Builder.GetInsertBlock(); + if (!isDummyBlock(BB)) + EmitBlock(new llvm::BasicBlock(N)); + else + BB->setName(N); +} + |