summaryrefslogtreecommitdiff
path: root/src/passes/Inlining.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/passes/Inlining.cpp')
-rw-r--r--src/passes/Inlining.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/passes/Inlining.cpp b/src/passes/Inlining.cpp
index 44ebbd54d..d0a69ea96 100644
--- a/src/passes/Inlining.cpp
+++ b/src/passes/Inlining.cpp
@@ -48,6 +48,7 @@ struct FunctionInfo {
Index size;
bool hasCalls;
bool hasLoops;
+ bool hasTryDelegate;
bool usedGlobally; // in a table or export
FunctionInfo() {
@@ -55,11 +56,16 @@ struct FunctionInfo {
size = 0;
hasCalls = false;
hasLoops = false;
+ hasTryDelegate = false;
usedGlobally = false;
}
// See pass.h for how defaults for these options were chosen.
bool worthInlining(PassOptions& options) {
+ // Until we have proper support for try-delegate, ignore such functions.
+ if (hasTryDelegate) {
+ return false;
+ }
// If it's small enough that we always want to inline such things, do so.
if (size <= options.inlining.alwaysInlineMaxSize) {
return true;
@@ -113,6 +119,12 @@ struct FunctionInfoScanner
(*infos)[getFunction()->name].hasCalls = true;
}
+ void visitTry(Try* curr) {
+ if (curr->isDelegate()) {
+ (*infos)[getFunction()->name].hasTryDelegate = true;
+ }
+ }
+
void visitRefFunc(RefFunc* curr) {
assert(infos->count(curr->func) > 0);
(*infos)[curr->func].refs++;