[opengtl-commits] [397] fix cleanup so that it works (tm), especially avoid double free when cleaning arrays and structures

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


Revision: 397
Author:   cyrille
Date:     2008-09-20 02:37:34 +0200 (Sat, 20 Sep 2008)

Log Message:
-----------
fix cleanup so that it works (tm), especially avoid double free when cleaning arrays and structures

Modified Paths:
--------------
    trunk/OpenGTL/OpenCTL/OpenCTL/Module.cpp
    trunk/OpenGTL/OpenCTL/OpenCTL/Module.h
    trunk/OpenGTL/OpenCTL/tests/complextypes/CMakeLists.txt
    trunk/OpenGTL/OpenGTL/GTLCore/AST/GarbageCollectionStatement.cpp
    trunk/OpenGTL/OpenGTL/GTLCore/AST/Statement.cpp
    trunk/OpenGTL/OpenGTL/GTLCore/VariableNG_p.cpp
    trunk/OpenGTL/OpenGTL/GTLCore/Visitor_p.cpp
    trunk/OpenGTL/OpenGTL/GTLCore/Visitor_p.h
    trunk/OpenGTL/OpenShiva/OpenShiva/PixelVisitor_p.cpp
    trunk/OpenGTL/OpenShiva/OpenShiva/PixelVisitor_p.h

Added Paths:
-----------
    trunk/OpenGTL/OpenCTL/tests/complextypes/returnarrayarray.ctl


Modified: trunk/OpenGTL/OpenCTL/OpenCTL/Module.cpp
===================================================================
--- trunk/OpenGTL/OpenCTL/OpenCTL/Module.cpp	2008-09-19 22:54:18 UTC (rev 396)
+++ trunk/OpenGTL/OpenCTL/OpenCTL/Module.cpp	2008-09-20 00:37:34 UTC (rev 397)
@@ -163,6 +163,11 @@
   return os.str();
 }
 
+GTLCore::String Module::cSourceCode() const
+{
+  return d->moduleData->asCCode();
+}
+
 std::list<GTLCore::Function*> Module::functions()
 {
   return d->moduleData->functions();

Modified: trunk/OpenGTL/OpenCTL/OpenCTL/Module.h
===================================================================
--- trunk/OpenGTL/OpenCTL/OpenCTL/Module.h	2008-09-19 22:54:18 UTC (rev 396)
+++ trunk/OpenGTL/OpenCTL/OpenCTL/Module.h	2008-09-20 00:37:34 UTC (rev 397)
@@ -100,6 +100,10 @@
        * @return the assembly source code, it's mostly usefull for testing purpose
        */
       GTLCore::String asmSourceCode() const;
+      /**
+       * @return the C source code, it's mostly usefull for testing purpose
+       */
+      GTLCore::String cSourceCode() const;
     private:
       struct Private;
       Private* const d;

Modified: trunk/OpenGTL/OpenCTL/tests/complextypes/CMakeLists.txt
===================================================================
--- trunk/OpenGTL/OpenCTL/tests/complextypes/CMakeLists.txt	2008-09-19 22:54:18 UTC (rev 396)
+++ trunk/OpenGTL/OpenCTL/tests/complextypes/CMakeLists.txt	2008-09-20 00:37:34 UTC (rev 397)
@@ -18,6 +18,7 @@
   returnstruct.ctl
   returnarray.ctl
   constarraynosize.ctl
+  returnarrayarray.ctl
   )
 
 FOREACH( TEST_FILE ${TESTS_FILES} )

