diff options
| author | Yong He <yonghe@outlook.com> | 2023-02-16 16:44:04 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-16 16:44:04 -0800 |
| commit | 245466d89cfe54b78da486f06d470bc6daaf4625 (patch) | |
| tree | 522e0af1a9d2756182e143cdc85031ea1bbc2aa0 /source/slang/slang-ir-specialize-dynamic-associatedtype-lookup.cpp | |
| parent | 4c4826d47eeef4675daae4ae53ff76f4d5ebd84a (diff) | |
Remove `SharedIRBuilder`. (#2657)
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ir-specialize-dynamic-associatedtype-lookup.cpp')
| -rw-r--r-- | source/slang/slang-ir-specialize-dynamic-associatedtype-lookup.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
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<IRWitnessTableType>(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<IRWitnessTableType>(globalInst)->getConformanceType()); @@ -234,7 +234,6 @@ struct AssociatedTypeLookupSpecializationContext return; builder.replaceOperand(use, witnessTableIDType); }); - sharedContext->sharedBuilderStorage.deduplicateAndRebuildGlobalNumberingMap(); } } |
