comparison gen/typinf.cpp @ 1316:8c65217be813

Work around an LLVM bug by not referring to globals from metadata. This was only used for consistency checking anyway. For the LLVM bug, see http://llvm.org/PR4180 / http://llvm.org/PR4046
author Frits van Bommel <fvbommel wxs.nl>
date Fri, 08 May 2009 16:00:44 +0200
parents 875afb7a93b6
children c21a6654cce2
comparison
equal deleted inserted replaced
1315:c48dcf2e2c02 1316:8c65217be813
293 // Don't generate metadata for non-concrete types 293 // Don't generate metadata for non-concrete types
294 // (such as tuple types, slice types, typeof(expr), etc.) 294 // (such as tuple types, slice types, typeof(expr), etc.)
295 if (!meta && tid->tinfo->toBasetype()->ty < Terror) { 295 if (!meta && tid->tinfo->toBasetype()->ty < Terror) {
296 // Construct the fields 296 // Construct the fields
297 LLConstant* mdVals[TD_NumFields]; 297 LLConstant* mdVals[TD_NumFields];
298 mdVals[TD_Confirm] = llvm::cast<LLConstant>(irg->value); 298 if (TD_Confirm >= 0)
299 mdVals[TD_Confirm] = llvm::cast<LLConstant>(irg->value);
299 mdVals[TD_Type] = llvm::UndefValue::get(DtoType(tid->tinfo)); 300 mdVals[TD_Type] = llvm::UndefValue::get(DtoType(tid->tinfo));
300 // Construct the metadata 301 // Construct the metadata
301 llvm::MDNode* metadata = llvm::MDNode::get(mdVals, TD_NumFields); 302 llvm::MDNode* metadata = llvm::MDNode::get(mdVals, TD_NumFields);
302 // Insert it into the module 303 // Insert it into the module
303 new llvm::GlobalVariable(metadata->getType(), true, 304 new llvm::GlobalVariable(metadata->getType(), true,