Added: trunk/OpenGTL/OpenCTL/tests/complextypes/returnarrayarray.ctl
===================================================================
--- trunk/OpenGTL/OpenCTL/tests/complextypes/returnarrayarray.ctl	                        (rev 0)
+++ trunk/OpenGTL/OpenCTL/tests/complextypes/returnarrayarray.ctl	2008-09-20 00:37:34 UTC (rev 397)
@@ -0,0 +1,42 @@
+
+import "TestFramework";
+
+float[3][3] returnArray()
+{
+  float a[3][3];
+  for( int i = 0; i < 3; ++i )
+  {
+    for( int j = 0; j < 3; ++j )
+    {
+      a[i][j] = i + j;
+    }
+  }
+  return a;
+}
+
+int main()
+{
+  int errorcount = 0;
+  returnArray();
+  {
+    float arr[3][3] = returnArray();
+    for( int i = 0; i < 3; ++i )
+    {
+      for( int j = 0; j < 3; ++j )
+      {
+        Test::checkIntEqual( arr[i][j], i + j, errorcount );
+      }
+    }
+  }
+  {
+    float arr[][] = returnArray();
+    for( int i = 0; i < 3; ++i )
+    {
+      for( int j = 0; j < 3; ++j )
+      {
+        Test::checkIntEqual( arr[i][j], i + j, errorcount );
+      }
+    }
+  }
+  return errorcount;
+}

Modified: trunk/OpenGTL/OpenGTL/GTLCore/AST/GarbageCollectionStatement.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/AST/GarbageCollectionStatement.cpp	2008-09-19 22:54:18 UTC (rev 396)
+++ trunk/OpenGTL/OpenGTL/GTLCore/AST/GarbageCollectionStatement.cpp	2008-09-20 00:37:34 UTC (rev 397)
@@ -49,8 +49,7 @@
     llvm::Value* test = CodeGenerator::createStrictInferiorExpression( _currentBlock, countValue, Type::Integer32, CodeGenerator::integerToConstant( 1 ), Type::Integer32 );
     llvm::BasicBlock* first = createBlock( _generationContext );
     llvm::BasicBlock* after = createBlock( _generationContext );
-    llvm::BasicBlock* last = Visitor::getVisitorFor( m_type )->cleanUp( _generationContext, first, m_pointer, m_type, 0, true, false );
-    new llvm::FreeInst( m_pointer, last );
+    llvm::BasicBlock* last = Visitor::getVisitorFor( m_type )->cleanUp( _generationContext, first, m_pointer, m_type, 0, true, false, true );
     CodeGenerator::createIfStatement( _currentBlock, test, Type::Boolean, first, last, after);
     return after;
   } else {

Modified: trunk/OpenGTL/OpenGTL/GTLCore/AST/Statement.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/AST/Statement.cpp	2008-09-19 22:54:18 UTC (rev 396)
+++ trunk/OpenGTL/OpenGTL/GTLCore/AST/Statement.cpp	2008-09-20 00:37:34 UTC (rev 397)
@@ -209,6 +209,7 @@
 
 ReturnStatement::ReturnStatement( Expression* _returnExpr, AST::Statement* _garbageCollectionStatement ) : m_returnExpr( _returnExpr ), m_garbageCollectionStatement( _garbageCollectionStatement )
 {
+  GTL_ASSERT( m_garbageCollectionStatement );
   if( m_returnExpr )
   {
     m_returnExpr->markAsReturnExpression();
@@ -232,7 +233,7 @@
       _bb = Visitor::getVisitorFor( m_returnExpr->type() )->mark( _context, _bb, result.value(), m_returnExpr->type(), CodeGenerator::integerToConstant( 1 ) );
     }
     _bb = _context.flushDelayedStatement( _bb );
-//     _bb = m_garbageCollectionStatement->generateStatement( _context, _bb ); // FIXME uncomment
+    _bb = m_garbageCollectionStatement->generateStatement( _context, _bb );
     llvm::Value* resultValue = result.value();
     if( m_returnExpr->type()->dataType() != Type::ARRAY
         and m_returnExpr->type()->dataType() != Type::STRUCTURE )
@@ -246,7 +247,7 @@
     llvm::ReturnInst::Create( resultValue, _bb);
   } else {
     _bb = _context.flushDelayedStatement( _bb );
-//     _bb = m_garbageCollectionStatement->generateStatement( _context, _bb ); // FIXME uncomment
+    _bb = m_garbageCollectionStatement->generateStatement( _context, _bb );
     llvm::ReturnInst::Create( _bb );
   }
   return _bb;

Modified: trunk/OpenGTL/OpenGTL/GTLCore/VariableNG_p.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/VariableNG_p.cpp	2008-09-19 22:54:18 UTC (rev 396)
+++ trunk/OpenGTL/OpenGTL/GTLCore/VariableNG_p.cpp	2008-09-20 00:37:34 UTC (rev 397)
@@ -159,9 +159,7 @@
 {
   if( d->allocatedInMemory and not d->constantPointer )
   {
-    llvm::BasicBlock* bb = d->visitor->cleanUp( _generationContext, _currentBlock, pointer( _currentBlock), d->type, _donttouch, d->allocatedInMemory, true );
-    new llvm::FreeInst( pointer( _currentBlock ), bb);
-    return bb;
+    _currentBlock = d->visitor->cleanUp( _generationContext, _currentBlock, pointer( _currentBlock), d->type, _donttouch, d->allocatedInMemory, true, true );
   }
   return _currentBlock;
 }

Modified: trunk/OpenGTL/OpenGTL/GTLCore/Visitor_p.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/Visitor_p.cpp	2008-09-19 22:54:18 UTC (rev 396)
+++ trunk/OpenGTL/OpenGTL/GTLCore/Visitor_p.cpp	2008-09-20 00:37:34 UTC (rev 397)
@@ -126,7 +126,7 @@
   return _currentBlock;
 }
 
