mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-06 02:45:25 +03:00
eh unwinding: don't alloc data in parent frame, just use nullptr for now
This commit is contained in:
parent
83368904d1
commit
d8bbc0491d
1 changed files with 4 additions and 7 deletions
|
@ -273,7 +273,7 @@ llvm::BasicBlock *ScopeStack::runCleanupPad(CleanupCursor scope,
|
||||||
//
|
//
|
||||||
// cleanuppad:
|
// cleanuppad:
|
||||||
// %0 = cleanuppad within %funclet[]
|
// %0 = cleanuppad within %funclet[]
|
||||||
// %frame = alloca(byte[16])
|
// %frame = nullptr
|
||||||
// if (!_d_enter_cleanup(%frame)) br label %cleanupret
|
// if (!_d_enter_cleanup(%frame)) br label %cleanupret
|
||||||
// else br label %copy
|
// else br label %copy
|
||||||
//
|
//
|
||||||
|
@ -292,12 +292,9 @@ llvm::BasicBlock *ScopeStack::runCleanupPad(CleanupCursor scope,
|
||||||
llvm::BasicBlock *cleanupret =
|
llvm::BasicBlock *cleanupret =
|
||||||
llvm::BasicBlock::Create(irs->context(), "cleanupret", irs->topfunc());
|
llvm::BasicBlock::Create(irs->context(), "cleanupret", irs->topfunc());
|
||||||
|
|
||||||
// allocate some space on the stack where _d_enter_cleanup can place an exception frame
|
// preparation to allocate some space on the stack where _d_enter_cleanup
|
||||||
auto int8Ty = LLType::getInt8Ty(gIR->context());
|
// can place an exception frame (but not done here)
|
||||||
auto frametype = llvm::ArrayType::get(int8Ty, 16);
|
auto frame = getNullPtr(getVoidPtrType());
|
||||||
auto frameai = DtoRawAlloca(frametype, 0, "cleanup.frame");
|
|
||||||
auto frame =
|
|
||||||
new llvm::BitCastInst(frameai, getPtrToType(int8Ty), "", cleanupbb);
|
|
||||||
|
|
||||||
auto endFn = getRuntimeFunction(Loc(), irs->module, "_d_leave_cleanup");
|
auto endFn = getRuntimeFunction(Loc(), irs->module, "_d_leave_cleanup");
|
||||||
llvm::CallInst::Create(endFn, frame,
|
llvm::CallInst::Create(endFn, frame,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue