summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-lower-existential.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-07-25 10:08:28 -0700
committerGitHub <noreply@github.com>2022-07-25 10:08:28 -0700
commit9566e8af25f87ad034a984db9d847942e454a180 (patch)
tree2f295bf2bf60c39fd35b6b634b903d574b4ca99e /source/slang/slang-ir-lower-existential.cpp
parent70147fc7ba6abe0b669363ed5adfd8d4d9545c3f (diff)
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 <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ir-lower-existential.cpp')
-rw-r--r--source/slang/slang-ir-lower-existential.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/slang/slang-ir-lower-existential.cpp b/source/slang/slang-ir-lower-existential.cpp
index b0d9e6f2f..cfdacc7ac 100644
--- a/source/slang/slang-ir-lower-existential.cpp
+++ b/source/slang/slang-ir-lower-existential.cpp
@@ -24,6 +24,8 @@ namespace Slang
auto valueType = sharedContext->lowerType(builder, value->getDataType());
auto witnessTableType = cast<IRWitnessTableTypeBase>(inst->getWitnessTable()->getDataType());
auto interfaceType = witnessTableType->getConformanceType();
+ if (interfaceType->findDecoration<IRComInterfaceDecoration>())
+ return;
auto witnessTableIdType = builder->getWitnessTableIDType((IRType*)interfaceType);
auto anyValueSize = sharedContext->getInterfaceAnyValueSize(interfaceType, inst->sourceLoc);
auto anyValueType = builder->getAnyValueType(anyValueSize);
@@ -139,7 +141,10 @@ namespace Slang
IRBuilder builderStorage(sharedContext->sharedBuilderStorage);
auto builder = &builderStorage;
builder->setInsertBefore(inst);
-
+ if (inst->getDataType()->getOp() == kIROp_ClassType)
+ {
+ return;
+ }
// A value of interface will lower as a tuple, and
// the third element of that tuple represents the
// concrete value that was put into the existential.