changeset 1624:051f9a48387c

2009-07-07 Xerxes R?nby <xerxes@zafena.se> * ports/hotspot/src/share/vm/shark/llvmHeaders.hpp Include llvm/LLVMContext.h used by getGlobalContext() when llvm version are 2.6 or later. * ports/hotspot/src/share/vm/shark/sharkCompiler.cpp (SharkCompiler::SharkCompiler): Pass the LLVMContext returned from getGlobalContext() to the new Module constructor when llvm version are 2.6 or later to handle LLVM API change.
author Xerxes R?nby <xerxes@zafena.se>
date Tue, 07 Jul 2009 10:58:02 +0200
parents 308c172cd230
children 742216fd1f8f
files ChangeLog ports/hotspot/src/share/vm/shark/llvmHeaders.hpp ports/hotspot/src/share/vm/shark/sharkCompiler.cpp
diffstat 3 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Jul 03 11:52:45 2009 +0100
+++ b/ChangeLog	Tue Jul 07 10:58:02 2009 +0200
@@ -1,3 +1,13 @@
+2009-07-07  Xerxes RĂ„nby  <xerxes@zafena.se>
+
+	* ports/hotspot/src/share/vm/shark/llvmHeaders.hpp
+	Include llvm/LLVMContext.h used by getGlobalContext()
+	when llvm version are 2.6 or later.
+	* ports/hotspot/src/share/vm/shark/sharkCompiler.cpp
+	(SharkCompiler::SharkCompiler): Pass the LLVMContext returned 
+	from getGlobalContext() to the new Module constructor
+	when llvm version are 2.6 or later to handle LLVM API change.
+
 2009-07-03  Gary Benson  <gbenson@redhat.com>
 
 	* ports/hotspot/src/share/vm/shark/sharkEntry.hpp
--- a/ports/hotspot/src/share/vm/shark/llvmHeaders.hpp	Fri Jul 03 11:52:45 2009 +0100
+++ b/ports/hotspot/src/share/vm/shark/llvmHeaders.hpp	Tue Jul 07 10:58:02 2009 +0200
@@ -32,6 +32,9 @@
 #include <llvm/DerivedTypes.h>
 #include <llvm/ExecutionEngine/ExecutionEngine.h>
 #include <llvm/Instructions.h>
+#if SHARK_LLVM_VERSION >= 26
+#include <llvm/LLVMContext.h>
+#endif
 #include <llvm/Module.h>
 #include <llvm/ModuleProvider.h>
 #include <llvm/Support/IRBuilder.h>
--- a/ports/hotspot/src/share/vm/shark/sharkCompiler.cpp	Fri Jul 03 11:52:45 2009 +0100
+++ b/ports/hotspot/src/share/vm/shark/sharkCompiler.cpp	Tue Jul 07 10:58:02 2009 +0200
@@ -43,7 +43,15 @@
 #endif
 
   // Create a module to build our functions into
+#if SHARK_LLVM_VERSION >= 26
+  // LLVM 2.6 and later requires passing a LLVMContext during module
+  // creation. The LLVM API getGlobalContext() returns a LLVMContext that
+  // can be used safely as long as the shark compiler stays single threaded
+  // and only uses one module.
+  _module = new Module("shark", getGlobalContext());
+#else
   _module = new Module("shark");
+#endif
 
   // Create the builder to build our functions
   _builder = new SharkBuilder(this);