summaryrefslogtreecommitdiff
path: root/src/binaryen-c.h
diff options
context:
space:
mode:
authorMax Graey <maxgraey@gmail.com>2022-07-29 07:15:35 +0300
committerGitHub <noreply@github.com>2022-07-29 04:15:35 +0000
commitd02c260619e5d068b6893d4948de0487d0f1f66d (patch)
treebeba5a15fb0ace5bd34a4135efecc54deb754bc6 /src/binaryen-c.h
parent0cd9fb599fc5a44df7774d5f180d912ccab8c941 (diff)
downloadbinaryen-d02c260619e5d068b6893d4948de0487d0f1f66d.tar.gz
binaryen-d02c260619e5d068b6893d4948de0487d0f1f66d.tar.bz2
binaryen-d02c260619e5d068b6893d4948de0487d0f1f66d.zip
[JS Api] Reuse C-Api for emitText and emitStackIR (#4832)
Make the C API match the JS API and fix an old bug where extra newlines were emitted.
Diffstat (limited to 'src/binaryen-c.h')
-rw-r--r--src/binaryen-c.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/binaryen-c.h b/src/binaryen-c.h
index f7825b080..4f74eef4e 100644
--- a/src/binaryen-c.h
+++ b/src/binaryen-c.h
@@ -2363,7 +2363,8 @@ BINARYEN_API BinaryenModuleRef BinaryenModuleParse(const char* text);
BINARYEN_API void BinaryenModulePrint(BinaryenModuleRef module);
// Print a module to stdout in stack IR text format. Useful for debugging.
-BINARYEN_API void BinaryenModulePrintStackIR(BinaryenModuleRef module);
+BINARYEN_API void BinaryenModulePrintStackIR(BinaryenModuleRef module,
+ bool optimize);
// Print a module to stdout in asm.js syntax.
BINARYEN_API void BinaryenModulePrintAsmjs(BinaryenModuleRef module);
@@ -2504,7 +2505,8 @@ BINARYEN_API size_t BinaryenModuleWriteText(BinaryenModuleRef module,
// outputSize
BINARYEN_API size_t BinaryenModuleWriteStackIR(BinaryenModuleRef module,
char* output,
- size_t outputSize);
+ size_t outputSize,
+ bool optimize);
typedef struct BinaryenBufferSizes {
size_t outputBytes;
@@ -2550,7 +2552,7 @@ BINARYEN_API char* BinaryenModuleAllocateAndWriteText(BinaryenModuleRef module);
// char* with malloc(), and expects the user to free() them manually
// once not needed anymore.
BINARYEN_API char*
-BinaryenModuleAllocateAndWriteStackIR(BinaryenModuleRef module);
+BinaryenModuleAllocateAndWriteStackIR(BinaryenModuleRef module, bool optimize);
// Deserialize a module from binary form.
BINARYEN_API BinaryenModuleRef BinaryenModuleRead(char* input,