diff ir/irclass.cpp @ 1561:8912aabdb26e

MDNode left the Context! The changes are in #if LLVM_REV >= 77733 to make the dstress bot happy.
author Benjamin Kramer <benny.kra@gmail.com>
date Fri, 31 Jul 2009 23:53:06 +0200
parents 3adcb70700cb
children 95d710d405e3
line wrap: on
line diff
--- a/ir/irclass.cpp	Fri Jul 31 23:01:29 2009 +0200
+++ b/ir/irclass.cpp	Fri Jul 31 23:53:06 2009 +0200
@@ -5,6 +5,7 @@
 #include "declaration.h"
 #include "mtype.h"
 
+#include "gen/llvm-version.h"
 #include "gen/irstate.h"
 #include "gen/logger.h"
 #include "gen/tollvm.h"
@@ -86,7 +87,11 @@
         mdVals[CD_Finalize] = LLConstantInt::get(LLType::Int1Ty, hasDestructor);
         mdVals[CD_CustomDelete] = LLConstantInt::get(LLType::Int1Ty, hasCustomDelete);
         // Construct the metadata
+#if LLVM_REV < 77733
         llvm::MetadataBase* metadata = gIR->context().getMDNode(mdVals, CD_NumFields);
+#else
+        llvm::MetadataBase* metadata = MDNode::get(Context, mdVals, CD_NumFields);
+#endif
         // Insert it into the module
         std::string metaname = CD_PREFIX + initname;
         llvm::NamedMDNode::Create(metaname, &metadata, 1, gIR->module);