diff --git a/gen/passes/GarbageCollect2Stack.cpp b/gen/passes/GarbageCollect2Stack.cpp index 9beda12b..237f442c 100644 --- a/gen/passes/GarbageCollect2Stack.cpp +++ b/gen/passes/GarbageCollect2Stack.cpp @@ -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(); diff --git a/gen/typinf.cpp b/gen/typinf.cpp index a472d1c9..793ea288 100644 --- a/gen/typinf.cpp +++ b/gen/typinf.cpp @@ -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(irg->value); + mdVals[TD_TypeInfo] = llvm::cast(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(),