[opengtl-commits] [508] remove export to c code

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


Revision: 508
Author:   cyrille
Date:     2008-11-29 19:37:02 +0100 (Sat, 29 Nov 2008)

Log Message:
-----------
remove export to c code

Modified Paths:
--------------
    tags/OpenGTL/0.9.6/OpenCTL/OpenCTL/Module.cpp
    tags/OpenGTL/0.9.6/OpenCTL/OpenCTL/Module.h
    tags/OpenGTL/0.9.6/OpenCTL/tools/compiler/CtlC.cpp
    tags/OpenGTL/0.9.6/OpenGTL/GTLCore/CMakeLists.txt
    tags/OpenGTL/0.9.6/OpenGTL/GTLCore/ModuleData_p.cpp
    tags/OpenGTL/0.9.6/OpenGTL/GTLCore/ModuleData_p.h
    tags/OpenGTL/0.9.6/OpenShiva/OpenShiva/Library.cpp
    tags/OpenGTL/0.9.6/OpenShiva/OpenShiva/Library.h
    tags/OpenGTL/0.9.6/OpenShiva/tools/compiler/ShivaC.cpp


Modified: tags/OpenGTL/0.9.6/OpenCTL/OpenCTL/Module.cpp
===================================================================
--- tags/OpenGTL/0.9.6/OpenCTL/OpenCTL/Module.cpp	2008-11-29 18:36:49 UTC (rev 507)
+++ tags/OpenGTL/0.9.6/OpenCTL/OpenCTL/Module.cpp	2008-11-29 18:37:02 UTC (rev 508)
@@ -170,11 +170,6 @@
   return os.str();
 }
 