-llvm::BasicBlock* PrimitiveVisitor::cleanUp( GenerationContext& , llvm::BasicBlock* _currentBlock, llvm::Value* , const Type* , llvm::Value* , bool, bool /*_ignoreCount*/ ) const
+llvm::BasicBlock* PrimitiveVisitor::cleanUp( GenerationContext& , llvm::BasicBlock* _currentBlock, llvm::Value* , const Type* , llvm::Value* , bool, bool /*_ignoreCount*/, bool /*_deletePointer*/ ) const
 {
   return _currentBlock;
 }
@@ -171,7 +171,7 @@
       std::list<llvm::Value*> sizes;
       sizes.push_back( getSize( _generationContext, ifContent, _value ) );
       
-      llvm::BasicBlock* endIfContent = cleanUp(_generationContext, ifContent, _pointer, _pointerType, 0, _allocatedInMemory, true );
+      llvm::BasicBlock* endIfContent = cleanUp(_generationContext, ifContent, _pointer, _pointerType, 0, _allocatedInMemory, true, false );
       
       endIfContent = initialise( _generationContext, endIfContent, _pointer, _pointerType, sizes, _allocatedInMemory );
       
@@ -303,7 +303,7 @@
   return _currentBlock;
 }
 
-llvm::BasicBlock* ArrayVisitor::cleanUp( GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const Type* _pointerType, llvm::Value* _donttouch, bool _allocatedInMemory, bool _ignoreCount ) const
+llvm::BasicBlock* ArrayVisitor::cleanUp( GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const Type* _pointerType, llvm::Value* _donttouch, bool _allocatedInMemory, bool _ignoreCount, bool _deletePointer ) const
 {
   // TODO use _donttouch in the array as well
     //   int i = 0;
@@ -340,10 +340,7 @@
           _generationContext,
           bodyBlock, 
           _generationContext.codeGenerator()->accessArrayValue( bodyBlock, _pointer, index->get( _generationContext, bodyBlock  ) ),
-          _pointerType->embeddedType(), _donttouch, _allocatedInMemory, _ignoreCount );
-    std::vector<llvm::Value*> indexes;
-    indexes.push_back( llvm::ConstantInt::get(llvm::Type::Int32Ty, 0)); // Access the structure of the array
-    indexes.push_back( llvm::ConstantInt::get(llvm::Type::Int32Ty, ArrayWrap::POS_DATA )); // Access the data of the array
+          _pointerType->embeddedType(), _donttouch, _allocatedInMemory, _ignoreCount, false );
     // Create the for statement
     llvm::BasicBlock*  afterBlock = CodeGenerator::createIterationForStatement(
                     _generationContext,
@@ -353,9 +350,19 @@
                     Type::Integer32,
                     bodyBlock,
                     endBodyBlock );
