mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-28 01:23:14 +01:00
Removed tautological checks.
They were probably used during initial development of the pass to be able to disable emission of the global reference by setting TD_TypeInfo to -1.
This commit is contained in:
@@ -495,8 +495,9 @@ Type* Analysis::getTypeFor(Value* typeinfo) const {
|
||||
|
||||
if (node->getNumOperands() != TD_NumFields)
|
||||
return NULL;
|
||||
if (TD_TypeInfo >= 0 && (!node->getOperand(TD_TypeInfo) ||
|
||||
node->getOperand(TD_TypeInfo)->stripPointerCasts() != ti_global))
|
||||
|
||||
Value* ti = node->getOperand(TD_TypeInfo);
|
||||
if (!ti || ti->stripPointerCasts() != ti_global)
|
||||
return NULL;
|
||||
|
||||
return node->getOperand(TD_Type)->getType();
|
||||
|
||||
@@ -328,9 +328,9 @@ void DtoResolveTypeInfo(TypeInfoDeclaration* tid)
|
||||
if (!meta && tid->tinfo->toBasetype()->ty < Terror) {
|
||||
// Construct the fields
|
||||
MDNodeField* mdVals[TD_NumFields];
|
||||
if (TD_TypeInfo >= 0)
|
||||
mdVals[TD_TypeInfo] = llvm::cast<MDNodeField>(irg->value);
|
||||
mdVals[TD_TypeInfo] = llvm::cast<MDNodeField>(irg->value);
|
||||
mdVals[TD_Type] = llvm::UndefValue::get(DtoType(tid->tinfo));
|
||||
|
||||
// Construct the metadata and insert it into the module.
|
||||
llvm::NamedMDNode* node = gIR->module->getOrInsertNamedMetadata(metaname);
|
||||
node->addOperand(llvm::MDNode::get(gIR->context(),
|
||||
|
||||
Reference in New Issue
Block a user