diff options
author | chriseth <c@ethdev.com> | 2015-04-15 23:40:50 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-04-15 23:40:50 +0800 |
commit | 0c69d5fdcd3286f47c81dbcbcfb8802861eab8b5 (patch) | |
tree | f78c665e6084300b939cc4cfcebb97d3bd44d9f5 /CompilerContext.h | |
parent | 158795e48f4285d713b11f78cdd04de8c6d1f667 (diff) | |
download | dexon-solidity-0c69d5fdcd3286f47c81dbcbcfb8802861eab8b5.tar.gz dexon-solidity-0c69d5fdcd3286f47c81dbcbcfb8802861eab8b5.tar.zst dexon-solidity-0c69d5fdcd3286f47c81dbcbcfb8802861eab8b5.zip |
Fixed function overloads.
Added tests, disallowed non-calling usage of non-unique function
references.
Diffstat (limited to 'CompilerContext.h')
-rw-r--r-- | CompilerContext.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/CompilerContext.h b/CompilerContext.h index 87f90d4c..67dd3c94 100644 --- a/CompilerContext.h +++ b/CompilerContext.h @@ -63,9 +63,9 @@ public: void setInheritanceHierarchy(std::vector<ContractDefinition const*> const& _hierarchy) { m_inheritanceHierarchy = _hierarchy; } /// @returns the entry label of the given function and takes overrides into account. eth::AssemblyItem getVirtualFunctionEntryLabel(FunctionDefinition const& _function); - /// @returns the entry label of function with the given name from the most derived class just + /// @returns the entry label of a function that overrides the given declaration from the most derived class just /// above _base in the current inheritance hierarchy. - eth::AssemblyItem getSuperFunctionEntryLabel(std::string const& _name, ContractDefinition const& _base); + eth::AssemblyItem getSuperFunctionEntryLabel(FunctionDefinition const& _function, ContractDefinition const& _base); FunctionDefinition const* getNextConstructor(ContractDefinition const& _contract) const; /// @returns the set of functions for which we still need to generate code @@ -136,6 +136,13 @@ public: }; private: + /// @returns the entry label of the given function - searches the inheritance hierarchy + /// startig from the given point towards the base. + eth::AssemblyItem getVirtualFunctionEntryLabel( + FunctionDefinition const& _function, + std::vector<ContractDefinition const*>::const_iterator _searchStart + ); + /// @returns an iterator to the contract directly above the given contract. std::vector<ContractDefinition const*>::const_iterator getSuperContract(const ContractDefinition &_contract) const; /// Updates source location set in the assembly. void updateSourceLocation(); |