changeset 1627:36ad06193338

2009-07-08 Xerxes R?nby <xerxes@zafena.se> * ports/hotspot/src/share/vm/shark/sharkBuilder.hpp (SharkBuilder::pointer_constant): Pass the LLVMContext returned from getGlobalContext() to the new GlobalVariable constructor when llvm version are 2.6 or later to handle LLVM API change. * ports/hotspot/src/share/vm/shark/sharkBuilder.cpp (SharkBuilder::CreateDump): Likewise.
author Xerxes R?nby <xerxes@zafena.se>
date Wed, 08 Jul 2009 11:28:08 +0200
parents b4bb02c70835
children bb7ad7d43804
files ChangeLog ports/hotspot/src/share/vm/shark/sharkBuilder.cpp ports/hotspot/src/share/vm/shark/sharkBuilder.hpp
diffstat 3 files changed, 23 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Jul 07 13:44:35 2009 -0400
+++ b/ChangeLog	Wed Jul 08 11:28:08 2009 +0200
@@ -1,3 +1,12 @@
+2009-07-08  Xerxes RĂ„nby  <xerxes@zafena.se>
+
+	* ports/hotspot/src/share/vm/shark/sharkBuilder.hpp
+	(SharkBuilder::pointer_constant): Pass the LLVMContext returned
+	from getGlobalContext() to the new GlobalVariable constructor
+	when llvm version are 2.6 or later to handle LLVM API change.
+	* ports/hotspot/src/share/vm/shark/sharkBuilder.cpp
+	(SharkBuilder::CreateDump): Likewise.
+
 2009-07-07  Omair Majid  <omajid@redhat.com>
 
 	* rt/net/sourceforge/jnlp/Parser.java
--- a/ports/hotspot/src/share/vm/shark/sharkBuilder.cpp	Tue Jul 07 13:44:35 2009 -0400
+++ b/ports/hotspot/src/share/vm/shark/sharkBuilder.cpp	Wed Jul 08 11:28:08 2009 +0200
@@ -187,6 +187,12 @@
   Value *name = CreatePtrToInt(
     CreateStructGEP(
       new GlobalVariable(
+#if SHARK_LLVM_VERSION >= 26
+        // LLVM 2.6 requires a LLVMContext during GlobalVariable construction.
+        // getGlobalConext() returns one that can be used as long as the shark
+        // compiler are single-threaded.
+        getGlobalContext(),
+#endif
         const_name->getType(),
         true, GlobalValue::InternalLinkage,
         const_name, "dump", module()),
--- a/ports/hotspot/src/share/vm/shark/sharkBuilder.hpp	Tue Jul 07 13:44:35 2009 -0400
+++ b/ports/hotspot/src/share/vm/shark/sharkBuilder.hpp	Wed Jul 08 11:28:08 2009 +0200
@@ -174,7 +174,14 @@
     char name[128];
     snprintf(name, sizeof name - 1, "pointer_constant_%p", ptr);
 
-    GlobalVariable *value = new GlobalVariable(SharkType::intptr_type(),
+    GlobalVariable *value = new GlobalVariable(
+#if SHARK_LLVM_VERSION >= 26
+      // LLVM 2.6 requires a LLVMContext during GlobalVariable construction.
+      // getGlobalConext() returns one that can be used as long as the shark
+      // compiler are single-threaded.
+      getGlobalContext(),
+#endif
+      SharkType::intptr_type(),
       false, GlobalValue::ExternalLinkage,
       NULL, name, module());
     execution_engine()->addGlobalMapping(value, const_cast<void*>(ptr));