From 7bcc2b15c8be4aebc6b9b8f05af6db7a451b228b Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 10 Nov 2020 14:55:36 -0800 Subject: Use integer RTTI/witness handles in existential tuples. (#1598) * Use integer RTTI/witness handles in existential tuples. * Fix clang error. * Fix IR serialization to use 16bits for opcode. * Undo accidental comment change. * Use variable length encoding for opcode. * Fix compile error. * Fixing issues * Fix code review issues. --- source/slang/slang-ir-lower-existential.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source/slang/slang-ir-lower-existential.cpp') diff --git a/source/slang/slang-ir-lower-existential.cpp b/source/slang/slang-ir-lower-existential.cpp index 0dce96de2..a87169ac3 100644 --- a/source/slang/slang-ir-lower-existential.cpp +++ b/source/slang/slang-ir-lower-existential.cpp @@ -23,12 +23,13 @@ namespace Slang auto value = inst->getWrappedValue(); auto valueType = sharedContext->lowerType(builder, value->getDataType()); - auto witnessTableType = cast(inst->getWitnessTable()->getDataType()); + auto witnessTableType = cast(inst->getWitnessTable()->getDataType()); auto interfaceType = witnessTableType->getConformanceType(); + auto witnessTableIdType = builder->getWitnessTableIDType((IRType*)interfaceType); auto anyValueSize = sharedContext->getInterfaceAnyValueSize(interfaceType, inst->sourceLoc); auto anyValueType = builder->getAnyValueType(anyValueSize); - auto rttiType = builder->getPtrType(builder->getRTTIType()); - auto tupleType = builder->getTupleType(rttiType, witnessTableType, anyValueType); + auto rttiType = builder->getRTTIHandleType(); + auto tupleType = builder->getTupleType(rttiType, witnessTableIdType, anyValueType); IRInst* rttiObject = inst->getRTTI(); if (auto type = as(rttiObject)) -- cgit v1.2.3