[vmkit-commits] [vmkit] r99764 - /vmkit/trunk/lib/Mvm/Compiler/JIT.cpp

Nicolas Geoffray nicolas.geoffray at lip6.fr
Sun Mar 28 09:54:48 PDT 2010


Author: geoffray
Date: Sun Mar 28 11:54:48 2010
New Revision: 99764

URL: http://llvm.org/viewvc/llvm-project?rev=99764&view=rev
Log:
Code cleanup + Create a context for the global module (so that we're not bitten by LLVM shutdown).


Modified:
    vmkit/trunk/lib/Mvm/Compiler/JIT.cpp

Modified: vmkit/trunk/lib/Mvm/Compiler/JIT.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Compiler/JIT.cpp?rev=99764&r1=99763&r2=99764&view=diff
==============================================================================
--- vmkit/trunk/lib/Mvm/Compiler/JIT.cpp (original)
+++ vmkit/trunk/lib/Mvm/Compiler/JIT.cpp Sun Mar 28 11:54:48 2010
@@ -156,7 +156,7 @@
   llvm::cl::ParseCommandLineOptions(2, commands);
 
   if (!M) {
-    globalModule = new Module("bootstrap module", getGlobalContext());
+    globalModule = new Module("bootstrap module", *(new LLVMContext()));
 
     InitializeNativeTarget();
 
@@ -326,8 +326,6 @@
   assert(AllocateUnresolvedFunction && "No allocateUnresolved function");
   AddFinalizationCandidate = module->getFunction("addFinalizationCandidate");
   assert(AddFinalizationCandidate && "No addFinalizationCandidate function");
-  
-  MvmModule::copyDefinitions(module, MvmModule::globalModule); 
 }
 
 const llvm::TargetData* MvmModule::TheTargetData;
@@ -476,30 +474,6 @@
   }
 }
 
-
-void MvmModule::copyDefinitions(Module* Dst, Module* Src) {
-  Function* SF = Src->getFunction("gcmalloc");
-  Function* DF = Dst->getFunction("gcmalloc");
-  if (SF && DF && executionEngine && !SF->isDeclaration()) {
-    void* ptr = executionEngine->getPointerToFunction(SF);
-    executionEngine->updateGlobalMapping(DF, ptr);
-  }
-  
-  SF = Src->getFunction("gcmallocUnresolved");
-  DF = Dst->getFunction("gcmallocUnresolved");
-  if (SF && DF && executionEngine && !SF->isDeclaration()) {
-    void* ptr = executionEngine->getPointerToFunction(SF);
-    executionEngine->updateGlobalMapping(DF, ptr);
-  }
-  
-  SF = Src->getFunction("addFinalizationCandidate");
-  DF = Dst->getFunction("addFinalizationCandidate");
-  if (SF && DF && executionEngine && !SF->isDeclaration()) {
-    void* ptr = executionEngine->getPointerToFunction(SF);
-    executionEngine->updateGlobalMapping(DF, ptr);
-  }
-}
-
 void JITMethodInfo::scan(void* TL, void* ip, void* addr) {
   if (GCInfo) {
     DEBUG(llvm::errs() << GCInfo->getFunction().getName() << '\n');





More information about the vmkit-commits mailing list