From a9fee5a35d0ac49d8a90c5fcbd5a8ac0506c3724 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 1 Feb 2016 15:02:37 -0800 Subject: use Return in asm2wasm --- src/asm2wasm.h | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'src') diff --git a/src/asm2wasm.h b/src/asm2wasm.h index 3dabdc471..d29c36a6e 100644 --- a/src/asm2wasm.h +++ b/src/asm2wasm.h @@ -772,7 +772,6 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) { }; bool seenReturn = false; // function->result is updated if we see a return - bool needTopmost = false; // we label the topmost b lock if we need one for a return // processors std::function processStatements; std::function processUnshifted; @@ -1182,9 +1181,7 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) { function->result = type; } // wasm has no return, so we just break on the topmost block - needTopmost = true; - auto ret = allocator.alloc(); - ret->name = TOPMOST; + auto ret = allocator.alloc(); ret->value = !!ast[1] ? process(ast[1]) : nullptr; return ret; } else if (what == BLOCK) { @@ -1469,16 +1466,6 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) { }; // body function->body = processStatements(body, start); - if (needTopmost) { - Block* topmost = function->body->dyn_cast(); - // if there's no block there, or there is a block but it already has a name, we need a new block. - if (!topmost || topmost->name.is()) { - topmost = allocator.alloc(); - topmost->list.push_back(function->body); - function->body = topmost; - } - topmost->name = TOPMOST; - } // cleanups/checks assert(breakStack.size() == 0 && continueStack.size() == 0); assert(parentLabel.isNull()); -- cgit v1.2.3