diff options
Diffstat (limited to 'src/passes/SignatureRefining.cpp')
-rw-r--r-- | src/passes/SignatureRefining.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/passes/SignatureRefining.cpp b/src/passes/SignatureRefining.cpp index 132079b76..15b89b2a7 100644 --- a/src/passes/SignatureRefining.cpp +++ b/src/passes/SignatureRefining.cpp @@ -161,7 +161,7 @@ struct SignatureRefining : public Pass { auto updateLUBs = [&](const ExpressionList& operands) { for (Index i = 0; i < numParams; i++) { - paramLUBs[i].noteUpdatableExpression(operands[i]); + paramLUBs[i].note(operands[i]->type); } }; @@ -178,7 +178,7 @@ struct SignatureRefining : public Pass { if (!lub.noted()) { break; } - newParamsTypes.push_back(lub.getBestPossible()); + newParamsTypes.push_back(lub.getLUB()); } Type newParams; if (newParamsTypes.size() < numParams) { @@ -197,7 +197,7 @@ struct SignatureRefining : public Pass { // value, or it can return a value but traps instead etc.). newResults = func->getResults(); } else { - newResults = resultsLUB.getBestPossible(); + newResults = resultsLUB.getLUB(); } if (newParams == func->getParams() && newResults == func->getResults()) { @@ -207,14 +207,7 @@ struct SignatureRefining : public Pass { // We found an improvement! newSignatures[type] = Signature(newParams, newResults); - // Update nulls as necessary, now that we are changing things. - if (newParams != func->getParams()) { - for (auto& lub : paramLUBs) { - lub.updateNulls(); - } - } if (newResults != func->getResults()) { - resultsLUB.updateNulls(); refinedResults = true; // Update the types of calls using the signature. |