aboutsummaryrefslogtreecommitdiffstats
path: root/Types.h
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-02-09 07:14:13 +0800
committerchriseth <c@ethdev.com>2015-02-09 07:14:13 +0800
commita66db516fb1025b406c8fcdb694b7fb760f84695 (patch)
tree269aaf7b54e7e75fc0c76854502926b366b22e44 /Types.h
parent5c58aa041d06e7e640f12c0060d18947ac5e8952 (diff)
parentafe1d9a592446dd403b9ed349529098b71309756 (diff)
downloaddexon-solidity-a66db516fb1025b406c8fcdb694b7fb760f84695.tar
dexon-solidity-a66db516fb1025b406c8fcdb694b7fb760f84695.tar.gz
dexon-solidity-a66db516fb1025b406c8fcdb694b7fb760f84695.tar.bz2
dexon-solidity-a66db516fb1025b406c8fcdb694b7fb760f84695.tar.lz
dexon-solidity-a66db516fb1025b406c8fcdb694b7fb760f84695.tar.xz
dexon-solidity-a66db516fb1025b406c8fcdb694b7fb760f84695.tar.zst
dexon-solidity-a66db516fb1025b406c8fcdb694b7fb760f84695.zip
Merge pull request #937 from LefterisJP/sol_MultiArgSHA3
Solidity multiple arg sha3
Diffstat (limited to 'Types.h')
-rw-r--r--Types.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/Types.h b/Types.h
index fcc77fea..7118f746 100644
--- a/Types.h
+++ b/Types.h
@@ -130,6 +130,8 @@ public:
/// i.e. it behaves differently in lvalue context and in value context.
virtual bool isValueType() const { return false; }
virtual unsigned getSizeOnStack() const { return 1; }
+ /// @returns the real type of some types, like e.g: IntegerConstant
+ virtual TypePointer getRealType() const { return shared_from_this(); }
/// Returns the list of all members of this type. Default implementation: no members.
virtual MemberList const& getMembers() const { return EmptyMemberList; }
@@ -140,7 +142,7 @@ public:
virtual u256 literalValue(Literal const*) const
{
BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Literal value requested "
- "for type without literals."));
+ "for type without literals."));
}
protected:
@@ -175,6 +177,7 @@ public:
virtual MemberList const& getMembers() const { return isAddress() ? AddressMemberList : EmptyMemberList; }
virtual std::string toString() const override;
+ virtual TypePointer getRealType() const { return std::make_shared<IntegerType>(m_bits, m_modifier); }
int getNumBits() const { return m_bits; }
bool isHash() const { return m_modifier == Modifier::HASH || m_modifier == Modifier::ADDRESS; }
@@ -213,6 +216,7 @@ public:
virtual std::string toString() const override;
virtual u256 literalValue(Literal const* _literal) const override;
+ virtual TypePointer getRealType() const override;
/// @returns the smallest integer type that can hold the value or an empty pointer if not possible.
std::shared_ptr<IntegerType const> getIntegerType() const;
@@ -244,6 +248,7 @@ public:
virtual std::string toString() const override { return "string" + dev::toString(m_bytes); }
virtual u256 literalValue(Literal const* _literal) const override;
+ virtual TypePointer getRealType() const override { return std::make_shared<StaticStringType>(m_bytes); }
int getNumBytes() const { return m_bytes; }