diff options
| author | Yong He <yonghe@outlook.com> | 2020-08-05 10:32:52 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-05 10:32:52 -0700 |
| commit | 6fb2aa70a2681bffbac7e8de67e9598105389945 (patch) | |
| tree | f89cb433e7498bf74292bf460096f1129ef3ac13 /source/slang/slang-emit.cpp | |
| parent | 092337a67e7ef8ec108cab9cb6679e59bb2ff791 (diff) | |
`AnyValue` based dynamic dispatch code gen (#1477)
* AnyValue based dynamic code gen
* Fix aarch64 build error
Diffstat (limited to 'source/slang/slang-emit.cpp')
| -rw-r--r-- | source/slang/slang-emit.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
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; |
