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-emit.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'source/slang/slang-emit.cpp') diff --git a/source/slang/slang-emit.cpp b/source/slang/slang-emit.cpp index fbddd2910..baa020b6d 100644 --- a/source/slang/slang-emit.cpp +++ b/source/slang/slang-emit.cpp @@ -664,18 +664,10 @@ Result linkAndOptimizeIR( break; } - switch (target) - { - case CodeGenTarget::CPPSource: - case CodeGenTarget::CUDASource: - break; - default: - // For all targets that don't support true dynamic dispatch through - // witness tables, we need to eliminate witness tables from the IR so - // that they don't keep symbols live that we don't actually need. - stripWitnessTables(irModule); - break; - } + // TODO: our current dynamic dispatch pass will remove all uses of witness tables. + // If we are going to support function-pointer based, "real" modular dynamic dispatch, + // we will need to disable this pass. + stripWitnessTables(irModule); #if 0 dumpIRIfEnabled(compileRequest, irModule, "AFTER STRIP WITNESS TABLES"); -- cgit v1.2.3