From 76526a5245ec2283b0c85fcef507d4c2dec90715 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Mon, 4 Aug 2008 17:24:44 +0000 Subject: 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 --- lib/CodeGen/CodeGenFunction.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/CodeGen/CodeGenFunction.cpp') 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 { -- cgit v1.2.3-18-g5258