summaryrefslogtreecommitdiff
path: root/src/wasm.h
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2023-12-06 15:25:16 -0800
committerGitHub <noreply@github.com>2023-12-06 15:25:16 -0800
commitf722171f73732c6852cc4d283cc006ca56142ebf (patch)
treefa0c80c4488c4fcde03e63772d1d057bf965ae8d /src/wasm.h
parent66277f9b767cb1b45ce12b77109c2538b6cb9c12 (diff)
downloadbinaryen-f722171f73732c6852cc4d283cc006ca56142ebf.tar.gz
binaryen-f722171f73732c6852cc4d283cc006ca56142ebf.tar.bz2
binaryen-f722171f73732c6852cc4d283cc006ca56142ebf.zip
Add no-inline IR annotation, and passes to set it based on function name (#6146)
Any function can now be annotated as not to be inlined fully (normally) or not to be inlined partially. In the future we'll want to read those annotations from the proposed wasm metadata section on code hints, and from wat text as well, but for now add trivial passes that set those fields based on function name wildcards, e.g.: --no-inline=*leave-alone* --inlining That will not inline any function whose name contains "leave-alone" in the name. --no-inline disables all inlining (full or partial) while --no-full-inline and --no-partial-inline affect only full or partial inlining.
Diffstat (limited to 'src/wasm.h')
-rw-r--r--src/wasm.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/wasm.h b/src/wasm.h
index a7a2e0b1e..24138c99d 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -2072,6 +2072,12 @@ public:
delimiterLocations;
BinaryLocations::FunctionLocations funcLocation;
+ // Inlining metadata: whether to disallow full and/or partial inlining (for
+ // details on what those mean, see Inlining.cpp).
+ bool noFullInline = false;
+ bool noPartialInline = false;
+
+ // Methods
Signature getSig() { return type.getSignature(); }
Type getParams() { return getSig().params; }
Type getResults() { return getSig().results; }