summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2008-08-04 17:24:44 +0000
committerDaniel Dunbar <daniel@zuster.org>2008-08-04 17:24:44 +0000
commitd27262f3691fbd85ec06cecd899582d46e3c13ce (patch)
treecb21005a6d058d205204acce6cecfacc3d34cf76
parent98980287422269e2e8f74e3e3e5d07b5e47cf599 (diff)
downloadbcm5719-llvm-d27262f3691fbd85ec06cecd899582d46e3c13ce.tar.gz
bcm5719-llvm-d27262f3691fbd85ec06cecd899582d46e3c13ce.zip
Avoid creating dummy block when no indirect gotos are present.
llvm-svn: 54322
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 9814ae71374..e153c21b774 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -190,6 +190,9 @@ unsigned CodeGenFunction::GetIDForAddrOfLabel(const LabelStmt *L) {
void CodeGenFunction::EmitIndirectSwitches() {
llvm::BasicBlock *Default;
+ if (IndirectSwitches.empty())
+ return;
+
if (!LabelIDs.empty()) {
Default = getBasicBlockForLabel(LabelIDs.begin()->first);
} else {
OpenPOWER on IntegriCloud