diff options
author | Daniel Wirtz <dcode@dcode.io> | 2020-02-08 00:52:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-07 15:52:15 -0800 |
commit | 2b77f6ae60cfaf3f3cbdcc4121e82a619b9372c3 (patch) | |
tree | 0992863a82cc06d6cb591e4b2a32867b927f472d /src/binaryen-c.h | |
parent | 2119f3fcc32c58d581d7c86b7612e3bc89da24e0 (diff) | |
download | binaryen-2b77f6ae60cfaf3f3cbdcc4121e82a619b9372c3.tar.gz binaryen-2b77f6ae60cfaf3f3cbdcc4121e82a619b9372c3.tar.bz2 binaryen-2b77f6ae60cfaf3f3cbdcc4121e82a619b9372c3.zip |
Add C-/JS-APIs for lowMemoryUnused and pass arguments (#2639)
Allows a user to enable/disable the `lowMemoryUnused` option and to get/set/clear arbitrary pass arguments when using the C- or JS-APIs.
* binaryen.**getLowMemoryUnused**(): `boolean`
* binaryen.**setLowMemoryUnused**(on: `boolean`): `void`
* binaryen.**getPassArgument**(key: `string`): `string | null`
* binaryen.**setPassArgument**(key: `string`, value: `string | null`): `void`
* binaryen.**clearPassArguments**(): `void`
Diffstat (limited to 'src/binaryen-c.h')
-rw-r--r-- | src/binaryen-c.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/binaryen-c.h b/src/binaryen-c.h index 0a9a70f4d..66a68e8d2 100644 --- a/src/binaryen-c.h +++ b/src/binaryen-c.h @@ -1284,6 +1284,26 @@ BINARYEN_API int BinaryenGetDebugInfo(void); // Applies to all modules, globally. BINARYEN_API void BinaryenSetDebugInfo(int on); +// Gets whether the low 1K of memory can be considered unused when optimizing. +// Applies to all modules, globally. +BINARYEN_API int BinaryenGetLowMemoryUnused(void); + +// Enables or disables whether the low 1K of memory can be considered unused +// when optimizing. Applies to all modules, globally. +BINARYEN_API void BinaryenSetLowMemoryUnused(int on); + +// Gets the value of the specified arbitrary pass argument. +// Applies to all modules, globally. +BINARYEN_API const char* BinaryenGetPassArgument(const char* name); + +// Sets the value of the specified arbitrary pass argument. Removes the +// respective argument if `value` is NULL. Applies to all modules, globally. +BINARYEN_API void BinaryenSetPassArgument(const char* name, const char* value); + +// Clears all arbitrary pass arguments. +// Applies to all modules, globally. +BINARYEN_API void BinaryenClearPassArguments(); + // Runs the specified passes on the module. Uses the currently set global // optimize and shrink level. BINARYEN_API void BinaryenModuleRunPasses(BinaryenModuleRef module, |