diff options
author | chriseth <chris@ethereum.org> | 2017-05-16 22:59:15 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-16 22:59:15 +0800 |
commit | d9b5ff0b43b4dcaccb43dfc89efef6d610476557 (patch) | |
tree | 5773b307c4a612562bd05abd2c8d71009cc53372 /libsolidity/inlineasm/AsmScope.h | |
parent | 2ba87fe80486e996a3fbcfe79da2ab527c1ee406 (diff) | |
parent | 6706932d7c7cd0a4d1b99e806b8f80cf8fe6cb91 (diff) | |
download | dexon-solidity-d9b5ff0b43b4dcaccb43dfc89efef6d610476557.tar dexon-solidity-d9b5ff0b43b4dcaccb43dfc89efef6d610476557.tar.gz dexon-solidity-d9b5ff0b43b4dcaccb43dfc89efef6d610476557.tar.bz2 dexon-solidity-d9b5ff0b43b4dcaccb43dfc89efef6d610476557.tar.lz dexon-solidity-d9b5ff0b43b4dcaccb43dfc89efef6d610476557.tar.xz dexon-solidity-d9b5ff0b43b4dcaccb43dfc89efef6d610476557.tar.zst dexon-solidity-d9b5ff0b43b4dcaccb43dfc89efef6d610476557.zip |
Merge pull request #2222 from ethereum/julia-types
Add support for types in Julia
Diffstat (limited to 'libsolidity/inlineasm/AsmScope.h')
-rw-r--r-- | libsolidity/inlineasm/AsmScope.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/libsolidity/inlineasm/AsmScope.h b/libsolidity/inlineasm/AsmScope.h index b70bee67..dd45613d 100644 --- a/libsolidity/inlineasm/AsmScope.h +++ b/libsolidity/inlineasm/AsmScope.h @@ -61,6 +61,8 @@ struct GenericVisitor<>: public boost::static_visitor<> { struct Scope { + using JuliaType = std::string; + struct Variable { /// Used during code generation to store the stack height. @todo move there. @@ -68,6 +70,7 @@ struct Scope /// Used during analysis to check whether we already passed the declaration inside the block. /// @todo move there. bool active = false; + JuliaType type; }; struct Label @@ -78,18 +81,22 @@ struct Scope struct Function { - Function(size_t _arguments, size_t _returns): arguments(_arguments), returns(_returns) {} - size_t arguments = 0; - size_t returns = 0; + Function(std::vector<JuliaType> const& _arguments, std::vector<JuliaType> const& _returns): arguments(_arguments), returns(_returns) {} + std::vector<JuliaType> arguments; + std::vector<JuliaType> returns; }; using Identifier = boost::variant<Variable, Label, Function>; using Visitor = GenericVisitor<Variable const, Label const, Function const>; using NonconstVisitor = GenericVisitor<Variable, Label, Function>; - bool registerVariable(std::string const& _name); + bool registerVariable(std::string const& _name, JuliaType const& _type); bool registerLabel(std::string const& _name); - bool registerFunction(std::string const& _name, size_t _arguments, size_t _returns); + bool registerFunction( + std::string const& _name, + std::vector<JuliaType> const& _arguments, + std::vector<JuliaType> const& _returns + ); /// Looks up the identifier in this or super scopes and returns a valid pointer if found /// or a nullptr if not found. Variable lookups up across function boundaries will fail, as |