[opengtl-commits] [312] use the optimiser in OpenShiva too

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


Revision: 312
Author:   cyrille
Date:     2008-08-04 09:08:08 +0200 (Mon, 04 Aug 2008)

Log Message:
-----------
use the optimiser in OpenShiva too

Modified Paths:
--------------
    trunk/OpenGTL/OpenShiva/OpenShiva/Compiler_p.cpp


Modified: trunk/OpenGTL/OpenShiva/OpenShiva/Compiler_p.cpp
===================================================================
--- trunk/OpenGTL/OpenShiva/OpenShiva/Compiler_p.cpp	2008-08-04 07:04:45 UTC (rev 311)
+++ trunk/OpenGTL/OpenShiva/OpenShiva/Compiler_p.cpp	2008-08-04 07:08:08 UTC (rev 312)
@@ -21,8 +21,6 @@
 
 #include <llvm/Module.h>
 #include <llvm/PassManager.h>
-#include <llvm/Target/TargetData.h>
-#include <llvm/Analysis/Verifier.h>
 
 #include "GTLCore/AST/Expression.h"
 #include "GTLCore/AST/FunctionDeclaration.h"
@@ -30,6 +28,7 @@
 #include "GTLCore/CodeGenerator_p.h"
 #include "GTLCore/ModuleData_p.h"
 #include "GTLCore/ErrorMessage.h"
+#include "GTLCore/Optimiser_p.h"
 
 #include "Debug.h"
 #include "Lexer_p.h"
@@ -80,14 +79,7 @@
       _moduleData->appendFunction( (*it)->function()->name(), (*it)->function());
     }
     // Success
-    // Optimization taken from the Stacker example
-    llvm::PassManager Passes;
-    // Add in the passes we want to execute
-    Passes.add(new llvm::TargetData(d->module));
-    // Verify we start with valid
-     Passes.add(llvm::createVerifierPass());
-    // Run
-    Passes.run(*d->module);
+    GTLCore::Optimiser::instance()->d->passManager()->run( *d->module );
   } else {
     // Failure
     SHIVA_DEBUG("failure " << (*errorMessages().begin()).line() << ": " << (*errorMessages().begin()).errorMessage());


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