diff options
author | chriseth <chris@ethereum.org> | 2017-04-26 21:41:08 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2017-04-26 23:12:04 +0800 |
commit | f3ec2ba39e7f4b85d148a7b696ef5af499fbb6fb (patch) | |
tree | be9367a377cd81badbac4bbf6bdf5377586823b3 /libsolidity/inlineasm/AsmAnalysis.h | |
parent | 68218387cf29b3ce7de72aa0348e68dbdae29751 (diff) | |
download | dexon-solidity-f3ec2ba39e7f4b85d148a7b696ef5af499fbb6fb.tar.gz dexon-solidity-f3ec2ba39e7f4b85d148a7b696ef5af499fbb6fb.tar.zst dexon-solidity-f3ec2ba39e7f4b85d148a7b696ef5af499fbb6fb.zip |
Refactor to combined scope and stack height info.
Diffstat (limited to 'libsolidity/inlineasm/AsmAnalysis.h')
-rw-r--r-- | libsolidity/inlineasm/AsmAnalysis.h | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/libsolidity/inlineasm/AsmAnalysis.h b/libsolidity/inlineasm/AsmAnalysis.h index 8256ed3c..426ee0d2 100644 --- a/libsolidity/inlineasm/AsmAnalysis.h +++ b/libsolidity/inlineasm/AsmAnalysis.h @@ -50,8 +50,7 @@ struct FunctionCall; struct Scope; -using Statement = boost::variant<Instruction, Literal, Label, Assignment, Identifier, FunctionalAssignment, FunctionCall, FunctionalInstruction, VariableDeclaration, FunctionDefinition, Block>; -using StackHeightInfo = std::map<assembly::Statement const*, int>; +struct AsmAnalysisInfo; /** * Performs the full analysis stage, calls the ScopeFiller internally, then resolves @@ -61,12 +60,10 @@ using StackHeightInfo = std::map<assembly::Statement const*, int>; class AsmAnalyzer: public boost::static_visitor<bool> { public: - using Scopes = std::map<assembly::Block const*, std::shared_ptr<Scope>>; AsmAnalyzer( - Scopes& _scopes, + AsmAnalysisInfo& _analysisInfo, ErrorList& _errors, - ExternalIdentifierAccess::Resolver const& _resolver = ExternalIdentifierAccess::Resolver(), - StackHeightInfo* _stackHeightInfo = nullptr + ExternalIdentifierAccess::Resolver const& _resolver = ExternalIdentifierAccess::Resolver() ); bool analyze(assembly::Block const& _block); @@ -88,7 +85,6 @@ private: /// as the value, @a _valueSize, unless that is equal to -1. bool checkAssignment(assembly::Identifier const& _assignment, size_t _valueSize = size_t(-1)); bool expectDeposit(int _deposit, int _oldHeight, SourceLocation const& _location); - void storeStackHeight(assembly::Statement const& _statement); Scope& scope(assembly::Block const* _block); /// This is used when we enter the body of a function definition. There, the parameters @@ -98,9 +94,8 @@ private: int m_stackHeight = 0; ExternalIdentifierAccess::Resolver const& m_resolver; Scope* m_currentScope = nullptr; - Scopes& m_scopes; + AsmAnalysisInfo& m_info; ErrorList& m_errors; - StackHeightInfo* m_stackHeightInfo; }; } |