aboutsummaryrefslogtreecommitdiffstats
path: root/libyul/AsmScope.h
diff options
context:
space:
mode:
Diffstat (limited to 'libyul/AsmScope.h')
-rw-r--r--libyul/AsmScope.h28
1 files changed, 11 insertions, 17 deletions
diff --git a/libyul/AsmScope.h b/libyul/AsmScope.h
index 12c05716..2a8ef49e 100644
--- a/libyul/AsmScope.h
+++ b/libyul/AsmScope.h
@@ -32,16 +32,12 @@
#include <functional>
#include <memory>
-namespace dev
-{
-namespace solidity
-{
-namespace assembly
+namespace yul
{
struct Scope
{
- using YulType = yul::YulString;
+ using YulType = YulString;
using LabelID = size_t;
struct Variable { YulType type; };
@@ -53,13 +49,13 @@ struct Scope
};
using Identifier = boost::variant<Variable, Label, Function>;
- using Visitor = GenericVisitor<Variable const, Label const, Function const>;
- using NonconstVisitor = GenericVisitor<Variable, Label, Function>;
+ using Visitor = dev::GenericVisitor<Variable const, Label const, Function const>;
+ using NonconstVisitor = dev::GenericVisitor<Variable, Label, Function>;
- bool registerVariable(yul::YulString _name, YulType const& _type);
- bool registerLabel(yul::YulString _name);
+ bool registerVariable(YulString _name, YulType const& _type);
+ bool registerLabel(YulString _name);
bool registerFunction(
- yul::YulString _name,
+ YulString _name,
std::vector<YulType> const& _arguments,
std::vector<YulType> const& _returns
);
@@ -69,12 +65,12 @@ struct Scope
/// will any lookups across assembly boundaries.
/// The pointer will be invalidated if the scope is modified.
/// @param _crossedFunction if true, we already crossed a function boundary during recursive lookup
- Identifier* lookup(yul::YulString _name);
+ Identifier* lookup(YulString _name);
/// Looks up the identifier in this and super scopes (will not find variables across function
/// boundaries and generally stops at assembly boundaries) and calls the visitor, returns
/// false if not found.
template <class V>
- bool lookup(yul::YulString _name, V const& _visitor)
+ bool lookup(YulString _name, V const& _visitor)
{
if (Identifier* id = lookup(_name))
{
@@ -86,7 +82,7 @@ struct Scope
}
/// @returns true if the name exists in this scope or in super scopes (also searches
/// across function and assembly boundaries).
- bool exists(yul::YulString _name) const;
+ bool exists(YulString _name) const;
/// @returns the number of variables directly registered inside the scope.
size_t numberOfVariables() const;
@@ -97,9 +93,7 @@ struct Scope
/// If true, variables from the super scope are not visible here (other identifiers are),
/// but they are still taken into account to prevent shadowing.
bool functionScope = false;
- std::map<yul::YulString, Identifier> identifiers;
+ std::map<YulString, Identifier> identifiers;
};
}
-}
-}