diff options
author | Lefteris Karapetsas <lefteris@refu.co> | 2015-01-23 00:40:22 +0800 |
---|---|---|
committer | Lefteris Karapetsas <lefteris@refu.co> | 2015-01-29 04:46:16 +0800 |
commit | 3cc04923015cc3f40ad285fba5ed71464bd9ff2a (patch) | |
tree | 5d32036c4a1aa893348af4e907f8b1453bd4b3e3 /CompilerContext.h | |
parent | 9759eec2da1d75c70b8cd3eff3fe1bffade6854d (diff) | |
download | dexon-solidity-3cc04923015cc3f40ad285fba5ed71464bd9ff2a.tar.gz dexon-solidity-3cc04923015cc3f40ad285fba5ed71464bd9ff2a.tar.zst dexon-solidity-3cc04923015cc3f40ad285fba5ed71464bd9ff2a.zip |
Work in progress for state variable accessors
- Changed the code so that a generic declaration with the combination of
a function type can be used wherer a function definition was used
before
- Since using an std::pair everywhere is really tiring with this commit
I am in the process of abstracting it into a function
Diffstat (limited to 'CompilerContext.h')
-rw-r--r-- | CompilerContext.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/CompilerContext.h b/CompilerContext.h index d82dfe51..aa438cf0 100644 --- a/CompilerContext.h +++ b/CompilerContext.h @@ -58,7 +58,7 @@ public: bool isLocalVariable(Declaration const* _declaration) const; bool isStateVariable(Declaration const* _declaration) const { return m_stateVariables.count(_declaration) != 0; } - eth::AssemblyItem getFunctionEntryLabel(FunctionDefinition const& _function) const; + eth::AssemblyItem getFunctionEntryLabel(Declaration const& _declaration) const; /// @returns the entry label of the given function and takes overrides into account. eth::AssemblyItem getVirtualFunctionEntryLabel(FunctionDefinition const& _function) const; ModifierDefinition const& getFunctionModifier(std::string const& _name) const; @@ -115,9 +115,12 @@ private: u256 m_stateVariablesSize = 0; /// Storage offsets of state variables std::map<Declaration const*, u256> m_stateVariables; - /// Positions of local variables on the stack. + /// Offsets of local variables on the stack (relative to stack base). std::map<Declaration const*, unsigned> m_localVariables; - /// Labels pointing to the entry points of funcitons. + /// Sum of stack sizes of local variables + unsigned m_localVariablesSize; + /// Labels pointing to the entry points of functions. + std::map<Declaration const*, eth::AssemblyItem> m_functionEntryLabels; /// Labels pointing to the entry points of function overrides. std::map<std::string, eth::AssemblyItem> m_virtualFunctionEntryLabels; |