Skip to content

Commit 0c3028a

Browse files
committed
Add pass control options
1 parent beea696 commit 0c3028a

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

README.md

+45
Original file line numberDiff line numberDiff line change
@@ -411,12 +411,48 @@ API
411411
* **setDebugInfo**(on: `boolean`): `void`<br />
412412
Enables or disables debug information in emitted binaries.
413413

414+
* **getTrapsNeverHappen**(): `boolean`<br />
415+
Gets whether no traps can be considered reached at runtime when optimizing.
416+
417+
* **setTrapsNeverHappen**(on: `boolean`): `void`<br />
418+
Enables or disables whether no traps can be considered reached at runtime when optimizing.
419+
420+
* **getClosedWorld**(): `boolean`<br />
421+
Gets whether considering that the code outside of the module does not inspect or interact with GC and function references.
422+
423+
* **setClosedWorld**(on: `boolean`): `void`<br />
424+
Enables or disables whether considering that the code outside of the module does not inspect or interact with GC and function references.
425+
414426
* **getLowMemoryUnused**(): `boolean`<br />
415427
Gets whether the low 1K of memory can be considered unused when optimizing.
416428

417429
* **setLowMemoryUnused**(on: `boolean`): `void`<br />
418430
Enables or disables whether the low 1K of memory can be considered unused when optimizing.
419431

432+
* **getZeroFilledMemory**(): `boolean`<br />
433+
Gets whether an imported memory is considered zero-initialized.
434+
435+
* **setZeroFilledMemory**(on: `boolean`): `void`<br />
436+
Enables or disables whether an imported memory is considered zero-initialized.
437+
438+
* **getFastMath**(): `boolean`<br />
439+
Gets whether fast math optimizations are enabled, ignoring for example corner cases of floating-point math like NaN changes.
440+
441+
* **setFastMath**(on: `boolean`): `void`<br />
442+
Enables or disables fast math optimizations, ignoring for example corner cases of floating-point math like NaN changes.
443+
444+
* **getGenerateStackIR**(): `boolean`<br />
445+
Gets whether to generate StackIR during binary writing.
446+
447+
* **setGenerateStackIR**(on: `boolean`): `void`<br />
448+
Enable or disable StackIR generation during binary writing.
449+
450+
* **getOptimizeStackIR**(): `boolean`<br />
451+
Gets whether to optimize StackIR during binary writing.
452+
453+
* **setOptimizeStackIR**(on: `boolean`): `void`<br />
454+
Enable or disable StackIR optimisation during binary writing.
455+
420456
* **getPassArgument**(key: `string`): `string | null`<br />
421457
Gets the value of the specified arbitrary pass argument.
422458

@@ -426,6 +462,15 @@ API
426462
* **clearPassArguments**(): `void`<br />
427463
Clears all arbitrary pass arguments.
428464

465+
* **hasPassToSkip**(pass: `string`): `boolean`<br />
466+
Gets whether a pass is in the set of passes to skip.
467+
468+
* **addPassToSkip**(pass: `string`): `void`<br />
469+
Add a pass to the set of passes to skip.
470+
471+
* **clearPassesToSkip**(): `void`<br />
472+
Clears the set of passes to skip.
473+
429474
* **getAlwaysInlineMaxSize**(): `number`<br />
430475
Gets the function size at which we always inline.
431476

index.d.ts

+11
Original file line numberDiff line numberDiff line change
@@ -2285,15 +2285,26 @@ declare module binaryen {
22852285
function setShrinkLevel(level: number): number;
22862286
function getDebugInfo(): boolean;
22872287
function setDebugInfo(on: boolean): void;
2288+
function getTrapsNeverHappen(): boolean;
2289+
function setTrapsNeverHappen(on: boolean): void;
2290+
function getClosedWorld(): boolean;
2291+
function setClosedWorld(on: boolean): void;
22882292
function getLowMemoryUnused(): boolean;
22892293
function setLowMemoryUnused(on: boolean): void;
22902294
function getZeroFilledMemory(): boolean;
22912295
function setZeroFilledMemory(on: boolean): void;
22922296
function getFastMath(): boolean;
22932297
function setFastMath(on: boolean): void;
2298+
function getGenerateStackIR(): boolean;
2299+
function setGenerateStackIR(on: boolean): void;
2300+
function getOptimizeStackIR(): boolean;
2301+
function setOptimizeStackIR(on: boolean): void;
22942302
function getPassArgument(key: string): string | null;
22952303
function setPassArgument(key: string, value: string | null): void;
22962304
function clearPassArguments(): void;
2305+
function hasPassToSkip(pass: string): boolean;
2306+
function addPassToSkip(pass: string): void;
2307+
function clearPassesToSkip(): void;
22972308
function getAlwaysInlineMaxSize(): number;
22982309
function setAlwaysInlineMaxSize(size: number): void;
22992310
function getFlexibleInlineMaxSize(): number;

0 commit comments

Comments
 (0)