summaryrefslogtreecommitdiff
path: root/src/binaryen-c.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/binaryen-c.cpp')
-rw-r--r--src/binaryen-c.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/binaryen-c.cpp b/src/binaryen-c.cpp
index 53daef977..4dd306bd3 100644
--- a/src/binaryen-c.cpp
+++ b/src/binaryen-c.cpp
@@ -226,6 +226,23 @@ BinaryenFunctionTypeRef BinaryenAddFunctionType(BinaryenModuleRef module, const
return ret;
}
+void BinaryenRemoveFunctionType(BinaryenModuleRef module, const char* name) {
+ if (tracing) {
+ std::cout << " BinaryenRemoveFunctionType(the_module, ";
+ traceNameOrNULL(name);
+ std::cout << ");\n";
+ }
+
+ auto* wasm = (Module*)module;
+ assert(name != NULL);
+
+ // Lock. This can be called from multiple threads at once, and is a
+ // point where they all access and modify the module.
+ {
+ std::lock_guard<std::mutex> lock(BinaryenFunctionTypeMutex);
+ wasm->removeFunctionType(name);
+ }
+}
BinaryenLiteral BinaryenLiteralInt32(int32_t x) { return toBinaryenLiteral(Literal(x)); }
BinaryenLiteral BinaryenLiteralInt64(int64_t x) { return toBinaryenLiteral(Literal(x)); }