[opengtl-commits] [147] delete rhs and lhs expressions in binary/unary |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/opengtl-commits Archives
]
Revision: 147
Author: cyrille
Date: 2008-04-29 10:42:47 +0200 (Tue, 29 Apr 2008)
Log Message:
-----------
delete rhs and lhs expressions in binary/unary
Modified Paths:
--------------
trunk/OpenGTL/OpenGTL/GTLCore/AST/BinaryExpression.cpp
trunk/OpenGTL/OpenGTL/GTLCore/AST/BinaryExpression.h
trunk/OpenGTL/OpenGTL/GTLCore/AST/UnaryExpression.cpp
trunk/OpenGTL/OpenGTL/GTLCore/AST/UnaryExpression.h
Modified: trunk/OpenGTL/OpenGTL/GTLCore/AST/BinaryExpression.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/AST/BinaryExpression.cpp 2008-04-29 08:35:41 UTC (rev 146)
+++ trunk/OpenGTL/OpenGTL/GTLCore/AST/BinaryExpression.cpp 2008-04-29 08:42:47 UTC (rev 147)
@@ -27,7 +27,13 @@
using namespace GTLCore::AST;
+BinaryExpression::~BinaryExpression()
+{
+ delete m_lhs;
+ delete m_rhs;
+}
+
const GTLCore::Type* BinaryExpression::type() const
{
const GTLCore::Type* type1 = m_lhs->type();
Modified: trunk/OpenGTL/OpenGTL/GTLCore/AST/BinaryExpression.h
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/AST/BinaryExpression.h 2008-04-29 08:35:41 UTC (rev 146)
+++ trunk/OpenGTL/OpenGTL/GTLCore/AST/BinaryExpression.h 2008-04-29 08:42:47 UTC (rev 147)
@@ -34,6 +34,7 @@
class BinaryExpression : public Expression {
public:
BinaryExpression( Expression* lhs, Expression* rhs) : m_lhs(lhs), m_rhs(rhs) {}
+ ~BinaryExpression();
int priority();
Expression* leftHandSide() { return m_lhs; }
const Expression* leftHandSide() const { return m_lhs; }
Modified: trunk/OpenGTL/OpenGTL/GTLCore/AST/UnaryExpression.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/AST/UnaryExpression.cpp 2008-04-29 08:35:41 UTC (rev 146)
+++ trunk/OpenGTL/OpenGTL/GTLCore/AST/UnaryExpression.cpp 2008-04-29 08:42:47 UTC (rev 147)
@@ -24,6 +24,12 @@
using namespace GTLCore::AST;
+UnaryExpression::~UnaryExpression()
+{
+ delete m_rhs;
+}
+
+
GTLCore::ExpressionResult MinusUnaryExpression::generateValue( GenerationContext& _gc, llvm::BasicBlock* bb ) const
{
return _gc.codeGenerator()->createMinusExpression( bb, rightHandSide()->generateValue( _gc, bb) );
Modified: trunk/OpenGTL/OpenGTL/GTLCore/AST/UnaryExpression.h
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/AST/UnaryExpression.h 2008-04-29 08:35:41 UTC (rev 146)
+++ trunk/OpenGTL/OpenGTL/GTLCore/AST/UnaryExpression.h 2008-04-29 08:42:47 UTC (rev 147)
@@ -34,6 +34,7 @@
class UnaryExpression : public Expression {
public:
explicit UnaryExpression(Expression* rhs) : m_rhs(rhs) {}
+ ~UnaryExpression();
virtual const GTLCore::Type* type() const { return m_rhs->type(); }
virtual bool isConstant() const { return m_rhs->isConstant(); }
const Expression* rightHandSide() const { return m_rhs; }