[opengtl-commits] [488] compile and link with llvm 2.4

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


Revision: 488
Author:   cyrille
Date:     2008-11-22 12:26:37 +0100 (Sat, 22 Nov 2008)

Log Message:
-----------
compile and link with llvm 2.4

Modified Paths:
--------------
    trunk/OpenGTL/OpenGTL/GTLCore/AST/FunctionDeclaration.cpp
    trunk/OpenGTL/OpenGTL/GTLCore/ModuleData_p.cpp
    trunk/OpenGTL/OpenGTL/GTLCore/Optimiser_p.cpp


Modified: trunk/OpenGTL/OpenGTL/GTLCore/AST/FunctionDeclaration.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/AST/FunctionDeclaration.cpp	2008-11-21 23:11:50 UTC (rev 487)
+++ trunk/OpenGTL/OpenGTL/GTLCore/AST/FunctionDeclaration.cpp	2008-11-22 11:26:37 UTC (rev 488)
@@ -92,12 +92,13 @@
   for(std::vector< Parameter >::const_iterator it = m_function->parameters().begin();
       it != m_function->parameters().end(); ++it)
   {
-    if( it->output() or not it->type()->d->type()->isFirstClassType() )
+    params.push_back( it->type()->d->asArgumentType() );
+/*    if( it->output() or not it->type()->d->type()->isFirstClassType() or not it- )
     {
       params.push_back( llvm::PointerType::get( it->type()->d->type(), 0 ) );
     } else {
       params.push_back( it->type()->d->type() );
-    }
+    }*/
   }
   // List of functions
   std::vector<llvm::Function*> functions( params.size() + 1 );
@@ -160,6 +161,7 @@
   // Generate the code of the function
   llvm::BasicBlock* firstBlock = llvm::BasicBlock::Create();
   fullFunction->getBasicBlockList().push_back( firstBlock );
+  GTL_DEBUG(*fullFunction);
   // Initialise the context
   GenerationContext generationContext( _codeGenerator, fullFunction, m_function, _module);
   // Initialize the arguments

Modified: trunk/OpenGTL/OpenGTL/GTLCore/ModuleData_p.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/ModuleData_p.cpp	2008-11-21 23:11:50 UTC (rev 487)
+++ trunk/OpenGTL/OpenGTL/GTLCore/ModuleData_p.cpp	2008-11-22 11:26:37 UTC (rev 488)
@@ -35,6 +35,7 @@
 #include <llvm/Analysis/Verifier.h>
 #include <llvm/Transforms/Utils/Cloning.h>
 #include <llvm/Linker.h>
+#include <llvm/Support/raw_ostream.h>
 
 using namespace GTLCore;
 
@@ -124,7 +125,8 @@
   PM.add(new llvm::TargetData(*ctarget->getTargetData()));
   PM.add(llvm::createVerifierPass());
   
-  std::ostringstream os;
+  GTLCore::String str;
+  llvm::raw_string_ostream os(str);
 
   // Ask the target to add backend passes as necessary.
   bool succ = ctarget->addPassesToEmitWholeFile( PM, os, llvm::TargetMachine::AssemblyFile, false);
@@ -132,7 +134,7 @@
   UNUSED(succ);
   PM.run(*m_llvmModule);
   
-  return os.str();
+  return str;
 }
 
 void ModuleData::linkWith( const llvm::Module* _module )

Modified: trunk/OpenGTL/OpenGTL/GTLCore/Optimiser_p.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/Optimiser_p.cpp	2008-11-21 23:11:50 UTC (rev 487)
+++ trunk/OpenGTL/OpenGTL/GTLCore/Optimiser_p.cpp	2008-11-22 11:26:37 UTC (rev 488)
@@ -21,7 +21,6 @@
 
 #include <llvm/PassManager.h>
 #include <llvm/Analysis/LoopPass.h>
-#include <llvm/Analysis/LoadValueNumbering.h>
 #include <llvm/Analysis/Verifier.h>
 #include "llvm/Assembly/Parser.h"
 #include "llvm/Transforms/IPO.h"
@@ -58,8 +57,6 @@
     { "IndVarSimplify", "Canonicalize indvars", 3, (llvm::Pass* (*)())(llvm::createIndVarSimplifyPass) },
     { "LoopUnroll", "Unroll small loops", 3, (llvm::Pass* (*)())(llvm::createLoopUnrollPass) },
     { "InstructionCombining", "Clean up after the unroller", 3, (llvm::Pass* (*)())(llvm::createInstructionCombiningPass) },
-    { "LoadValueNumbering", "GVN for load instructions", 3, (llvm::Pass* (*)())(llvm::createLoadValueNumberingPass) },
-    { "GCSE", "Remove common subexprs", 3, (llvm::Pass* (*)())(llvm::createGCSEPass) },
     { "SCCP", "Constant prop with SCCP", 3, (llvm::Pass* (*)())(llvm::createSCCPPass) },
     { "InstructionCombining", "Run instcombine again after redundancy elimination", 4, (llvm::Pass* (*)())(llvm::createInstructionCombiningPass) },
     { "DeadStoreElimination", "Delete dead stores", 4, (llvm::Pass* (*)())(llvm::createDeadStoreEliminationPass) },


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