diff options
author | Gav Wood <i@gavwood.com> | 2015-01-16 03:03:35 +0800 |
---|---|---|
committer | Gav Wood <i@gavwood.com> | 2015-01-16 03:03:35 +0800 |
commit | a9ed77c22a03271c93ab70b8fcd58363c5e78ab0 (patch) | |
tree | 4dbe1c48ff4948e8750071a7627506f3076c8b63 /Types.h | |
parent | 911916beb7d8fd9c318d43fdf137727d364a95d2 (diff) | |
parent | c6a47a4dc2e6b5a9fb03e8282b6b3ef108fdcbcb (diff) | |
download | dexon-solidity-a9ed77c22a03271c93ab70b8fcd58363c5e78ab0.tar dexon-solidity-a9ed77c22a03271c93ab70b8fcd58363c5e78ab0.tar.gz dexon-solidity-a9ed77c22a03271c93ab70b8fcd58363c5e78ab0.tar.bz2 dexon-solidity-a9ed77c22a03271c93ab70b8fcd58363c5e78ab0.tar.lz dexon-solidity-a9ed77c22a03271c93ab70b8fcd58363c5e78ab0.tar.xz dexon-solidity-a9ed77c22a03271c93ab70b8fcd58363c5e78ab0.tar.zst dexon-solidity-a9ed77c22a03271c93ab70b8fcd58363c5e78ab0.zip |
Merge branch 'develop' of github.com:ethereum/cpp-ethereum into develop
Conflicts:
libsolidity/Types.h
Diffstat (limited to 'Types.h')
-rw-r--r-- | Types.h | 29 |
1 files changed, 24 insertions, 5 deletions
@@ -291,6 +291,8 @@ public: virtual MemberList const& getMembers() const override; + ContractDefinition const& getContractDefinition() const { return m_contract; } + /// Returns the function type of the constructor. Note that the location part of the function type /// is not used, as this type cannot be the type of a variable or expression. std::shared_ptr<FunctionType const> const& getConstructorType() const; @@ -345,10 +347,15 @@ class FunctionType: public Type { public: /// The meaning of the value(s) on the stack referencing the function: - /// INTERNAL: jump tag, EXTERNAL: contract address + function index, + /// INTERNAL: jump tag, EXTERNAL: contract address + function identifier, /// BARE: contract address (non-abi contract call) /// OTHERS: special virtual function, nothing on the stack - enum class Location { INTERNAL, EXTERNAL, SEND, SHA3, SUICIDE, ECRECOVER, SHA256, RIPEMD160, LOG0, LOG1, LOG2, LOG3, LOG4, BLOCKHASH, BARE }; + enum class Location { INTERNAL, EXTERNAL, CREATION, SEND, + SHA3, SUICIDE, + ECRECOVER, SHA256, RIPEMD160, + LOG0, LOG1, LOG2, LOG3, LOG4, + SET_GAS, SET_VALUE, BLOCKHASH + BARE }; virtual Category getCategory() const override { return Category::FUNCTION; } explicit FunctionType(FunctionDefinition const& _function, bool _isInternal = true); @@ -357,9 +364,10 @@ public: FunctionType(parseElementaryTypeVector(_parameterTypes), parseElementaryTypeVector(_returnParameterTypes), _location) {} FunctionType(TypePointers const& _parameterTypes, TypePointers const& _returnParameterTypes, - Location _location = Location::INTERNAL): + Location _location = Location::INTERNAL, + bool _gasSet = false, bool _valueSet = false): m_parameterTypes(_parameterTypes), m_returnParameterTypes(_returnParameterTypes), - m_location(_location) {} + m_location(_location), m_gasSet(_gasSet), m_valueSet(_valueSet) {} TypePointers const& getParameterTypes() const { return m_parameterTypes; } TypePointers const& getReturnParameterTypes() const { return m_returnParameterTypes; } @@ -370,16 +378,27 @@ public: virtual u256 getStorageSize() const override { BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Storage size of non-storable function type requested.")); } virtual bool canLiveOutsideStorage() const override { return false; } virtual unsigned getSizeOnStack() const override; + virtual MemberList const& getMembers() const override; Location const& getLocation() const { return m_location; } std::string getCanonicalSignature() const; + bool gasSet() const { return m_gasSet; } + bool valueSet() const { return m_valueSet; } + + /// @returns a copy of this type, where gas or value are set manually. This will never set one + /// of the parameters to fals. + TypePointer copyAndSetGasOrValue(bool _setGas, bool _setValue) const; + private: static TypePointers parseElementaryTypeVector(strings const& _types); TypePointers m_parameterTypes; TypePointers m_returnParameterTypes; - Location m_location; + Location const m_location; + bool const m_gasSet = false; ///< true iff the gas value to be used is on the stack + bool const m_valueSet = false; ///< true iff the value to be sent is on the stack + mutable std::unique_ptr<MemberList> m_members; }; /** |