Metadata/gc2stack compile fixes to accomodate LLVM API changes.

This commit is contained in:
David Nadlinger
2012-07-04 22:47:01 +02:00
parent a3a511ca55
commit ebbbfdd4ac
5 changed files with 44 additions and 41 deletions

View File

@@ -349,10 +349,10 @@ void DtoResolveTypeInfo(TypeInfoDeclaration* tid)
if (TD_Confirm >= 0)
mdVals[TD_Confirm] = llvm::cast<MDNodeField>(irg->value);
mdVals[TD_Type] = llvm::UndefValue::get(DtoType(tid->tinfo));
// Construct the metadata
llvm::MetadataBase* metadata = llvm::MDNode::get(gIR->context(), mdVals, TD_NumFields);
// Insert it into the module
llvm::NamedMDNode::Create(gIR->context(), metaname, &metadata, 1, gIR->module);
// Construct the metadata and insert it into the module.
llvm::NamedMDNode* node = gIR->module->getOrInsertNamedMetadata(metaname);
node->addOperand(llvm::MDNode::get(gIR->context(),
llvm::makeArrayRef(mdVals, TD_NumFields)));
}
}
#endif // USE_METADATA