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
This commit is contained in:
Frits van Bommel
2009-05-08 16:00:44 +02:00
parent 5c29832ee7
commit adf1fd4d44
3 changed files with 7 additions and 3 deletions

View File

@@ -295,7 +295,8 @@ void DtoResolveTypeInfo(TypeInfoDeclaration* tid)
if (!meta && tid->tinfo->toBasetype()->ty < Terror) {
// Construct the fields
LLConstant* mdVals[TD_NumFields];
mdVals[TD_Confirm] = llvm::cast<LLConstant>(irg->value);
if (TD_Confirm >= 0)
mdVals[TD_Confirm] = llvm::cast<LLConstant>(irg->value);
mdVals[TD_Type] = llvm::UndefValue::get(DtoType(tid->tinfo));
// Construct the metadata
llvm::MDNode* metadata = llvm::MDNode::get(mdVals, TD_NumFields);