mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-01 15:40:55 +03:00
Handle new throw expressions
This commit is contained in:
parent
78681e12e1
commit
5c9f1e5fd6
4 changed files with 32 additions and 14 deletions
|
@ -934,19 +934,7 @@ public:
|
|||
emitCoverageLinecountInc(stmt->loc);
|
||||
|
||||
assert(stmt->exp);
|
||||
DValue *e = toElemDtor(stmt->exp);
|
||||
|
||||
llvm::Function *fn =
|
||||
getRuntimeFunction(stmt->loc, irs->module, "_d_throw_exception");
|
||||
LLValue *arg =
|
||||
DtoBitCast(DtoRVal(e), fn->getFunctionType()->getParamType(0));
|
||||
|
||||
irs->CreateCallOrInvoke(fn, arg);
|
||||
irs->ir->CreateUnreachable();
|
||||
|
||||
// TODO: Should not be needed.
|
||||
llvm::BasicBlock *bb = irs->insertBB("afterthrow");
|
||||
irs->ir->SetInsertPoint(bb);
|
||||
DtoThrow(stmt->loc, toElemDtor(stmt->exp));
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue