From d27262f3691fbd85ec06cecd899582d46e3c13ce 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. llvm-svn: 54322 --- clang/lib/CodeGen/CodeGenFunction.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'clang/lib/CodeGen') diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 9814ae71374b..e153c21b774f 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 { -- cgit v1.2.3