-GTLCore::String Module::cSourceCode() const
-{
-  return d->moduleData->asCCode();
-}
-
 std::list<GTLCore::Function*> Module::functions()
 {
   return d->moduleData->functions();

Modified: tags/OpenGTL/0.9.6/OpenCTL/OpenCTL/Module.h
===================================================================
--- tags/OpenGTL/0.9.6/OpenCTL/OpenCTL/Module.h	2008-11-29 18:36:49 UTC (rev 507)
+++ tags/OpenGTL/0.9.6/OpenCTL/OpenCTL/Module.h	2008-11-29 18:37:02 UTC (rev 508)
@@ -101,10 +101,6 @@
        * @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: tags/OpenGTL/0.9.6/OpenCTL/tools/compiler/CtlC.cpp
===================================================================
--- tags/OpenGTL/0.9.6/OpenCTL/tools/compiler/CtlC.cpp	2008-11-29 18:36:49 UTC (rev 507)
+++ tags/OpenGTL/0.9.6/OpenCTL/tools/compiler/CtlC.cpp	2008-11-29 18:37:02 UTC (rev 508)
@@ -52,7 +52,6 @@
 {
   GTLCore::String fileName = "";
   bool showAssembly = false;
-  bool showAsC = false;
   for(int ai = 1; ai < argc; ai++)
   {
     if(ARG_IS("-h","--help"))
@@ -65,8 +64,6 @@
       return EXIT_SUCCESS;
     } else if(ARG_IS("-S","--asm-source")) {
       showAssembly = true;
-    } else if(ARG_IS("-C","--c-source")) {
-      showAsC = true;
     } else if(ARG_IS("-L", "--module-dir")) {
       if( ai == argc )
       {
@@ -116,10 +113,6 @@
     {
       std::cout << p.asmSourceCode();
     }
-    if( showAsC )
-    {
-      std::cout << p.cSourceCode();
-    }
   }
   return EXIT_SUCCESS;
 }

Modified: tags/OpenGTL/0.9.6/OpenGTL/GTLCore/CMakeLists.txt
===================================================================
--- tags/OpenGTL/0.9.6/OpenGTL/GTLCore/CMakeLists.txt	2008-11-29 18:36:49 UTC (rev 507)
+++ tags/OpenGTL/0.9.6/OpenGTL/GTLCore/CMakeLists.txt	2008-11-29 18:37:02 UTC (rev 508)
@@ -1,7 +1,7 @@
 add_subdirectory(tests)
 
 # Find llvm jit, interpreter and native
-FIND_LLVM_LIBS( ${LLVM_CONFIG_EXECUTABLE} "native bitwriter linker bitreader jit interpreter support ipo cbackend" LLVM_LIBS LLVM_NATIVE_OBJECTS )
+FIND_LLVM_LIBS( ${LLVM_CONFIG_EXECUTABLE} "native bitwriter linker bitreader jit interpreter support ipo" LLVM_LIBS LLVM_NATIVE_OBJECTS )
 
 include_directories( ${LLVM_INCLUDE_DIR} )
 

Modified: tags/OpenGTL/0.9.6/OpenGTL/GTLCore/ModuleData_p.cpp
===================================================================
--- tags/OpenGTL/0.9.6/OpenGTL/GTLCore/ModuleData_p.cpp	2008-11-29 18:36:49 UTC (rev 507)
+++ tags/OpenGTL/0.9.6/OpenGTL/GTLCore/ModuleData_p.cpp	2008-11-29 18:37:02 UTC (rev 508)
@@ -102,39 +102,6 @@
   return functions;
 }
 
-GTLCore::String ModuleData::asCCode() const
-{
-  llvm::TargetMachine* ctarget = 0;
-  std::string cId = "c";
-  for( llvm::TargetMachineRegistry::iterator it = llvm::TargetMachineRegistry::begin();
-        it != llvm::TargetMachineRegistry::end(); ++it)
-  {
-    GTL_DEBUG( it->Name );
-    if( it->Name == cId )
-    {
-      ctarget = it->CtorFn(*m_llvmModule, "");
-      break;
-    }
-  }
-  
-  GTL_ASSERT(ctarget);
-  GTL_ASSERT(ctarget->WantsWholeFile());
-  
-  llvm::PassManager PM;
-  PM.add(new llvm::TargetData(*ctarget->getTargetData()));
-  PM.add(llvm::createVerifierPass());
-  
-  std::ostringstream os;
-
-  // Ask the target to add backend passes as necessary.
-  bool succ = ctarget->addPassesToEmitWholeFile( PM, os, llvm::TargetMachine::AssemblyFile, false);
-  GTL_ASSERT(not succ);
-  UNUSED(succ);
-  PM.run(*m_llvmModule);
-  
-  return os.str();
-}
-
 void ModuleData::linkWith( const llvm::Module* _module )
 {
   foreach( const llvm::Module* mod, m_linkModuleWith )

Modified: tags/OpenGTL/0.9.6/OpenGTL/GTLCore/ModuleData_p.h
===================================================================
--- tags/OpenGTL/0.9.6/OpenGTL/GTLCore/ModuleData_p.h	2008-11-29 18:36:49 UTC (rev 507)
+++ tags/OpenGTL/0.9.6/OpenGTL/GTLCore/ModuleData_p.h	2008-11-29 18:37:02 UTC (rev 508)
@@ -58,10 +58,6 @@
       const llvm::Module* llvmLinkedModule() const { return m_llvmLinkedModule; }
       TypeManager* typeManager() { return m_typeManager; }
       const TypeManager* typeManager() const { return m_typeManager; }
-      /**
-       * @return a string containing the module compiled as C
-       */
-      GTLCore::String asCCode() const;
     private:
       llvm::Module* m_llvmModule;
       llvm::Module* m_llvmLinkedModule;

Modified: tags/OpenGTL/0.9.6/OpenShiva/OpenShiva/Library.cpp
===================================================================
--- tags/OpenGTL/0.9.6/OpenShiva/OpenShiva/Library.cpp	2008-11-29 18:36:49 UTC (rev 507)
+++ tags/OpenGTL/0.9.6/OpenShiva/OpenShiva/Library.cpp	2008-11-29 18:37:02 UTC (rev 508)
@@ -168,11 +168,6 @@
   return os.str();
 }
 
-GTLCore::String Library::cSourceCode() const
-{
-  return d->m_moduleData->asCCode();
-}
-
 const GTLCore::ModuleData* Library::data() const
 {
   return d->m_moduleData;

Modified: tags/OpenGTL/0.9.6/OpenShiva/OpenShiva/Library.h
===================================================================
--- tags/OpenGTL/0.9.6/OpenShiva/OpenShiva/Library.h	2008-11-29 18:36:49 UTC (rev 507)
+++ tags/OpenGTL/0.9.6/OpenShiva/OpenShiva/Library.h	2008-11-29 18:37:02 UTC (rev 508)
@@ -75,10 +75,6 @@
        */
       GTLCore::String asmSourceCode() const;
       /**
-       * @return the C source code, it's mostly usefull for testing purpose
-       */
-      GTLCore::String cSourceCode() const;
-      /**
        * @return a pointer to the internal Data of this module (the class Module::Data
        *         is not part of the public API and therefor there is no reason for you
        *         to use that function).

Modified: tags/OpenGTL/0.9.6/OpenShiva/tools/compiler/ShivaC.cpp
===================================================================
--- tags/OpenGTL/0.9.6/OpenShiva/tools/compiler/ShivaC.cpp	2008-11-29 18:36:49 UTC (rev 507)
+++ tags/OpenGTL/0.9.6/OpenShiva/tools/compiler/ShivaC.cpp	2008-11-29 18:37:02 UTC (rev 508)
@@ -53,7 +53,6 @@
   GTLCore::String fileName = "";
   GTLCore::String output = "";
   bool showAssembly = false;
-  bool showAsC = false;
   for(int ai = 1; ai < argc; ai++)
   {
     if(ARG_IS("-h","--help"))
@@ -66,8 +65,6 @@
       return EXIT_SUCCESS;
     } else if(ARG_IS("-S","--asm-source")) {
       showAssembly = true;
-    } else if(ARG_IS("-C","--c-source")) {
-      showAsC = true;
     } else if(ARG_IS("-o","--output")) {
       if( ai == argc )
       {
@@ -126,10 +123,6 @@
     {
       std::cout << p.asmSourceCode();
     }
-    if( showAsC )
-    {
-      std::cout << p.cSourceCode();
-    }
   }
   return EXIT_SUCCESS;
 }


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