C++ namespace cleanup (except tests).

This commit is contained in:
Christian Parpart
2020-01-07 15:51:50 +01:00
committed by Daniel Kirchner
parent 8385256bdc
commit 6b23412fae
403 changed files with 1656 additions and 1926 deletions
+6 -6
View File
@@ -30,8 +30,8 @@
#include <variant>
using namespace std;
using namespace yul;
using namespace dev;
using namespace solidity;
using namespace solidity::yul;
bool KnowledgeBase::knownToBeDifferent(YulString _a, YulString _b)
{
@@ -39,11 +39,11 @@ bool KnowledgeBase::knownToBeDifferent(YulString _a, YulString _b)
// current values to turn `sub(_a, _b)` into a nonzero constant.
// If that fails, try `eq(_a, _b)`.
Expression expr1 = simplify(FunctionCall{{}, {{}, "sub"_yulstring}, make_vector<Expression>(Identifier{{}, _a}, Identifier{{}, _b})});
Expression expr1 = simplify(FunctionCall{{}, {{}, "sub"_yulstring}, util::make_vector<Expression>(Identifier{{}, _a}, Identifier{{}, _b})});
if (holds_alternative<Literal>(expr1))
return valueOfLiteral(std::get<Literal>(expr1)) != 0;
Expression expr2 = simplify(FunctionCall{{}, {{}, "eq"_yulstring}, make_vector<Expression>(Identifier{{}, _a}, Identifier{{}, _b})});
Expression expr2 = simplify(FunctionCall{{}, {{}, "eq"_yulstring}, util::make_vector<Expression>(Identifier{{}, _a}, Identifier{{}, _b})});
if (holds_alternative<Literal>(expr2))
return valueOfLiteral(std::get<Literal>(expr2)) == 0;
@@ -55,7 +55,7 @@ bool KnowledgeBase::knownToBeDifferentByAtLeast32(YulString _a, YulString _b)
// Try to use the simplification rules together with the
// current values to turn `sub(_a, _b)` into a constant whose absolute value is at least 32.
Expression expr1 = simplify(FunctionCall{{}, {{}, "sub"_yulstring}, make_vector<Expression>(Identifier{{}, _a}, Identifier{{}, _b})});
Expression expr1 = simplify(FunctionCall{{}, {{}, "sub"_yulstring}, util::make_vector<Expression>(Identifier{{}, _a}, Identifier{{}, _b})});
if (holds_alternative<Literal>(expr1))
{
u256 val = valueOfLiteral(std::get<Literal>(expr1));
@@ -68,7 +68,7 @@ bool KnowledgeBase::knownToBeDifferentByAtLeast32(YulString _a, YulString _b)
Expression KnowledgeBase::simplify(Expression _expression)
{
bool startedRecursion = (m_recursionCounter == 0);
dev::ScopeGuard{[&] { if (startedRecursion) m_recursionCounter = 0; }};
ScopeGuard{[&] { if (startedRecursion) m_recursionCounter = 0; }};
if (startedRecursion)
m_recursionCounter = 100;