[opengtl-commits] [335] build++ in release mode |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/opengtl-commits Archives
]
Revision: 335
Author: cyrille
Date: 2008-08-31 16:50:35 +0200 (Sun, 31 Aug 2008)
Log Message:
-----------
build++ in release mode
Modified Paths:
--------------
trunk/OpenGTL/OpenGTL/GTLCore/AST/BinaryExpression.cpp
trunk/OpenGTL/OpenGTL/GTLCore/CodeGenerator_p.cpp
trunk/OpenGTL/OpenGTL/GTLCore/Debug.h
Modified: trunk/OpenGTL/OpenGTL/GTLCore/AST/BinaryExpression.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/AST/BinaryExpression.cpp 2008-08-31 14:35:47 UTC (rev 334)
+++ trunk/OpenGTL/OpenGTL/GTLCore/AST/BinaryExpression.cpp 2008-08-31 14:50:35 UTC (rev 335)
@@ -46,6 +46,7 @@
const GTLCore::Type* type1 = m_lhs->type();
const GTLCore::Type* type2 = m_rhs->type();
GTL_ASSERT( type1 == type2 );
+ UNUSED(type2);
return type1;
}
Modified: trunk/OpenGTL/OpenGTL/GTLCore/CodeGenerator_p.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/CodeGenerator_p.cpp 2008-08-31 14:35:47 UTC (rev 334)
+++ trunk/OpenGTL/OpenGTL/GTLCore/CodeGenerator_p.cpp 2008-08-31 14:50:35 UTC (rev 335)
@@ -41,24 +41,21 @@
#define UNIFORMIZE_TYPES( _v1_, _v2_) \
GTL_ASSERT( _v1_.value() ); \
GTL_ASSERT( _v2_.value() ); \
- const Type* highestPriorityType = Type::Private::selectType( lhsType, rhsType); \
- GTL_ASSERT( highestPriorityType ); \
+ GTL_CHECK_EQUAL( lhsType, rhsType); \
GTLCore::ExpressionResult v1 = _v1_; \
GTLCore::ExpressionResult v2 = _v2_; \
GTL_ASSERT( v1.value() ); \
GTL_ASSERT( v2.value() );
#define UNIFORMIZE_VALUE_TYPES( _v1_, _v2_ ) \
- const Type* highestPriorityType = Type::Private::selectType( lhsType, rhsType); \
- GTL_ASSERT( highestPriorityType ); \
+ GTL_CHECK_EQUAL( lhsType, rhsType ); \
llvm::Value* v1 = _v1_; \
llvm::Value* v2 = _v2_; \
GTL_ASSERT( v1 ); \
GTL_ASSERT( v2 );
#define UNIFORMIZE_CONSTANT_TYPES( _v1_, _v2_ ) \
- const Type* highestPriorityType = Type::Private::selectType( lhsType, rhsType); \
- GTL_ASSERT( highestPriorityType ); \
+ GTL_CHECK_EQUAL( lhsType, rhsType ); \
llvm::Constant* v1 = _v1_; \
llvm::Constant* v2 = _v2_; \
GTL_ASSERT( v1 ); \
@@ -328,9 +325,9 @@
#define CREATE_BINARY_OPERATOR( _creator_, _v1_, _v2_) \
if( _v1_.isConstant() and _v2_.isConstant() ) \
{ \
- return GTLCore::ExpressionResult( _creator_(_v1_.constant(), lhsType, _v2_.constant(), rhsType ), highestPriorityType); \
+ return GTLCore::ExpressionResult( _creator_(_v1_.constant(), lhsType, _v2_.constant(), rhsType ), lhsType); \
} else { \
- return GTLCore::ExpressionResult( _creator_( currentBlock, _v1_.value(), lhsType, _v2_.value(), rhsType ), highestPriorityType); \
+ return GTLCore::ExpressionResult( _creator_( currentBlock, _v1_.value(), lhsType, _v2_.value(), rhsType ), lhsType); \
}
#define CREATE_BINARY_EXPRESSION(_GTL_Function_Name_, _LLVM_Constant_Expr_, _LLVM_Binary_Operator ) \
@@ -364,8 +361,8 @@
{
UNIFORMIZE_VALUE_TYPES( lhs, rhs );
if( v1->getType()->isFloatingPoint()
- or ( highestPriorityType->dataType() == GTLCore::Type::VECTOR
- and highestPriorityType->embeddedType()->dataType() == GTLCore::Type::FLOAT ) )
+ or ( lhsType->dataType() == GTLCore::Type::VECTOR
+ and lhsType->embeddedType()->dataType() == GTLCore::Type::FLOAT ) )
{
return llvm::BinaryOperator::createFDiv(v1, v2, "", currentBlock );
} else {
Modified: trunk/OpenGTL/OpenGTL/GTLCore/Debug.h
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/Debug.h 2008-08-31 14:35:47 UTC (rev 334)
+++ trunk/OpenGTL/OpenGTL/GTLCore/Debug.h 2008-08-31 14:50:35 UTC (rev 335)
@@ -84,11 +84,23 @@
{ \
GTL_ABORT( "Assertion failed: " << #assrt ); \
}
+#define GTL_CHECK_PTR(ptr) \
+ if( not (assrt ) ) \
+ { \
+ GTL_ABORT( "Null pointer: " << #ptr ); \
+ }
+#define GTL_CHECK_EQUAL(val1, val2) \
+ if( val1 != val2 ) \
+ { \
+ GTL_ABORT( #val1 << " != " << #val2 ); \
+ }
#else
#define GTL_DEBUG(msg)
#define GTL_ASSERT(assrt)
+#define GTL_CHECK_PTR(ptr) (void)ptr;
+#define GTL_CHECK_EQUAL(val1, val2) (void)val1; (void)val2;
#endif