diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2021-10-20 10:32:50 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-20 10:32:50 -0400 |
| commit | deb638f446863ab38248a9568553a1eab47ca086 (patch) | |
| tree | 5a37ac31dce2b15b5079f8f67b268d7ef652e939 /source/compiler-core | |
| parent | 8406244e27c142ea56c7a934b09e0b1cdace6afd (diff) | |
Selecting downstream compiler on code gen transition (#1980)
* #include an absolute path didn't work - because paths were taken to always be relative.
* Add support for LLVM for host callable.
Added CodeGenTransitionMap.
* Remove hack to enable host callable for LLVM.
* Small improvements around transitions/downstream compiler.
* Fix typo in method name.
* Fix comment.
Diffstat (limited to 'source/compiler-core')
| -rw-r--r-- | source/compiler-core/slang-downstream-compiler.cpp | 28 | ||||
| -rw-r--r-- | source/compiler-core/slang-downstream-compiler.h | 4 |
2 files changed, 1 insertions, 31 deletions
diff --git a/source/compiler-core/slang-downstream-compiler.cpp b/source/compiler-core/slang-downstream-compiler.cpp index 9312554ae..daf31c9eb 100644 --- a/source/compiler-core/slang-downstream-compiler.cpp +++ b/source/compiler-core/slang-downstream-compiler.cpp @@ -185,20 +185,6 @@ SlangResult DownstreamCompiler::disassemble(SlangCompileTarget sourceBlobTarget, return (info.sourceLanguageFlags & (SourceLanguageFlags(1) << int(sourceLanguage))) != 0; } -/* static */SlangCompileTarget DownstreamCompiler::getCompileTarget(SlangSourceLanguage sourceLanguage) -{ - switch (sourceLanguage) - { - case SLANG_SOURCE_LANGUAGE_HLSL: return SLANG_HLSL; - case SLANG_SOURCE_LANGUAGE_GLSL: return SLANG_GLSL; - case SLANG_SOURCE_LANGUAGE_C: return SLANG_C_SOURCE; - case SLANG_SOURCE_LANGUAGE_CPP: return SLANG_CPP_SOURCE; - case SLANG_SOURCE_LANGUAGE_CUDA: return SLANG_CUDA_SOURCE; - - default: return SLANG_TARGET_UNKNOWN; - } -} - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! DownstreamDiagnostics !!!!!!!!!!!!!!!!!!!!!!*/ Index DownstreamDiagnostics::getCountAtLeastSeverity(Diagnostic::Severity severity) const @@ -719,20 +705,6 @@ const DownstreamCompiler::Desc& DownstreamCompilerUtil::getCompiledWithDesc() case SLANG_SOURCE_LANGUAGE_CPP: case SLANG_SOURCE_LANGUAGE_C: { - -#if 0 - // TODO(JS): We can't just enable this because we can currently only use slang-llvm, if we want to 'host-callable' - // It *can't* handle pass through (the includes are not available with just the dll), - // As it stands it doesn't support ext/obj/shared library output - - // If we have LLVM, lets use that as the default - { - DownstreamCompiler::Desc desc; - desc.type = SLANG_PASS_THROUGH_LLVM; - compiler = findCompiler(set, MatchType::Newest, desc); - } -#endif - // Find the compiler closest to the compiler this was compiled with if (!compiler) { diff --git a/source/compiler-core/slang-downstream-compiler.h b/source/compiler-core/slang-downstream-compiler.h index 1e6571e0f..58b7c5be0 100644 --- a/source/compiler-core/slang-downstream-compiler.h +++ b/source/compiler-core/slang-downstream-compiler.h @@ -360,9 +360,7 @@ public: /// True if this compiler can compile the specified language static bool canCompile(SlangPassThrough compiler, SlangSourceLanguage sourceLanguage); - /// Given a source language return as the equivalent compile target - static SlangCompileTarget getCompileTarget(SlangSourceLanguage sourceLanguage); - + protected: static Infos s_infos; |
