From 7d4d502500bfd22a0a4e9c1762b1bddccbe14c1c Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Fri, 22 Sep 2023 10:37:33 -0700 Subject: Support function contexts in IRBuilder (#5967) Add a `visitFunctionStart` function to IRBuilder and make it responsible for setting the function's body when the context is closed. This will simplify outlining, will be necessary to support branches to function scope properly, and removes an extra block around function bodies in the new wat parser. --- src/parser/context-defs.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/parser/context-defs.cpp') diff --git a/src/parser/context-defs.cpp b/src/parser/context-defs.cpp index b43b7049f..76e61d4fb 100644 --- a/src/parser/context-defs.cpp +++ b/src/parser/context-defs.cpp @@ -57,9 +57,6 @@ Result<> ParseDefsCtx::addFunc(Name, std::optional, Index pos) { CHECK_ERR(withLoc(pos, irBuilder.visitEnd())); - auto body = irBuilder.build(); - CHECK_ERR(withLoc(pos, body)); - wasm.functions[index]->body = *body; return Ok{}; } -- cgit v1.2.3