From b3ed8724b7818af84fdb00de993d61a0712ee3e7 Mon Sep 17 00:00:00 2001 From: Alexey Prokhin Date: Mon, 13 Feb 2012 12:30:43 +0400 Subject: [PATCH] Fixed codegen of SwitchErrorStatement --- gen/statements.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gen/statements.cpp b/gen/statements.cpp index 2d487c8d..665c6698 100644 --- a/gen/statements.cpp +++ b/gen/statements.cpp @@ -837,7 +837,7 @@ static LLValue* call_string_switch_runtime(llvm::Value* table, Expression* e) fname = "_d_switch_dstring"; } else { - llvm_unreachable("not char/wchar/dchar"); + llvm_unreachable("not char/wchar/dchar"); } llvm::Function* fn = LLVM_D_GetRuntimeFunction(gIR->module, fname); @@ -1631,9 +1631,12 @@ void SwitchErrorStatement::toIR(IRState* p) args.push_back(c); // call - gIR->CreateCallOrInvoke(fn, args); + LLCallSite call = gIR->CreateCallOrInvoke(fn, args); + call.setDoesNotReturn(); +#if DMDV1 gIR->ir->CreateUnreachable(); +#endif } //////////////////////////////////////////////////////////////////////////////