comparison gen/typinf.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
14 14
15 #include <cstdio> 15 #include <cstdio>
16 #include <cassert> 16 #include <cassert>
17 17
18 #include "gen/llvm.h" 18 #include "gen/llvm.h"
19 #include "gen/llvm-version.h"
19 20
20 #include "mars.h" 21 #include "mars.h"
21 #include "module.h" 22 #include "module.h"
22 #include "mtype.h" 23 #include "mtype.h"
23 #include "scope.h" 24 #include "scope.h"
315 MDNodeField* mdVals[TD_NumFields]; 316 MDNodeField* mdVals[TD_NumFields];
316 if (TD_Confirm >= 0) 317 if (TD_Confirm >= 0)
317 mdVals[TD_Confirm] = llvm::cast<MDNodeField>(irg->value); 318 mdVals[TD_Confirm] = llvm::cast<MDNodeField>(irg->value);
318 mdVals[TD_Type] = llvm::UndefValue::get(DtoType(tid->tinfo)); 319 mdVals[TD_Type] = llvm::UndefValue::get(DtoType(tid->tinfo));
319 // Construct the metadata 320 // Construct the metadata
321 #if LLVM_REV < 77733
320 llvm::MetadataBase* metadata = gIR->context().getMDNode(mdVals, TD_NumFields); 322 llvm::MetadataBase* metadata = gIR->context().getMDNode(mdVals, TD_NumFields);
323 #else
324 llvm::MetadataBase* metadata = MDNode::get(Context, mdVals, TD_NumFields);
325 #endif
321 // Insert it into the module 326 // Insert it into the module
322 llvm::NamedMDNode::Create(metaname, &metadata, 1, gIR->module); 327 llvm::NamedMDNode::Create(metaname, &metadata, 1, gIR->module);
323 } 328 }
324 } 329 }
325 #endif // USE_METADATA 330 #endif // USE_METADATA