From: Daniel Dunbar Date: Mon, 4 Aug 2008 17:24:44 +0000 (+0000) Subject: Avoid creating dummy block when no indirect gotos are present. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=76526a5245ec2283b0c85fcef507d4c2dec90715;p=clang Avoid creating dummy block when no indirect gotos are present. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54322 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp index 9814ae7137..e153c21b77 100644 --- a/lib/CodeGen/CodeGenFunction.cpp +++ b/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 {