Fixed codegen of SwitchErrorStatement

This commit is contained in:
Alexey Prokhin
2012-02-13 12:30:43 +04:00
parent eba8aac824
commit b3ed8724b7

View File

@@ -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
}
//////////////////////////////////////////////////////////////////////////////