diff options
Diffstat (limited to 'source/slang/lower-to-ir.cpp')
| -rw-r--r-- | source/slang/lower-to-ir.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source/slang/lower-to-ir.cpp b/source/slang/lower-to-ir.cpp index 2e9915669..a7be244c8 100644 --- a/source/slang/lower-to-ir.cpp +++ b/source/slang/lower-to-ir.cpp @@ -1608,6 +1608,24 @@ struct ValLoweringVisitor : ValVisitor<ValLoweringVisitor, LoweredValInfo, Lower return LoweredValInfo::simple(irType); } + LoweredValInfo visitExistentialSpecializedType(ExistentialSpecializedType* type) + { + auto irBaseType = lowerType(context, type->baseType); + + List<IRInst*> slotArgs; + for(auto arg : type->slots.args) + { + auto irArgType = lowerType(context, arg.type); + auto irArgWitness = lowerSimpleVal(context, arg.witness); + + slotArgs.add(irArgType); + slotArgs.add(irArgWitness); + } + + auto irType = getBuilder()->getBindExistentialsType(irBaseType, slotArgs.getCount(), slotArgs.getBuffer()); + return LoweredValInfo::simple(irType); + } + // We do not expect to encounter the following types in ASTs that have // passed front-end semantic checking. #define UNEXPECTED_CASE(NAME) IRType* visit##NAME(NAME*) { SLANG_UNEXPECTED(#NAME); UNREACHABLE_RETURN(nullptr); } |
