From 444ff4d8fdeb721b94a9424d03c162f43fb217c9 Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 6 Nov 2020 10:26:27 -0800 Subject: Specialize witness table lookups. (#1596) * Specialize witness table lookups. * Remove generated files from vcxproj * Fix call to generic interface methods. --- source/slang/slang-ir-generics-lowering-context.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source/slang/slang-ir-generics-lowering-context.cpp') diff --git a/source/slang/slang-ir-generics-lowering-context.cpp b/source/slang/slang-ir-generics-lowering-context.cpp index 9c4eb7856..bef4dbb0a 100644 --- a/source/slang/slang-ir-generics-lowering-context.cpp +++ b/source/slang/slang-ir-generics-lowering-context.cpp @@ -219,6 +219,21 @@ namespace Slang } } + List SharedGenericsLoweringContext::getWitnessTablesFromInterfaceType(IRInst* interfaceType) + { + List witnessTables; + for (auto globalInst : module->getGlobalInsts()) + { + if (globalInst->op == kIROp_WitnessTable && + cast(globalInst->getDataType())->getConformanceType() == + interfaceType) + { + witnessTables.add(cast(globalInst)); + } + } + return witnessTables; + } + IRIntegerValue SharedGenericsLoweringContext::getInterfaceAnyValueSize(IRInst* type, SourceLoc usageLocation) { if (auto decor = type->findDecoration()) -- cgit v1.2.3