mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Do not overwrite allowMSizeOptimization
This commit is contained in:
@@ -119,15 +119,13 @@ void UnusedPruner::operator()(Block& _block)
|
||||
void UnusedPruner::runUntilStabilised(
|
||||
Dialect const& _dialect,
|
||||
Block& _ast,
|
||||
bool _allowMSizeOptization,
|
||||
bool _allowMSizeOptimization,
|
||||
set<YulString> const& _externallyUsedFunctions
|
||||
)
|
||||
{
|
||||
_allowMSizeOptization = !SideEffectsCollector(_dialect, _ast).containsMSize();
|
||||
|
||||
while (true)
|
||||
{
|
||||
UnusedPruner pruner(_dialect, _ast, _allowMSizeOptization, _externallyUsedFunctions);
|
||||
UnusedPruner pruner(_dialect, _ast, _allowMSizeOptimization, _externallyUsedFunctions);
|
||||
pruner(_ast);
|
||||
if (!pruner.shouldRunAgain())
|
||||
return;
|
||||
|
||||
@@ -34,6 +34,11 @@ struct Dialect;
|
||||
* Optimisation stage that removes unused variables and functions and also
|
||||
* removes side-effect-free expression statements.
|
||||
*
|
||||
* If msize is used, we cannot remove any statements that access memory.
|
||||
* Because of that, the Unused Pruner should only be invoked on full ASTs,
|
||||
* such that it can check for the presence of msize itself, or
|
||||
* the `_allowMSizeOptimization` needs to be passed.
|
||||
*
|
||||
* Note that this does not remove circular references.
|
||||
*
|
||||
* Prerequisite: Disambiguator
|
||||
@@ -64,7 +69,7 @@ public:
|
||||
static void runUntilStabilised(
|
||||
Dialect const& _dialect,
|
||||
Block& _ast,
|
||||
bool _allowMSizeOptization,
|
||||
bool _allowMSizeOptimization,
|
||||
std::set<YulString> const& _externallyUsedFunctions = {}
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user