diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2020-06-18 16:39:06 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-18 13:39:06 -0700 |
| commit | 5952e3b3d7f505a7e6d71ecd0793911224f5bac3 (patch) | |
| tree | aa2fe85ae3ac6af4db98654489592120ab1a1f17 /source/core | |
| parent | dfbe3cfcdb308cdb0f89cb2844fb3aba96cfcaec (diff) | |
Prelude is associated with SourceLanguage (#1398)
* Associate a downstream compiler for prelude lookup even if output is source.
* Remove LanguageStyle and just use SourceLanguage instread.
* Added set/getPrelude.
Made prelude work on source language.
* Fix typo in method name replacement.
get/SetPrelude get/setLanguagePrelude
* Fix issue because of method name change.
* Remove getPreludeDownstreamCompilerForTarget
Diffstat (limited to 'source/core')
| -rw-r--r-- | source/core/slang-test-tool-util.cpp | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/source/core/slang-test-tool-util.cpp b/source/core/slang-test-tool-util.cpp index 3b89321a1..f8e163758 100644 --- a/source/core/slang-test-tool-util.cpp +++ b/source/core/slang-test-tool-util.cpp @@ -59,19 +59,9 @@ static SlangResult _addCPPPrelude(const String& parentPath, slang::IGlobalSessio { String includePath; SLANG_RETURN_ON_FAIL(_calcIncludePath(parentPath, "../../../prelude/slang-cpp-prelude.h", includePath)); - StringBuilder prelude; prelude << "#include \"" << includePath << "\"\n\n"; - const SlangPassThrough downstreamCompilers[] = { - SLANG_PASS_THROUGH_CLANG, ///< Clang C/C++ compiler - SLANG_PASS_THROUGH_VISUAL_STUDIO, ///< Visual studio C/C++ compiler - SLANG_PASS_THROUGH_GCC, ///< GCC C/C++ compiler - SLANG_PASS_THROUGH_GENERIC_C_CPP, - }; - for (auto downstreamCompiler : downstreamCompilers) - { - session->setDownstreamCompilerPrelude(downstreamCompiler, prelude.getBuffer()); - } + session->setLanguagePrelude(SLANG_SOURCE_LANGUAGE_CPP, prelude.getBuffer()); return SLANG_OK; } @@ -79,16 +69,9 @@ static SlangResult _addCUDAPrelude(const String& parentPath, slang::IGlobalSessi { String includePath; SLANG_RETURN_ON_FAIL(_calcIncludePath(parentPath, "../../../prelude/slang-cuda-prelude.h", includePath)); - StringBuilder prelude; prelude << "#include \"" << includePath << "\"\n\n"; - const SlangPassThrough downstreamCompilers[] = { - SLANG_PASS_THROUGH_NVRTC, ///< nvrtc CUDA compiler - }; - for (auto downstreamCompiler : downstreamCompilers) - { - session->setDownstreamCompilerPrelude(downstreamCompiler, prelude.getBuffer()); - } + session->setLanguagePrelude(SLANG_SOURCE_LANGUAGE_CUDA, prelude.getBuffer()); return SLANG_OK; } |
