From 245466d89cfe54b78da486f06d470bc6daaf4625 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 16 Feb 2023 16:44:04 -0800 Subject: Remove `SharedIRBuilder`. (#2657) Co-authored-by: Yong He --- .../slang-ir-specialize-dynamic-associatedtype-lookup.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'source/slang/slang-ir-specialize-dynamic-associatedtype-lookup.cpp') diff --git a/source/slang/slang-ir-specialize-dynamic-associatedtype-lookup.cpp b/source/slang/slang-ir-specialize-dynamic-associatedtype-lookup.cpp index cfc9d9c76..e68ac5b73 100644 --- a/source/slang/slang-ir-specialize-dynamic-associatedtype-lookup.cpp +++ b/source/slang/slang-ir-specialize-dynamic-associatedtype-lookup.cpp @@ -14,7 +14,7 @@ struct AssociatedTypeLookupSpecializationContext IRFunc* createWitnessTableLookupFunc(IRInterfaceType* interfaceType, IRInst* key) { - IRBuilder builder(sharedContext->sharedBuilderStorage); + IRBuilder builder(sharedContext->module); builder.setInsertBefore(interfaceType); auto inputWitnessTableIDType = builder.getWitnessTableIDType(interfaceType); @@ -128,7 +128,7 @@ struct AssociatedTypeLookupSpecializationContext // Ignore lookups for RTTI objects for now, since they are not used anywhere. if (!as(inst->getDataType())) { - IRBuilder builder(sharedContext->sharedBuilderStorage); + IRBuilder builder(sharedContext->module); builder.setInsertBefore(inst); auto uint2Type = builder.getVectorType( builder.getUIntType(), builder.getIntValue(builder.getIntType(), 2)); @@ -154,7 +154,7 @@ struct AssociatedTypeLookupSpecializationContext func = createWitnessTableLookupFunc(interfaceType, key); sharedContext->mapInterfaceRequirementKeyToDispatchMethods[key] = func; } - IRBuilder builder(sharedContext->sharedBuilderStorage); + IRBuilder builder(sharedContext->module); builder.setInsertBefore(inst); auto witnessTableArg = inst->getWitnessTable(); if (witnessTableArg->getDataType()->getOp() == kIROp_WitnessTableType) @@ -172,7 +172,7 @@ struct AssociatedTypeLookupSpecializationContext // If the operand is a witness table, it is already replaced with a uint2 // at this point, where the first element in the uint2 is the id of the // witness table. - IRBuilder builder(sharedContext->sharedBuilderStorage); + IRBuilder builder(sharedContext->module); builder.setInsertBefore(inst); UInt index = 0; auto id = builder.emitSwizzle(builder.getUIntType(), inst->getRTTIOperand(), 1, &index); @@ -206,7 +206,7 @@ struct AssociatedTypeLookupSpecializationContext { return; } - IRBuilder builder(sharedContext->sharedBuilderStorage); + IRBuilder builder(sharedContext->module); builder.setInsertBefore(use->getUser()); auto uint2Type = builder.getVectorType( builder.getUIntType(), builder.getIntValue(builder.getIntType(), 2)); @@ -224,7 +224,7 @@ struct AssociatedTypeLookupSpecializationContext { if (globalInst->getOp() == kIROp_WitnessTableType) { - IRBuilder builder(sharedContext->sharedBuilderStorage); + IRBuilder builder(sharedContext->module); builder.setInsertBefore(globalInst); auto witnessTableIDType = builder.getWitnessTableIDType( (IRType*)cast(globalInst)->getConformanceType()); @@ -234,7 +234,6 @@ struct AssociatedTypeLookupSpecializationContext return; builder.replaceOperand(use, witnessTableIDType); }); - sharedContext->sharedBuilderStorage.deduplicateAndRebuildGlobalNumberingMap(); } } -- cgit v1.2.3