aboutsummaryrefslogtreecommitdiffstats
path: root/ExpressionCompiler.h
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2014-12-11 00:19:01 +0800
committerchriseth <c@ethdev.com>2014-12-11 00:19:01 +0800
commit3c377f77bbe75e65159e79a61696ba906ac22bda (patch)
tree84dc67e67200c4f7deccda8504f0c9294d071890 /ExpressionCompiler.h
parente8b7d266641175039d40c344449409a60527156e (diff)
parent9e120d45857506b2f448c2c18a688ff05b19009b (diff)
downloaddexon-solidity-3c377f77bbe75e65159e79a61696ba906ac22bda.tar.gz
dexon-solidity-3c377f77bbe75e65159e79a61696ba906ac22bda.tar.zst
dexon-solidity-3c377f77bbe75e65159e79a61696ba906ac22bda.zip
Merge pull request #577 from chriseth/sol_constCleanup
Solidity const cleanup
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 966be30e..41cb6676 100644
--- a/ExpressionCompiler.h
+++ b/ExpressionCompiler.h
@@ -41,11 +41,11 @@ class IntegerType;
* 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);
@@ -54,18 +54,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);
@@ -134,10 +134,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;
};