[opengtl-commits] [446] give function the external linkage attribute

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


Revision: 446
Author:   cyrille
Date:     2008-10-11 18:25:23 +0200 (Sat, 11 Oct 2008)

Log Message:
-----------
give function the external linkage attribute
enable function inlining

Modified Paths:
--------------
    trunk/OpenGTL/OpenCTL/OpenCTL/Program.cpp
    trunk/OpenGTL/OpenGTL/GTLCore/CodeGenerator_p.cpp
    trunk/OpenGTL/OpenGTL/GTLCore/Optimiser_p.cpp


Modified: trunk/OpenGTL/OpenCTL/OpenCTL/Program.cpp
===================================================================
--- trunk/OpenGTL/OpenCTL/OpenCTL/Program.cpp	2008-10-11 11:39:29 UTC (rev 445)
+++ trunk/OpenGTL/OpenCTL/OpenCTL/Program.cpp	2008-10-11 16:25:23 UTC (rev 446)
@@ -117,7 +117,7 @@
   // Clone the module
   if( module->data())
   {
-    d->module = llvm::CloneModule(module->data()->llvmModule());
+    d->module = llvm::CloneModule(module->data()->llvmLinkedModule());
     d->moduleData = new GTLCore::ModuleData( d->module );
     const GTLCore::Function* functionDef = module->function( functionName );
     if( not functionDef ) return;

Modified: trunk/OpenGTL/OpenGTL/GTLCore/CodeGenerator_p.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/CodeGenerator_p.cpp	2008-10-11 11:39:29 UTC (rev 445)
+++ trunk/OpenGTL/OpenGTL/GTLCore/CodeGenerator_p.cpp	2008-10-11 16:25:23 UTC (rev 446)
@@ -290,7 +290,7 @@
 
 llvm::Function* CodeGenerator::createFunction( llvm::FunctionType* type, const GTLCore::String& name)
 {
-  return llvm::Function::Create( type, llvm::GlobalValue::LinkOnceLinkage,
+  return llvm::Function::Create( type, llvm::GlobalValue::ExternalLinkage,
                   name, d->module->llvmModule() );
 }
 

Modified: trunk/OpenGTL/OpenGTL/GTLCore/Optimiser_p.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/Optimiser_p.cpp	2008-10-11 11:39:29 UTC (rev 445)
+++ trunk/OpenGTL/OpenGTL/GTLCore/Optimiser_p.cpp	2008-10-11 16:25:23 UTC (rev 446)
@@ -41,11 +41,11 @@
 
 static const PassInfo infos[] = {
     { "CFGSimplification", "Clean up disgusting code", 2, (llvm::Pass* (*)())(llvm::createCFGSimplificationPass) },
-//     { "GlobalDCE", "Remove unused globals", 2, (llvm::Pass* (*)())(llvm::createGlobalDCEPass) },
+    { "GlobalDCE", "Remove unused globals", 2, (llvm::Pass* (*)())(llvm::createGlobalDCEPass) },
     { "IPConstantPropagation", "IP Constant Propagation", 2, (llvm::Pass* (*)())(llvm::createIPConstantPropagationPass) },
     { "InstructionCombining", "Clean up after IPCP", 2, (llvm::Pass* (*)())(llvm::createInstructionCombiningPass) },
     { "CFGSimplification", "Clean up after IPCP", 2, (llvm::Pass* (*)())(llvm::createCFGSimplificationPass) },
-//     { "FunctionInlining", "Inline small definitions (functions)", 2, (llvm::Pass* (*)())(llvm::createFunctionInliningPass) },
+    { "FunctionInlining", "Inline small definitions (functions)", 2, (llvm::Pass* (*)())(llvm::createFunctionInliningPass) },
     { "TailDuplication", "Simplify cfg by copying code", 2, (llvm::Pass* (*)())(llvm::createTailDuplicationPass) },
     { "CFGSimplification", "Merge & remove BBs", 3, (llvm::Pass* (*)())(llvm::createCFGSimplificationPass) },
     { "InstructionCombining", "Compile silly sequences", 3, (llvm::Pass* (*)())(llvm::createInstructionCombiningPass) },
@@ -75,7 +75,7 @@
 
 Optimiser::Private::Private() : m_passManager(0)
 {
-  setLevel( 0 );
+  setLevel( 2 );
 }
 
 Optimiser::Private::~Private()


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