# HG changeset patch # User Benjamin Kramer # Date 1249077186 -7200 # Node ID 8912aabdb26edde59eab80f8512e6baba8e270fb # Parent 1d5c3354b3c28900de3f17282a3325ddb1229bf5 MDNode left the Context! The changes are in #if LLVM_REV >= 77733 to make the dstress bot happy. diff -r 1d5c3354b3c2 -r 8912aabdb26e gen/typinf.cpp --- a/gen/typinf.cpp Fri Jul 31 23:01:29 2009 +0200 +++ b/gen/typinf.cpp Fri Jul 31 23:53:06 2009 +0200 @@ -16,6 +16,7 @@ #include #include "gen/llvm.h" +#include "gen/llvm-version.h" #include "mars.h" #include "module.h" @@ -317,7 +318,11 @@ mdVals[TD_Confirm] = llvm::cast(irg->value); mdVals[TD_Type] = llvm::UndefValue::get(DtoType(tid->tinfo)); // Construct the metadata +#if LLVM_REV < 77733 llvm::MetadataBase* metadata = gIR->context().getMDNode(mdVals, TD_NumFields); +#else + llvm::MetadataBase* metadata = MDNode::get(Context, mdVals, TD_NumFields); +#endif // Insert it into the module llvm::NamedMDNode::Create(metaname, &metadata, 1, gIR->module); } diff -r 1d5c3354b3c2 -r 8912aabdb26e ir/irclass.cpp --- 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);