mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Update to let inlining
This commit is contained in:
parent
bbd7ef447f
commit
4101c67cba
@ -484,8 +484,8 @@ namespace
|
||||
SMTLib2Expression & operator[](std::string const& varName)
|
||||
{
|
||||
auto it = bindings.find(varName);
|
||||
assert(it != bindings.end());
|
||||
assert(!it->second.empty());
|
||||
solAssert(it != bindings.end());
|
||||
solAssert(!it->second.empty());
|
||||
return it->second.back();
|
||||
}
|
||||
|
||||
@ -529,14 +529,14 @@ namespace
|
||||
auto const& atom = asAtom(expr);
|
||||
if (bindings.has(atom))
|
||||
expr = bindings[atom];
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
auto& subexprs = asSubExpressions(expr);
|
||||
assert(!subexprs.empty());
|
||||
solAssert(!subexprs.empty());
|
||||
auto const& first = subexprs.at(0);
|
||||
if (isAtom(first) && asAtom(first) == "let")
|
||||
{
|
||||
solAssert(subexprs.size() >= 3);
|
||||
solAssert(!isAtom(subexprs[1]));
|
||||
auto& bindingExpressions = asSubExpressions(subexprs[1]);
|
||||
// process new bindings
|
||||
@ -551,7 +551,7 @@ namespace
|
||||
newBindings.emplace_back(asAtom(bindingPair.at(0)), bindingPair.at(1));
|
||||
}
|
||||
bindings.pushScope();
|
||||
for (auto&& [name, expr] : newBindings)
|
||||
for (auto&& [name, expr]: newBindings)
|
||||
bindings.addBinding(std::move(name), std::move(expr));
|
||||
newBindings.clear();
|
||||
|
||||
@ -571,7 +571,6 @@ namespace
|
||||
inlineLetExpressions(subexpr, bindings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void inlineLetExpressions(SMTLib2Expression& expr)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user