aboutsummaryrefslogtreecommitdiffstats
path: root/ExpressionCompiler.h
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-12-11 00:24:23 +0800
committerChristian <c@ethdev.com>2014-12-11 00:24:23 +0800
commit8b54d1afb2b3ad897330258367b2ce67c8a56940 (patch)
treeafa0085f16b7a46cdf2681626d3fa898830ef2a3 /ExpressionCompiler.h
parent373f0da2675f298984f265672d7414a58c061512 (diff)
parent3c377f77bbe75e65159e79a61696ba906ac22bda (diff)
downloaddexon-solidity-8b54d1afb2b3ad897330258367b2ce67c8a56940.tar.gz
dexon-solidity-8b54d1afb2b3ad897330258367b2ce67c8a56940.tar.zst
dexon-solidity-8b54d1afb2b3ad897330258367b2ce67c8a56940.zip
Merge remote-tracking branch 'ethereum/develop' into sol_strings
Conflicts: libsolidity/Types.cpp
Diffstat (limited to 'ExpressionCompiler.h')
-rw-r--r--ExpressionCompiler.h26
1 files changed, 11 insertions, 15 deletions
diff --git a/ExpressionCompiler.h b/ExpressionCompiler.h
index 386a7116..32822248 100644
--- a/ExpressionCompiler.h
+++ b/ExpressionCompiler.h
@@ -42,11 +42,11 @@ class StaticStringType;
* of EVM instructions. It needs a compiler context that is the same for the whole compilation
* unit.
*/
-class ExpressionCompiler: private ASTVisitor
+class ExpressionCompiler: private ASTConstVisitor
{
public:
/// Compile the given @a _expression into the @a _context.
- static void compileExpression(CompilerContext& _context, Expression& _expression);
+ static void compileExpression(CompilerContext& _context, Expression const& _expression);
/// Appends code to remove dirty higher order bits in case of an implicit promotion to a wider type.
static void appendTypeConversion(CompilerContext& _context, Type const& _typeOnStack, Type const& _targetType);
@@ -55,18 +55,18 @@ private:
ExpressionCompiler(CompilerContext& _compilerContext):
m_context(_compilerContext), m_currentLValue(m_context) {}
- virtual bool visit(Assignment& _assignment) override;
- virtual void endVisit(UnaryOperation& _unaryOperation) override;
- virtual bool visit(BinaryOperation& _binaryOperation) override;
- virtual bool visit(FunctionCall& _functionCall) override;
- virtual void endVisit(MemberAccess& _memberAccess) override;
- virtual bool visit(IndexAccess& _indexAccess) override;
- virtual void endVisit(Identifier& _identifier) override;
- virtual void endVisit(Literal& _literal) override;
+ virtual bool visit(Assignment const& _assignment) override;
+ virtual void endVisit(UnaryOperation const& _unaryOperation) override;
+ virtual bool visit(BinaryOperation const& _binaryOperation) override;
+ virtual bool visit(FunctionCall const& _functionCall) override;
+ virtual void endVisit(MemberAccess const& _memberAccess) override;
+ virtual bool visit(IndexAccess const& _indexAccess) override;
+ virtual void endVisit(Identifier const& _identifier) override;
+ virtual void endVisit(Literal const& _literal) override;
///@{
///@name Append code for various operator types
- void appendAndOrOperatorCode(BinaryOperation& _binaryOperation);
+ void appendAndOrOperatorCode(BinaryOperation const& _binaryOperation);
void appendCompareOperatorCode(Token::Value _operator, Type const& _type);
void appendOrdinaryBinaryOperatorCode(Token::Value _operator, Type const& _type);
@@ -135,10 +135,6 @@ private:
CompilerContext& m_context;
LValue m_currentLValue;
- /// If a "virtual" function (i.e. a bulit-in function without jump tag) is encountered, the
- /// actual function is stored here. @todo prevent assignment or store it with assignment
- enum class SpecialFunction { NONE, SEND, SHA3, SUICIDE, ECRECOVER, SHA256, RIPEMD160 };
- SpecialFunction m_currentSpecialFunction;
};