From c78c330634997e5d8e2ec27db9e3d9cf50bae230 Mon Sep 17 00:00:00 2001 From: Christian Date: Sat, 6 Dec 2014 01:06:24 +0100 Subject: Const AST visitor for the compiler. --- ExpressionCompiler.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'ExpressionCompiler.h') diff --git a/ExpressionCompiler.h b/ExpressionCompiler.h index 83d7cdc6..5d4eec37 100644 --- a/ExpressionCompiler.h +++ b/ExpressionCompiler.h @@ -44,7 +44,7 @@ class ExpressionCompiler: private ASTVisitor { 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); @@ -53,18 +53,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); -- cgit From 13640d7db82562592958fcce2d7ce8155cc7ea35 Mon Sep 17 00:00:00 2001 From: Christian Date: Sat, 6 Dec 2014 02:19:10 +0100 Subject: Clear separation between ASTVisitor and ASTConstVisitor and more const specifiers. --- ExpressionCompiler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ExpressionCompiler.h') diff --git a/ExpressionCompiler.h b/ExpressionCompiler.h index 5d4eec37..e93d3280 100644 --- a/ExpressionCompiler.h +++ b/ExpressionCompiler.h @@ -40,7 +40,7 @@ class IntegerType; // forward * 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. -- cgit From e0ed942519fbf3a5be106fae2d1906b9c217df95 Mon Sep 17 00:00:00 2001 From: Christian Date: Sat, 6 Dec 2014 02:34:05 +0100 Subject: Removed unused members. --- ExpressionCompiler.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'ExpressionCompiler.h') diff --git a/ExpressionCompiler.h b/ExpressionCompiler.h index e93d3280..a02cddfc 100644 --- a/ExpressionCompiler.h +++ b/ExpressionCompiler.h @@ -132,10 +132,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; }; -- cgit