From 9566e8af25f87ad034a984db9d847942e454a180 Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 25 Jul 2022 10:08:28 -0700 Subject: Allow `class` to implement COM interface, [DLLExport] (#2338) * Allow `class` to implement COM interface, [DLLExport] * Fix [COM] usage in tests and examples with UUIDs. Co-authored-by: Yong He --- source/slang/slang-ir-util.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source/slang/slang-ir-util.cpp') diff --git a/source/slang/slang-ir-util.cpp b/source/slang/slang-ir-util.cpp index fda7b25cc..a515217d9 100644 --- a/source/slang/slang-ir-util.cpp +++ b/source/slang/slang-ir-util.cpp @@ -12,6 +12,18 @@ bool isPointerOfType(IRInst* type, IROp opCode) return false; } +Dictionary buildInterfaceRequirementDict(IRInterfaceType* interfaceType) +{ + Dictionary result; + for (UInt i = 0; i < interfaceType->getOperandCount(); i++) + { + auto entry = as(interfaceType->getOperand(i)); + if (!entry) continue; + result[entry->getRequirementKey()] = entry->getRequirementVal(); + } + return result; +} + bool isPointerOfType(IRInst* type, IRInst* elementType) { if (auto ptrType = as(type)) -- cgit v1.2.3