From 6fb2aa70a2681bffbac7e8de67e9598105389945 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 5 Aug 2020 10:32:52 -0700 Subject: `AnyValue` based dynamic dispatch code gen (#1477) * AnyValue based dynamic code gen * Fix aarch64 build error --- source/slang/slang-emit.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'source/slang/slang-emit.cpp') diff --git a/source/slang/slang-emit.cpp b/source/slang/slang-emit.cpp index af01e4b0d..31ff3c4f9 100644 --- a/source/slang/slang-emit.cpp +++ b/source/slang/slang-emit.cpp @@ -311,12 +311,18 @@ Result linkAndOptimizeIR( // generics / interface types to ordinary functions and types using // function pointers. if (compileRequest->allowDynamicCode) - lowerGenerics(irModule); + { + lowerGenerics(irModule, sink); + dumpIRIfEnabled(compileRequest, irModule, "LOWER-GENERICS"); + } break; default: break; } + if (sink->getErrorCount() != 0) + return SLANG_FAIL; + // TODO(DG): There are multiple DCE steps here, which need to be changed // so that they don't just throw out any non-entry point code // Debugging code for IR transformations... @@ -775,13 +781,13 @@ SlangResult emitEntryPointsSourceFromIR( break; } - linkAndOptimizeIR( + SLANG_RETURN_ON_FAIL(linkAndOptimizeIR( compileRequest, entryPointIndices, target, targetRequest, linkingAndOptimizationOptions, - linkedIR); + linkedIR)); auto irModule = linkedIR.module; @@ -862,13 +868,13 @@ SlangResult emitSPIRVForEntryPointsDirectly( // Outside because we want to keep IR in scope whilst we are processing emits LinkedIR linkedIR; LinkingAndOptimizationOptions linkingAndOptimizationOptions; - linkAndOptimizeIR( + SLANG_RETURN_ON_FAIL(linkAndOptimizeIR( compileRequest, entryPointIndices, targetRequest->getTarget(), targetRequest, linkingAndOptimizationOptions, - linkedIR); + linkedIR)); auto irModule = linkedIR.module; auto irEntryPoints = linkedIR.entryPoints; -- cgit v1.2.3