-    // Free the array
-    llvm::Value* ptrToData = llvm::GetElementPtrInst::Create( _pointer, indexes.begin(), indexes.end(), "", afterBlock);
-    new llvm::FreeInst( new llvm::LoadInst( ptrToData, "", afterBlock ), afterBlock );
+    if( _allocatedInMemory )
+    {
+      std::vector<llvm::Value*> indexes;
+      indexes.push_back( llvm::ConstantInt::get(llvm::Type::Int32Ty, 0)); // Access the structure of the array
+      indexes.push_back( llvm::ConstantInt::get(llvm::Type::Int32Ty, ArrayWrap::POS_DATA )); // Access the data of the array
+      // Free the array
+      llvm::Value* ptrToData = llvm::GetElementPtrInst::Create( _pointer, indexes.begin(), indexes.end(), "", afterBlock);
+      new llvm::FreeInst( new llvm::LoadInst( ptrToData, "", afterBlock ), afterBlock );
+      if( _deletePointer )
+      {
+        new llvm::FreeInst( _pointer, afterBlock );
+      }
+    }
     
     llvm::BasicBlock* afterIfBlock = llvm::BasicBlock::Create("afterIfBlock");
     _generationContext.llvmFunction()->getBasicBlockList().push_back( afterIfBlock);
@@ -442,7 +449,7 @@
   return _currentBlock;
 }
 
-llvm::BasicBlock* VectorVisitor::cleanUp( GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const Type* _pointerType, llvm::Value* _donttouch, bool _allocatedInMemory, bool /*_ignoreCount*/ ) const
+llvm::BasicBlock* VectorVisitor::cleanUp( GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const Type* _pointerType, llvm::Value* _donttouch, bool _allocatedInMemory, bool /*_ignoreCount*/, bool /*_deletePointer*/ ) const
 {
   // Don't do nothing
   return _currentBlock;
@@ -526,7 +533,7 @@
   return _currentBlock;
 }
 
-llvm::BasicBlock* StructureVisitor::cleanUp( GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const Type* _pointerType, llvm::Value* _donttouch, bool _allocatedInMemory, bool _ignoreCount ) const
+llvm::BasicBlock* StructureVisitor::cleanUp( GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const Type* _pointerType, llvm::Value* _donttouch, bool _allocatedInMemory, bool _ignoreCount, bool _deletePointer ) const
 {
   // TODO use ignoreCount
 #ifndef NDEBUG
@@ -540,15 +547,30 @@
   }
 #endif
   if( _pointer == _donttouch ) return _currentBlock;
+  
+  llvm::Value* test = CodeGenerator::createStrictInferiorExpression( _currentBlock, CodeGenerator::getCountFieldOf( _currentBlock, _pointer), Type::Integer32, CodeGenerator::integerToConstant( 1 ), Type::Integer32 );
+  llvm::BasicBlock* firstIfBlock = llvm::BasicBlock::Create("firstIfBlockStructureVisitorCleanUp");
+  _generationContext.llvmFunction()->getBasicBlockList().push_back( firstIfBlock);
+  llvm::BasicBlock* lastIfBlock = firstIfBlock;
+  
   GTL_ASSERT( _pointerType->dataType() == Type::STRUCTURE );
   
   for( uint i = 0; i < _pointerType->countStructDataMembers(); ++i)
   {
     const Type* type = _pointerType->structDataMember(i).type();
     const Visitor* visitor = Visitor::getVisitorFor( type );
-    _currentBlock = visitor->cleanUp( _generationContext, _currentBlock, pointerToValue( _generationContext, _currentBlock, _pointer, i ), type, _donttouch, _allocatedInMemory, _ignoreCount );
+    lastIfBlock = visitor->cleanUp( _generationContext, lastIfBlock, pointerToValue( _generationContext, lastIfBlock, _pointer, i ), type, _donttouch, _allocatedInMemory, _ignoreCount, false );
   }
-  return _currentBlock;
+  
+  llvm::BasicBlock* afterIfBlock = llvm::BasicBlock::Create("afterIfBlockStructureVisitorCleanUp");
+  _generationContext.llvmFunction()->getBasicBlockList().push_back( afterIfBlock);
+  if( _allocatedInMemory and _deletePointer )
+  {
+    new llvm::FreeInst( _pointer, lastIfBlock );
+  }
+  CodeGenerator::createIfStatement( _currentBlock, test, Type::Boolean, firstIfBlock, lastIfBlock, afterIfBlock );
+  
+  return afterIfBlock;
 }
 
 llvm::BasicBlock* StructureVisitor::mark( GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const Type* _pointerType, llvm::Value* _increment ) const

