diff options
Diffstat (limited to 'source/slang/ir-link.cpp')
| -rw-r--r-- | source/slang/ir-link.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/source/slang/ir-link.cpp b/source/slang/ir-link.cpp index 2eef10614..fd9f1222e 100644 --- a/source/slang/ir-link.cpp +++ b/source/slang/ir-link.cpp @@ -731,6 +731,23 @@ IRFunc* specializeIRForEntryPoint( clonedVal = specializeGeneric(clonedSpec); } + // TODO: If there is an existential-related decoration + // on the entry point, we need to transfer it over + // to the specialized function. + if( auto bindExistentialSlots = originalVal->findDecorationImpl(kIROp_BindExistentialSlotsDecoration) ) + { + if( !clonedVal->findDecorationImpl(kIROp_BindExistentialSlotsDecoration) ) + { + IRBuilder builderStorage = *context->builder; + IRBuilder* builder = &builderStorage; + builder->setInsertInto(clonedVal); + + auto clonedBind = cloneInst(context, builder, bindExistentialSlots); + clonedBind->moveToStart(); + } + } + + auto clonedFunc = as<IRFunc>(clonedVal); if(!clonedFunc) { @@ -1315,6 +1332,14 @@ LinkedIR linkIR( cloneValue(context, bindInst); } + for(auto inst : originalProgramIRModule->getGlobalInsts()) + { + if(inst->op != kIROp_BindGlobalExistentialSlots) + continue; + + cloneValue(context, inst); + } + // HACK: we need to ensure that any tagged union types // in the IR module have layout information copied over to them. // |
