[llvmonly] Simplify the handling of init_bb a bit.
authorZoltan Varga <vargaz@gmail.com>
Mon, 12 Oct 2015 20:20:13 +0000 (16:20 -0400)
committerZoltan Varga <vargaz@gmail.com>
Mon, 12 Oct 2015 21:10:18 +0000 (17:10 -0400)
mono/mini/mini-llvm.c

index 226f15c3083fb8e9d5d507d48f348ca20c4c2b62..af0bfff97c8dd3e15672c211ef2653370bac663a 100644 (file)
@@ -150,7 +150,6 @@ typedef struct {
        GSList **nested_in;
        LLVMValueRef ex_var;
        GHashTable *exc_meta;
-       LLVMBasicBlockRef entry_out_bb;
 } EmitContext;
 
 typedef struct {
@@ -2499,7 +2498,7 @@ emit_init_method (EmitContext *ctx)
        LLVMBuildStore (builder, LLVMConstInt (LLVMInt8Type (), 1, FALSE), LLVMBuildGEP (builder, ctx->lmodule->inited_var, indexes, 2, ""));
 
        LLVMBuildBr (builder, inited_bb);
-       ctx->entry_out_bb = inited_bb;
+       ctx->bblocks [cfg->bb_entry->block_num].end_bblock = inited_bb;
 
        builder = ctx->builder = create_builder (ctx);
        LLVMPositionBuilderAtEnd (ctx->builder, inited_bb);
@@ -3610,10 +3609,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
        LLVMValueRef lhs, rhs;
        int nins = 0;
 
-       if (bb == cfg->bb_entry && ctx->entry_out_bb)
-               cbb = ctx->entry_out_bb;
-       else
-               cbb = get_bb (ctx, bb);
+       cbb = get_end_bb (ctx, bb);
 
        builder = create_builder (ctx);
        ctx->builder = builder;