Modified: trunk/OpenGTL/OpenGTL/GTLCore/Visitor_p.h
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/Visitor_p.h	2008-09-19 22:54:18 UTC (rev 396)
+++ trunk/OpenGTL/OpenGTL/GTLCore/Visitor_p.h	2008-09-20 00:37:34 UTC (rev 397)
@@ -93,7 +93,7 @@
        * @param _size the size of the array, if applicable
        */
       virtual llvm::BasicBlock* initialise(GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const Type* _pointerType, const std::list< llvm::Value*>& _sizes, bool _allocatedInMemory) const = 0;
-      virtual llvm::BasicBlock* cleanUp( GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const Type* _pointerType, llvm::Value* _donttouch, bool _allocatedInMemory, bool _ignoreCount ) const = 0;
+      virtual llvm::BasicBlock* cleanUp( GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const Type* _pointerType, llvm::Value* _donttouch, bool _allocatedInMemory, bool _ignoreCount, bool _deletePointer ) const = 0;
       virtual llvm::BasicBlock* mark( GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const Type* _pointerType, llvm::Value* increment ) const = 0;
     public:
       /**
@@ -117,7 +117,7 @@
                                 llvm::Value* pointer, const Type* _pointerType) const;
       virtual llvm::BasicBlock* set(GenerationContext& _generationContext, llvm::BasicBlock* currentBlock, llvm::Value* pointer, const Type* _pointerType, llvm::Value*, const Type* _valueType, bool _allocatedInMemory) const;
       virtual llvm::BasicBlock* initialise(GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const Type* _pointerType, const std::list< llvm::Value*>& _sizes, bool _allocatedInMemory) const;
-      virtual llvm::BasicBlock* cleanUp( GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const Type* _pointerType, llvm::Value* _donttouch, bool _allocatedInMemory, bool _ignoreCount ) const;
+      virtual llvm::BasicBlock* cleanUp( GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const Type* _pointerType, llvm::Value* _donttouch, bool _allocatedInMemory, bool _ignoreCount, bool _deletePointer ) const;
       virtual llvm::BasicBlock* mark( GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const Type* _pointerType, llvm::Value* increment ) const;
   };
   /**
@@ -135,7 +135,7 @@
       virtual ExpressionResult get( GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const Type* _pointerType) const;
       virtual llvm::BasicBlock* set(GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const Type* _pointerType, llvm::Value*, const Type* _valueType, bool _allocatedInMemory) const;
       virtual llvm::BasicBlock* initialise( GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const Type* _pointerType, const std::list< llvm::Value*>& _sizes, bool _allocatedInMemory) const;
-      virtual llvm::BasicBlock* cleanUp( GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const Type* _pointerType, llvm::Value* _donttouch, bool _allocatedInMemory, bool _ignoreCount ) const;
+      virtual llvm::BasicBlock* cleanUp( GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const Type* _pointerType, llvm::Value* _donttouch, bool _allocatedInMemory, bool _ignoreCount, bool _deletePointer ) const;
       virtual llvm::BasicBlock* mark( GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const Type* _pointerType, llvm::Value* increment ) const;
     private:
       /**
@@ -170,7 +170,7 @@
       virtual ExpressionResult get( GenerationContext& _generationContext, llvm::BasicBlock* currentBlock, llvm::Value* pointer, const Type* _pointerType) const;
       virtual llvm::BasicBlock* set(GenerationContext& _generationContext, llvm::BasicBlock* currentBlock, llvm::Value* pointer, const Type* _pointerType, llvm::Value*, const Type* _valueType, bool _allocatedInMemory) const;
       virtual llvm::BasicBlock* initialise( GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const Type* _pointerType, const std::list< llvm::Value*>& _sizes, bool _allocatedInMemory) const;
-      virtual llvm::BasicBlock* cleanUp( GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const Type* _pointerType, llvm::Value* _donttouch, bool _allocatedInMemory, bool _ignoreCount ) const;
+      virtual llvm::BasicBlock* cleanUp( GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const Type* _pointerType, llvm::Value* _donttouch, bool _allocatedInMemory, bool _ignoreCount, bool _deletePointer ) const;
       virtual llvm::BasicBlock* mark( GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const Type* _pointerType, llvm::Value* increment ) const;
   };
 
@@ -188,7 +188,7 @@
       virtual ExpressionResult get( GenerationContext& _generationContext, llvm::BasicBlock* currentBlock, llvm::Value* pointer, const Type* _pointerType) const;
       virtual llvm::BasicBlock* set(GenerationContext& _generationContext, llvm::BasicBlock* currentBlock, llvm::Value* pointer, const Type* _pointerType, llvm::Value*, const Type* _valueType, bool _allocatedInMemory) const;
       virtual llvm::BasicBlock* initialise( GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const Type* _pointerType, const std::list< llvm::Value*>& _sizes, bool _allocatedInMemory) const;
-      virtual llvm::BasicBlock* cleanUp( GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const Type* _pointerType, llvm::Value* _donttouch, bool _allocatedInMemory, bool _ignoreCount ) const;
+      virtual llvm::BasicBlock* cleanUp( GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const Type* _pointerType, llvm::Value* _donttouch, bool _allocatedInMemory, bool _ignoreCount, bool _deletePointer ) const;
       virtual llvm::BasicBlock* mark( GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const Type* _pointerType, llvm::Value* increment ) const;
     private:
       llvm::Value* pointerToValue(GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, int index ) const;

Modified: trunk/OpenGTL/OpenShiva/OpenShiva/PixelVisitor_p.cpp
===================================================================
--- trunk/OpenGTL/OpenShiva/OpenShiva/PixelVisitor_p.cpp	2008-09-19 22:54:18 UTC (rev 396)
+++ trunk/OpenGTL/OpenShiva/OpenShiva/PixelVisitor_p.cpp	2008-09-20 00:37:34 UTC (rev 397)
@@ -102,7 +102,7 @@
   return _currentBlock;
 }
 
-llvm::BasicBlock* PixelVisitor::cleanUp( GTLCore::GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const GTLCore::Type* _pointerType, llvm::Value* _donttouch, bool _allocatedInMemory, bool _ignoreCount ) const
+llvm::BasicBlock* PixelVisitor::cleanUp( GTLCore::GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const GTLCore::Type* _pointerType, llvm::Value* _donttouch, bool _allocatedInMemory, bool _ignoreCount, bool _deletePointer ) const
 {
   return _currentBlock;
 }

Modified: trunk/OpenGTL/OpenShiva/OpenShiva/PixelVisitor_p.h
===================================================================
--- trunk/OpenGTL/OpenShiva/OpenShiva/PixelVisitor_p.h	2008-09-19 22:54:18 UTC (rev 396)
+++ trunk/OpenGTL/OpenShiva/OpenShiva/PixelVisitor_p.h	2008-09-20 00:37:34 UTC (rev 397)
@@ -43,7 +43,7 @@
       virtual GTLCore::ExpressionResult get(GTLCore::GenerationContext& _generationContext, llvm::BasicBlock* currentBlock, llvm::Value* pointer, const GTLCore::Type* _pointerType) const;
       virtual llvm::BasicBlock* set(GTLCore::GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const GTLCore::Type* _pointerType, llvm::Value* _value, const GTLCore::Type* _valueType, bool _allocatedInMemory) const;
       virtual llvm::BasicBlock* initialise(GTLCore::GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const GTLCore::Type* _pointerType, const std::list< llvm::Value*>& _sizes, bool _allocatedInMemory) const;
-      virtual llvm::BasicBlock* cleanUp( GTLCore::GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const GTLCore::Type* _pointerType, llvm::Value* _donttouch, bool _allocatedInMemory, bool _ignoreCount ) const;
+      virtual llvm::BasicBlock* cleanUp( GTLCore::GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const GTLCore::Type* _pointerType, llvm::Value* _donttouch, bool _allocatedInMemory, bool _ignoreCount, bool _deletePointer ) const;
       virtual llvm::BasicBlock* mark( GTLCore::GenerationContext& _generationContext, llvm::BasicBlock* _currentBlock, llvm::Value* _pointer, const GTLCore::Type* _pointerType, llvm::Value* increment ) const;
   };
   


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