Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: Update to libbinaryen v115 #90

Merged
merged 6 commits into from
Nov 2, 2023
Merged

feat!: Update to libbinaryen v115 #90

merged 6 commits into from
Nov 2, 2023

Conversation

peblair
Copy link
Member

@peblair peblair commented Oct 24, 2023

binaryen-c.h diff:

diff --git a/src/binaryen-c.h b/src/binaryen-c.h
index 07c116aec..f4f4f2d74 100644
--- a/src/binaryen-c.h
+++ b/src/binaryen-c.h
@@ -230,7 +230,7 @@ BINARYEN_API BinaryenFeatures BinaryenFeatureMemory64(void);
 BINARYEN_API BinaryenFeatures BinaryenFeatureRelaxedSIMD(void);
 BINARYEN_API BinaryenFeatures BinaryenFeatureExtendedConst(void);
 BINARYEN_API BinaryenFeatures BinaryenFeatureStrings(void);
-BINARYEN_API BinaryenFeatures BinaryenFeatureMultiMemories(void);
+BINARYEN_API BinaryenFeatures BinaryenFeatureMultiMemory(void);
 BINARYEN_API BinaryenFeatures BinaryenFeatureAll(void);
 
 // Modules
@@ -2723,6 +2723,15 @@ BinaryenAddFunction(BinaryenModuleRef module,
                     BinaryenType* varTypes,
                     BinaryenIndex numVarTypes,
                     BinaryenExpressionRef body);
+// As BinaryenAddFunction, but takes a HeapType rather than params and results.
+// This lets you set the specific type of the function.
+BINARYEN_API BinaryenFunctionRef
+BinaryenAddFunctionWithHeapType(BinaryenModuleRef module,
+                                const char* name,
+                                BinaryenHeapType type,
+                                BinaryenType* varTypes,
+                                BinaryenIndex numVarTypes,
+                                BinaryenExpressionRef body);
 // Gets a function reference by name. Returns NULL if the function does not
 // exist.
 BINARYEN_API BinaryenFunctionRef BinaryenGetFunction(BinaryenModuleRef module,
@@ -3563,6 +3572,9 @@ BINARYEN_API BinaryenType TypeBuilderGetTempRefType(TypeBuilderRef builder,
 BINARYEN_API void TypeBuilderSetSubType(TypeBuilderRef builder,
                                         BinaryenIndex index,
                                         BinaryenHeapType superType);
+// Sets the type at `index` to be open (i.e. non-final).
+BINARYEN_API void TypeBuilderSetOpen(TypeBuilderRef builder,
+                                     BinaryenIndex index);
 // Creates a new recursion group in the range `index` inclusive to `index +
 // length` exclusive. Recursion groups must not overlap.
 BINARYEN_API void TypeBuilderCreateRecGroup(TypeBuilderRef builder,

passes/pass.cpp diff:

diff --git a/src/passes/pass.cpp b/src/passes/pass.cpp
index adaa42e04..0d47cd78e 100644
--- a/src/passes/pass.cpp
+++ b/src/passes/pass.cpp
@@ -187,6 +187,9 @@ void PassRegistry::registerPasses() {
                "information about what content can actually appear in each "
                "location",
                createGUFAPass);
+  registerPass("gufa-cast-all",
+               "GUFA plus add casts for all inferences",
+               createGUFACastAllPass);
   registerPass("gufa-optimizing",
                "GUFA plus local optimizations in functions we modified",
                createGUFAOptimizingPass);
@@ -375,6 +378,9 @@ void PassRegistry::registerPasses() {
   registerPass("remove-unused-types",
                "remove unused private GC types",
                createRemoveUnusedTypesPass);
+  registerPass("reorder-functions-by-name",
+               "sorts functions by name (useful for debugging)",
+               createReorderFunctionsByNamePass);
   registerPass("reorder-functions",
                "sorts functions by access frequency",
                createReorderFunctionsPass);

CMakeLists.txt diff:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8a008b514..df1719a75 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,7 +7,7 @@ cmake_minimum_required(VERSION 3.10.2)
 # to reduce this for compatability with emsdk.
 set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14" CACHE STRING "Minimum OS X deployment version")
 
-project(binaryen LANGUAGES C CXX VERSION 114)
+project(binaryen LANGUAGES C CXX VERSION 115)
 include(GNUInstallDirs)
 
 # The C++ standard whose features are required to build Binaryen.

@peblair peblair force-pushed the philip/update-v115 branch from 6fda162 to 77fabb8 Compare October 24, 2023 12:34
@peblair
Copy link
Member Author

peblair commented Oct 24, 2023

@phated For v115, I pointed the submodule to my fork in order to incorporate this commit (see failing emsdk build on c863d7f) as a patch. For v116, we should be able to revert back to the main WebAssembly/binaryen repository.

@phated
Copy link
Member

phated commented Oct 25, 2023

@peblair I thought I saw something about just updating the emsdk to build the newer versions of Binaryen—it's likely a new type in clang. We should do that instead of using your fork.

@peblair peblair force-pushed the philip/update-v115 branch from 9db2ef1 to 097c6d6 Compare October 26, 2023 10:32
@peblair
Copy link
Member Author

peblair commented Oct 26, 2023

@phated Yes, it looks like that worked.

@phated phated merged commit 4f4a03c into main Nov 2, 2023
@phated phated deleted the philip/update-v115 branch November 2, 2023 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants