changeset 2159:216f095954ab

Update Shark for LLVM r94686 API change. 2010-02-01 Xerxes R?nby <xerxes@zafena.se> * ports/hotspot/src/share/vm/shark/sharkCompiler.cpp (SharkCompiler::SharkCompiler): Use sharkContext::module instead of sharkContext::module_provider when using LLVM 2.7 to handle LLVM r94686 API change. * ports/hotspot/src/share/vm/shark/sharkContext.hpp (sharkContext::module): Made public when using LLVM 2.7. (sharkContext::module_provider): Undefine when using LLVM 2.7. * ports/hotspot/src/share/vm/shark/llvmHeaders.hpp (llvm/ModuleProvider.h): Undefine when using LLVM 2.7.
author Xerxes R?nby <xerxes@zafena.se>
date Mon, 01 Feb 2010 12:28:24 +0100
parents 40357adde7f6
children 3f733a43a8b2
files ChangeLog ports/hotspot/src/share/vm/shark/llvmHeaders.hpp ports/hotspot/src/share/vm/shark/sharkCompiler.cpp ports/hotspot/src/share/vm/shark/sharkContext.hpp
diffstat 4 files changed, 28 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed May 19 19:39:45 2010 +0100
+++ b/ChangeLog	Mon Feb 01 12:28:24 2010 +0100
@@ -1,3 +1,15 @@
+2010-02-01  Xerxes RĂ„nby  <xerxes@zafena.se>
+
+	* ports/hotspot/src/share/vm/shark/sharkCompiler.cpp
+	(SharkCompiler::SharkCompiler): Use sharkContext::module
+	instead of sharkContext::module_provider when using LLVM 2.7
+	to handle LLVM r94686 API change.
+	* ports/hotspot/src/share/vm/shark/sharkContext.hpp
+	(sharkContext::module): Made public when using LLVM 2.7.
+	(sharkContext::module_provider): Undefine when using LLVM 2.7.
+	* ports/hotspot/src/share/vm/shark/llvmHeaders.hpp
+	(llvm/ModuleProvider.h): Undefine when using LLVM 2.7.
+
 2010-05-19 Andrew John Hughes  <ahughes@redhat.com>
 
 	Patch splashscreen to build against libpng 1.4.
--- a/ports/hotspot/src/share/vm/shark/llvmHeaders.hpp	Wed May 19 19:39:45 2010 +0100
+++ b/ports/hotspot/src/share/vm/shark/llvmHeaders.hpp	Mon Feb 01 12:28:24 2010 +0100
@@ -34,7 +34,9 @@
 #include <llvm/Instructions.h>
 #include <llvm/LLVMContext.h>
 #include <llvm/Module.h>
+#if SHARK_LLVM_VERSION < 27
 #include <llvm/ModuleProvider.h>
+#endif
 #include <llvm/Support/IRBuilder.h>
 #include <llvm/System/Threading.h>
 #include <llvm/Target/TargetSelect.h>
--- a/ports/hotspot/src/share/vm/shark/sharkCompiler.cpp	Wed May 19 19:39:45 2010 +0100
+++ b/ports/hotspot/src/share/vm/shark/sharkCompiler.cpp	Mon Feb 01 12:28:24 2010 +0100
@@ -52,11 +52,19 @@
   _memory_manager = new SharkMemoryManager();
 
   // Create the JIT
+#if SHARK_LLVM_VERSION >= 27
+  _execution_engine = ExecutionEngine::createJIT(
+    _normal_context->module(),
+    NULL, memory_manager(), CodeGenOpt::Default);
+  execution_engine()->addModule(
+    _native_context->module());
+#else
   _execution_engine = ExecutionEngine::createJIT(
     _normal_context->module_provider(),
     NULL, memory_manager(), CodeGenOpt::Default);
   execution_engine()->addModuleProvider(
     _native_context->module_provider());
+#endif
 
   // All done
   mark_initialized();
--- a/ports/hotspot/src/share/vm/shark/sharkContext.hpp	Wed May 19 19:39:45 2010 +0100
+++ b/ports/hotspot/src/share/vm/shark/sharkContext.hpp	Mon Feb 01 12:28:24 2010 +0100
@@ -36,7 +36,11 @@
  private:
   llvm::Module* _module;
 
+#if SHARK_LLVM_VERSION >= 27
+ public:
+#else
  private:
+#endif
   llvm::Module* module() const
   {
     return _module;
@@ -51,10 +55,12 @@
 
   // Module accessors
  public:
+#if SHARK_LLVM_VERSION < 27
   llvm::ModuleProvider* module_provider() const
   {
     return new llvm::ExistingModuleProvider(module());
   }
+#endif
   void add_function(llvm::Function* function) const
   {
     module()->getFunctionList().push_back(function);