Move "return" basic block after all other function blocks.
This commit is contained in:
parent
6cc3189787
commit
1079e41143
@ -966,6 +966,12 @@ pub mod llvm {
|
||||
-> BasicBlockRef;
|
||||
#[fast_ffi]
|
||||
pub unsafe fn LLVMDeleteBasicBlock(BB: BasicBlockRef);
|
||||
|
||||
#[fast_ffi]
|
||||
pub unsafe fn LLVMMoveBasicBlockAfter(BB: BasicBlockRef, MoveAfter: BasicBlockRef);
|
||||
|
||||
#[fast_ffi]
|
||||
pub unsafe fn LLVMMoveBasicBlockBefore(BB: BasicBlockRef, MoveBefore: BasicBlockRef);
|
||||
|
||||
/* Operations on instructions */
|
||||
#[fast_ffi]
|
||||
|
@ -1907,6 +1907,8 @@ pub fn trans_closure(ccx: @mut CrateContext,
|
||||
|
||||
finish(bcx);
|
||||
cleanup_and_Br(bcx, bcx_top, fcx.llreturn);
|
||||
|
||||
unsafe { llvm::LLVMMoveBasicBlockAfter(fcx.llreturn, bcx.llbb); }
|
||||
|
||||
// Insert the mandatory first few basic blocks before lltop.
|
||||
finish_fn(fcx, lltop);
|
||||
|
Loading…
Reference in New Issue
Block a user