summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-link.cpp
diff options
context:
space:
mode:
authorDietrich Geisler <dgeisler50@gmail.com>2020-06-29 17:42:12 -0400
committerGitHub <noreply@github.com>2020-06-29 14:42:12 -0700
commit47b43f8b15ef35c520b9b287fd17ff25e36bfe95 (patch)
treefed30013e307f9ee17700ab7e8839bee56f104e1 /source/slang/slang-ir-link.cpp
parent3e8bdb60afb5b0c0a53ce06d1dbbc429988f5885 (diff)
Backend for Multiple Entry Points (#1411)
* Backend for Multiple Entry Points Introduces the basic backend on the compiler for zero or more entry points. Entry points have been extended to lists for several functions, with loopFunctions have been extended to take in entry points and indices as appropriate, to allow for multiple entry points once the frontend is expanded. Several functions are currently being assumed to have a single entry point for simplicity and provide a work in progress commit. * Progress on debugging fixes * Tests passing * Refactored emitEntryPoints * Updated lists to be by constant reference * Fixes to formatting * Refactoring updates for the compiler * Fix for compilation errors * Reformatting * More reformatting * Moved struct around to help with compilation Co-authored-by: Tim Foley <tfoleyNV@users.noreply.github.com>
Diffstat (limited to 'source/slang/slang-ir-link.cpp')
-rw-r--r--source/slang/slang-ir-link.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/source/slang/slang-ir-link.cpp b/source/slang/slang-ir-link.cpp
index f80f97aff..f1f6d4cd4 100644
--- a/source/slang/slang-ir-link.cpp
+++ b/source/slang/slang-ir-link.cpp
@@ -1346,9 +1346,10 @@ struct IRSpecializationState
}
};
+// TODO(DG): Generalize to multiple entry points
LinkedIR linkIR(
BackEndCompileRequest* compileRequest,
- Int entryPointIndex,
+ List<Int> entryPointIndices,
CodeGenTarget target,
TargetProgram* targetProgram)
{
@@ -1446,7 +1447,11 @@ LinkedIR linkIR(
// arguments which might end up affecting the mangled
// entry point name.
//
- auto entryPointMangledName = program->getEntryPointMangledName(entryPointIndex);
+ // TODO(DG): spot to generalize to multiple entry points
+ // Note that only stuff referenced by an entry point gets linked here
+ // Temporary assertion for checkpoint
+ SLANG_ASSERT(entryPointIndices.getCount() == 1);
+ auto entryPointMangledName = program->getEntryPointMangledName(entryPointIndices[0]);
auto irEntryPoint = specializeIRForEntryPoint(context, entryPointMangledName);
// Bindings for global generic parameters are currently represented