[opengtl-commits] [222] * fix while statement order of basic block

[ Thread Index | Date Index | More lists.tuxfamily.org/opengtl-commits Archives ]


Revision: 222
Author:   cyrille
Date:     2008-06-24 21:30:00 +0200 (Tue, 24 Jun 2008)

Log Message:
-----------
* fix while statement order of basic block
* fix modulo instruction, add it to hte current basic block

Modified Paths:
--------------
    trunk/OpenGTL/OpenGTL/GTLCore/CodeGenerator_p.cpp


Modified: trunk/OpenGTL/OpenGTL/GTLCore/CodeGenerator_p.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/CodeGenerator_p.cpp	2008-06-22 21:57:53 UTC (rev 221)
+++ trunk/OpenGTL/OpenGTL/GTLCore/CodeGenerator_p.cpp	2008-06-24 19:30:00 UTC (rev 222)
@@ -311,8 +311,8 @@
 void CodeGenerator::createWhileStatement( llvm::BasicBlock* before, llvm::BasicBlock* test, llvm::Value* testResult, const Type* testType, llvm::BasicBlock* firstAction, llvm::BasicBlock* lastAction,  llvm::BasicBlock* after)
 {
   new llvm::BranchInst( test, before);
-  new llvm::BranchInst( firstAction, after, convertValueTo( before, testResult, testType, GTLCore::Type::Boolean ), test);
-  new llvm::BranchInst( after, lastAction );
+  new llvm::BranchInst( firstAction, after, convertValueTo( test, testResult, testType, GTLCore::Type::Boolean ), test);
+  new llvm::BranchInst( test, lastAction );
 
 }
 
@@ -415,7 +415,7 @@
 llvm::Value* CodeGenerator::createModuloExpression(llvm::BasicBlock* currentBlock, llvm::Value* lhs, const Type* lhsType, llvm::Value* rhs, const Type* rhsType)
 {
   UNIFORMIZE_VALUE_TYPES( lhs, rhs );
-  return llvm::BinaryOperator::createSRem( v1, v2 );
+  return llvm::BinaryOperator::createSRem( v1, v2, "", currentBlock );
 }
 
 llvm::Constant* CodeGenerator::createModuloExpression( llvm::Constant* lhs, const Type* lhsType, llvm::Constant* rhs, const Type* rhsType)


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/