diff options
Diffstat (limited to 'libsolidity/inlineasm/AsmScope.h')
-rw-r--r-- | libsolidity/inlineasm/AsmScope.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/libsolidity/inlineasm/AsmScope.h b/libsolidity/inlineasm/AsmScope.h index fc674e71..65848018 100644 --- a/libsolidity/inlineasm/AsmScope.h +++ b/libsolidity/inlineasm/AsmScope.h @@ -22,6 +22,8 @@ #include <libsolidity/interface/Exceptions.h> +#include <libyul/YulString.h> + #include <libdevcore/Visitor.h> #include <boost/variant.hpp> @@ -39,7 +41,7 @@ namespace assembly struct Scope { - using YulType = std::string; + using YulType = yul::YulString; using LabelID = size_t; struct Variable { YulType type; }; @@ -54,10 +56,10 @@ struct Scope using Visitor = GenericVisitor<Variable const, Label const, Function const>; using NonconstVisitor = GenericVisitor<Variable, Label, Function>; - bool registerVariable(std::string const& _name, YulType const& _type); - bool registerLabel(std::string const& _name); + bool registerVariable(yul::YulString _name, YulType const& _type); + bool registerLabel(yul::YulString _name); bool registerFunction( - std::string const& _name, + yul::YulString _name, std::vector<YulType> const& _arguments, std::vector<YulType> const& _returns ); @@ -67,12 +69,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(std::string const& _name); + Identifier* lookup(yul::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(std::string const& _name, V const& _visitor) + bool lookup(yul::YulString _name, V const& _visitor) { if (Identifier* id = lookup(_name)) { @@ -84,7 +86,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(std::string const& _name) const; + bool exists(yul::YulString _name) const; /// @returns the number of variables directly registered inside the scope. size_t numberOfVariables() const; @@ -95,7 +97,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<std::string, Identifier> identifiers; + std::map<yul::YulString, Identifier> identifiers; }; } |