comparison 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
comparison
equal deleted inserted replaced
1560:1d5c3354b3c2 1561:8912aabdb26e
3 3
4 #include "aggregate.h" 4 #include "aggregate.h"
5 #include "declaration.h" 5 #include "declaration.h"
6 #include "mtype.h" 6 #include "mtype.h"
7 7
8 #include "gen/llvm-version.h"
8 #include "gen/irstate.h" 9 #include "gen/irstate.h"
9 #include "gen/logger.h" 10 #include "gen/logger.h"
10 #include "gen/tollvm.h" 11 #include "gen/tollvm.h"
11 #include "gen/llvmhelpers.h" 12 #include "gen/llvmhelpers.h"
12 #include "gen/utils.h" 13 #include "gen/utils.h"
84 MDNodeField* mdVals[CD_NumFields]; 85 MDNodeField* mdVals[CD_NumFields];
85 mdVals[CD_BodyType] = llvm::UndefValue::get(bodyType); 86 mdVals[CD_BodyType] = llvm::UndefValue::get(bodyType);
86 mdVals[CD_Finalize] = LLConstantInt::get(LLType::Int1Ty, hasDestructor); 87 mdVals[CD_Finalize] = LLConstantInt::get(LLType::Int1Ty, hasDestructor);
87 mdVals[CD_CustomDelete] = LLConstantInt::get(LLType::Int1Ty, hasCustomDelete); 88 mdVals[CD_CustomDelete] = LLConstantInt::get(LLType::Int1Ty, hasCustomDelete);
88 // Construct the metadata 89 // Construct the metadata
90 #if LLVM_REV < 77733
89 llvm::MetadataBase* metadata = gIR->context().getMDNode(mdVals, CD_NumFields); 91 llvm::MetadataBase* metadata = gIR->context().getMDNode(mdVals, CD_NumFields);
92 #else
93 llvm::MetadataBase* metadata = MDNode::get(Context, mdVals, CD_NumFields);
94 #endif
90 // Insert it into the module 95 // Insert it into the module
91 std::string metaname = CD_PREFIX + initname; 96 std::string metaname = CD_PREFIX + initname;
92 llvm::NamedMDNode::Create(metaname, &metadata, 1, gIR->module); 97 llvm::NamedMDNode::Create(metaname, &metadata, 1, gIR->module);
93 } 98 }
94 #endif // USE_METADATA 99 #endif // USE_METADATA