summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build/visual-studio/compiler-core/compiler-core.vcxproj2
-rw-r--r--build/visual-studio/compiler-core/compiler-core.vcxproj.filters6
-rw-r--r--deps/target-deps.json10
-rw-r--r--source/compiler-core/slang-downstream-dep1.cpp313
-rw-r--r--source/compiler-core/slang-downstream-dep1.h200
-rw-r--r--source/compiler-core/slang-llvm-compiler.cpp28
6 files changed, 9 insertions, 550 deletions
diff --git a/build/visual-studio/compiler-core/compiler-core.vcxproj b/build/visual-studio/compiler-core/compiler-core.vcxproj
index 8bddbaee3..851f94a05 100644
--- a/build/visual-studio/compiler-core/compiler-core.vcxproj
+++ b/build/visual-studio/compiler-core/compiler-core.vcxproj
@@ -268,7 +268,6 @@
<ClInclude Include="..\..\..\source\compiler-core\slang-downstream-compiler-set.h" />
<ClInclude Include="..\..\..\source\compiler-core\slang-downstream-compiler-util.h" />
<ClInclude Include="..\..\..\source\compiler-core\slang-downstream-compiler.h" />
- <ClInclude Include="..\..\..\source\compiler-core\slang-downstream-dep1.h" />
<ClInclude Include="..\..\..\source\compiler-core\slang-dxc-compiler.h" />
<ClInclude Include="..\..\..\source\compiler-core\slang-fxc-compiler.h" />
<ClInclude Include="..\..\..\source\compiler-core\slang-gcc-compiler-util.h" />
@@ -314,7 +313,6 @@
<ClCompile Include="..\..\..\source\compiler-core\slang-downstream-compiler-set.cpp" />
<ClCompile Include="..\..\..\source\compiler-core\slang-downstream-compiler-util.cpp" />
<ClCompile Include="..\..\..\source\compiler-core\slang-downstream-compiler.cpp" />
- <ClCompile Include="..\..\..\source\compiler-core\slang-downstream-dep1.cpp" />
<ClCompile Include="..\..\..\source\compiler-core\slang-dxc-compiler.cpp" />
<ClCompile Include="..\..\..\source\compiler-core\slang-fxc-compiler.cpp" />
<ClCompile Include="..\..\..\source\compiler-core\slang-gcc-compiler-util.cpp" />
diff --git a/build/visual-studio/compiler-core/compiler-core.vcxproj.filters b/build/visual-studio/compiler-core/compiler-core.vcxproj.filters
index 898f2d2ba..18e9a6b94 100644
--- a/build/visual-studio/compiler-core/compiler-core.vcxproj.filters
+++ b/build/visual-studio/compiler-core/compiler-core.vcxproj.filters
@@ -63,9 +63,6 @@
<ClInclude Include="..\..\..\source\compiler-core\slang-downstream-compiler.h">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="..\..\..\source\compiler-core\slang-downstream-dep1.h">
- <Filter>Header Files</Filter>
- </ClInclude>
<ClInclude Include="..\..\..\source\compiler-core\slang-dxc-compiler.h">
<Filter>Header Files</Filter>
</ClInclude>
@@ -197,9 +194,6 @@
<ClCompile Include="..\..\..\source\compiler-core\slang-downstream-compiler.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="..\..\..\source\compiler-core\slang-downstream-dep1.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="..\..\..\source\compiler-core\slang-dxc-compiler.cpp">
<Filter>Source Files</Filter>
</ClCompile>
diff --git a/deps/target-deps.json b/deps/target-deps.json
index 142265d2f..f9b18f60c 100644
--- a/deps/target-deps.json
+++ b/deps/target-deps.json
@@ -4,14 +4,14 @@
"dependencies" : [
{
"name" : "slang-llvm",
- "baseUrl" : "https://github.com/shader-slang/slang-llvm/releases/download/v13.x-29/",
+ "baseUrl" : "https://github.com/shader-slang/slang-llvm/releases/download/v13.x-30/",
"optional" : true,
"packages" :
{
- "windows-x86_64" : { "type" : "url", "path" : "slang-llvm-13.x-29-win64.zip" },
- "windows-x86" : { "type": "url", "path" : "slang-llvm-13.x-29-win32.zip" },
- "linux-x86_64" : { "type": "url", "path" : "slang-llvm-v13.x-29-linux-x86_64-release.zip" },
- "macosx-x86_64" : { "type": "url", "path" : "slang-llvm-v13.x-29-macosx-x86_64-release.zip" }
+ "windows-x86_64" : { "type" : "url", "path" : "slang-llvm-13.x-30-win64.zip" },
+ "windows-x86" : { "type": "url", "path" : "slang-llvm-13.x-30-win32.zip" },
+ "linux-x86_64" : { "type": "url", "path" : "slang-llvm-v13.x-30-linux-x86_64-release.zip" },
+ "macosx-x86_64" : { "type": "url", "path" : "slang-llvm-v13.x-30-macosx-x86_64-release.zip" }
}
},
{
diff --git a/source/compiler-core/slang-downstream-dep1.cpp b/source/compiler-core/slang-downstream-dep1.cpp
deleted file mode 100644
index c62fc77fc..000000000
--- a/source/compiler-core/slang-downstream-dep1.cpp
+++ /dev/null
@@ -1,313 +0,0 @@
-// slang-downstream-dep1.cpp
-#include "slang-downstream-dep1.h"
-
-#include "slang-artifact-util.h"
-#include "slang-artifact-associated-impl.h"
-#include "slang-artifact-desc-util.h"
-
-#include "../core/slang-castable-util.h"
-#include "../core/slang-string-util.h"
-
-#include "slang-slice-allocator.h"
-
-namespace Slang
-{
-
-/* !!!!!!!!!!!!!!!!!!!!!!!!! DownstreamArtifactRepresentation_Dep1 !!!!!!!!!!!!!!!!!!!!!!!! */
-
-class DownstreamResultArtifactRepresentationAdapater_Dep1 : public ComBaseObject, public IArtifactRepresentation
-{
-public:
- SLANG_COM_BASE_IUNKNOWN_ALL
-
- // ICastable
- virtual SLANG_NO_THROW void* SLANG_MCALL castAs(const SlangUUID& guid) SLANG_OVERRIDE;
-
- // IArtifactRepresentation
- virtual SLANG_NO_THROW SlangResult SLANG_MCALL createRepresentation(const Guid& typeGuid, ICastable** outCastable) SLANG_OVERRIDE;
- virtual SLANG_NO_THROW bool SLANG_MCALL exists() SLANG_OVERRIDE { return true; }
-
- DownstreamResultArtifactRepresentationAdapater_Dep1(DownstreamCompileResult_Dep1* result):
- m_result(result)
- {
- }
-
- void* getInterface(const Guid& guid);
- void* getObject(const Guid& guid);
-
- RefPtr<DownstreamCompileResult_Dep1> m_result;
-};
-
-void* DownstreamResultArtifactRepresentationAdapater_Dep1::castAs(const SlangUUID& guid)
-{
- if (auto ptr = getInterface(guid))
- {
- return ptr;
- }
- return getObject(guid);
-}
-
-void* DownstreamResultArtifactRepresentationAdapater_Dep1::getInterface(const Guid& guid)
-{
- if (guid == ISlangUnknown::getTypeGuid() ||
- guid == ICastable::getTypeGuid() ||
- guid == IArtifactRepresentation::getTypeGuid())
- {
- IArtifactRepresentation* rep = this;
- return rep;
- }
- return nullptr;
-}
-
-void* DownstreamResultArtifactRepresentationAdapater_Dep1::getObject(const Guid& guid)
-{
- SLANG_UNUSED(guid);
- return nullptr;
-}
-
-SlangResult DownstreamResultArtifactRepresentationAdapater_Dep1::createRepresentation(const Guid& typeGuid, ICastable** outCastable)
-{
- if (typeGuid == ISlangSharedLibrary::getTypeGuid())
- {
- ComPtr<ISlangSharedLibrary> lib;
- SLANG_RETURN_ON_FAIL(DownstreamUtil_Dep1::getDownstreamSharedLibrary(m_result, lib));
-
- *outCastable = lib.detach();
- return SLANG_OK;
- }
- else if (typeGuid == ISlangBlob::getTypeGuid())
- {
- ComPtr<ISlangBlob> blob;
- SLANG_RETURN_ON_FAIL(m_result->getBinary(blob));
-
- *outCastable = CastableUtil::getCastable(blob).detach();
- return SLANG_OK;
- }
-
- return SLANG_E_NOT_AVAILABLE;
-}
-
-/* !!!!!!!!!!!!!!!!!!!!!!!!! DownstreamCompilerAdapter_Dep1 !!!!!!!!!!!!!!!!!!!!!!!! */
-
-DownstreamCompilerAdapter_Dep1::DownstreamCompilerAdapter_Dep1(DownstreamCompiler_Dep1* dep, ArtifactPayload disassemblyPayload) :
- m_dep(dep),
- m_disassemblyPayload(disassemblyPayload)
-{
- auto desc = dep->getDesc();
- m_desc = DownstreamCompilerDesc(desc.type, desc.majorVersion, desc.minorVersion);
-}
-SlangResult DownstreamCompilerAdapter_Dep1::compile(const CompileOptions& inOptions, IArtifact** outArtifact)
-{
- // Currently this only for llvm, so we'll just ignore other scenarios
- if (inOptions.sourceArtifacts.count != 1)
- {
- return SLANG_FAIL;
- }
-
- IArtifact* sourceArtifact = inOptions.sourceArtifacts[0];
-
- typedef DownstreamCompileOptions_Dep1::SomeEnum SomeEnum;
-
- // Convert to the Deps1 compile options
-
- DownstreamCompileOptions_Dep1 options;
-
- options.optimizationLevel = SomeEnum(inOptions.optimizationLevel);
- options.debugInfoType = SomeEnum(inOptions.debugInfoType);
- options.targetType = inOptions.targetType;
- options.sourceLanguage = inOptions.sourceLanguage;
- options.floatingPointMode = SomeEnum(inOptions.floatingPointMode);
- options.pipelineType = SomeEnum(inOptions.pipelineType);
- options.matrixLayout = inOptions.matrixLayout;
-
- options.flags = inOptions.flags;
- options.platform = SomeEnum(inOptions.platform);
-
- options.modulePath = asString(inOptions.modulePath);
-
- for (auto& src : inOptions.defines)
- {
- DownstreamCompileOptions_Dep1::Define dst;
-
- dst.nameWithSig = asStringSlice(src.nameWithSig);
- dst.value = asStringSlice(src.value);
-
- options.defines.add(dst);
- }
-
- ComPtr<ISlangBlob> blob;
- SLANG_RETURN_ON_FAIL(sourceArtifact->loadBlob(ArtifactKeep::Yes, blob.writeRef()));
-
- options.sourceContents = StringUtil::getString(blob);
- options.sourceContentsPath = ArtifactUtil::findPath(sourceArtifact);
-
- options.includePaths = SliceUtil::toList(inOptions.includePaths);
- options.libraryPaths = SliceUtil::toList(inOptions.libraryPaths);
-
- options.libraries = SliceUtil::toComPtrList(inOptions.libraries);
-
- for (auto& src : inOptions.requiredCapabilityVersions)
- {
- DownstreamCompileOptions_Dep1::CapabilityVersion capVer;
- capVer.kind = SomeEnum(src.kind);
-
- auto& srcVer = src.version;
-
- capVer.version.m_major = srcVer.m_major;
- capVer.version.m_minor = srcVer.m_minor;
- capVer.version.m_patch = uint16_t(srcVer.m_patch);
-
- options.requiredCapabilityVersions.add(capVer);
- }
-
- options.entryPointName = asStringSlice(inOptions.entryPointName);
- options.profileName = asStringSlice(inOptions.profileName);
-
- options.stage = inOptions.stage;
-
- options.compilerSpecificArguments = SliceUtil::toList(inOptions.compilerSpecificArguments);
-
- options.fileSystemExt = inOptions.fileSystemExt;
- options.sourceManager = inOptions.sourceManager;
-
- RefPtr<DownstreamCompileResult_Dep1> result;
- SLANG_RETURN_ON_FAIL(m_dep->compile(options, result));
-
- ComPtr<IArtifact> artifact = ArtifactUtil::createArtifactForCompileTarget(options.targetType);
-
- // Convert the diagnostics
-
- auto dstDiagnostics = ArtifactDiagnostics::create();
- const DownstreamDiagnostics_Dep1* srcDiagnostics = &result->getDiagnostics();
-
- dstDiagnostics->setResult(srcDiagnostics->result);
- dstDiagnostics->setRaw(SliceUtil::asCharSlice(srcDiagnostics->rawDiagnostics));
-
- for (const auto& srcDiagnostic : srcDiagnostics->diagnostics)
- {
- IArtifactDiagnostics::Diagnostic dstDiagnostic;
-
- dstDiagnostic.severity = ArtifactDiagnostic::Severity(srcDiagnostic.severity);
- dstDiagnostic.stage = ArtifactDiagnostic::Stage(srcDiagnostic.stage);
-
- dstDiagnostic.code = SliceUtil::asTerminatedCharSlice(srcDiagnostic.code);
- dstDiagnostic.text = SliceUtil::asTerminatedCharSlice(srcDiagnostic.text);
- dstDiagnostic.filePath = SliceUtil::asTerminatedCharSlice(srcDiagnostic.filePath);
-
- dstDiagnostic.location.line = srcDiagnostic.fileLine;
-
- // Add the diagnostic
- dstDiagnostics->add(dstDiagnostic);
- }
-
- artifact->addAssociated(dstDiagnostics);
-
- // We need to add a representation that can produce shared libraries/blobs on demand
-
- auto rep = new DownstreamResultArtifactRepresentationAdapater_Dep1(result);
- artifact->addRepresentation(rep);
-
- *outArtifact = artifact.detach();
- return SLANG_OK;
-}
-
-bool DownstreamCompilerAdapter_Dep1::canConvert(const ArtifactDesc& from, const ArtifactDesc& to)
-{
- // Can only disassemble blobs that are DXBC
- return ArtifactDescUtil::isDissassembly(from, to) && from.payload == m_disassemblyPayload;
-}
-
-SlangResult DownstreamCompilerAdapter_Dep1::convert(IArtifact* from, const ArtifactDesc& to, IArtifact** outArtifact)
-{
- if (!canConvert(from->getDesc(), to))
- {
- return SLANG_FAIL;
- }
-
- ComPtr<ISlangBlob> fromBlob;
- SLANG_RETURN_ON_FAIL(from->loadBlob(ArtifactKeep::No, fromBlob.writeRef()));
-
- const auto compileTarget = ArtifactDescUtil::getCompileTargetFromDesc(from->getDesc());
-
- // Do the disassembly
- ComPtr<ISlangBlob> dstBlob;
- SLANG_RETURN_ON_FAIL(m_dep->disassemble(compileTarget, fromBlob->getBufferPointer(), fromBlob->getBufferSize(), dstBlob.writeRef()));
-
- auto artifact = ArtifactUtil::createArtifact(to);
-
- artifact->addRepresentationUnknown(dstBlob);
-
- *outArtifact = artifact.detach();
- return SLANG_OK;
-}
-
-/* !!!!!!!!!!!!!!!!!!!!!!!!! SharedLibraryDep1Adapter !!!!!!!!!!!!!!!!!!!!!!!! */
-
-// A temporary class that adapts `ISlangSharedLibrary_Dep1` to ISlangSharedLibrary
-class SharedLibraryAdapter_Dep1 : public ComBaseObject, public ISlangSharedLibrary
-{
-public:
- SLANG_COM_BASE_IUNKNOWN_ALL
-
- // ICastable
- virtual SLANG_NO_THROW void* SLANG_MCALL castAs(const SlangUUID& guid) SLANG_OVERRIDE;
-
- // ISlangSharedLibrary
- virtual SLANG_NO_THROW void* SLANG_MCALL findSymbolAddressByName(char const* name) SLANG_OVERRIDE { return m_contained->findSymbolAddressByName(name); }
-
- SharedLibraryAdapter_Dep1(ISlangSharedLibrary_Dep1* dep1) :
- m_contained(dep1)
- {
- }
-
-protected:
- void* getInterface(const Guid& guid)
- {
- if (guid == ISlangUnknown::getTypeGuid() ||
- guid == ICastable::getTypeGuid() ||
- guid == ISlangSharedLibrary::getTypeGuid())
- {
- return static_cast<ISlangSharedLibrary*>(this);
- }
- return nullptr;
- }
- void* getObject(const Guid& guid)
- {
- SLANG_UNUSED(guid);
- return nullptr;
- }
-
- ComPtr<ISlangSharedLibrary_Dep1> m_contained;
-};
-
-void* SharedLibraryAdapter_Dep1::castAs(const SlangUUID& guid)
-{
- if (auto intf = getInterface(guid))
- {
- return intf;
- }
- return getObject(guid);
-}
-
-/* Hack to take into account downstream compilers shared library interface might need an adapter */
-/* static */SlangResult DownstreamUtil_Dep1::getDownstreamSharedLibrary(DownstreamCompileResult_Dep1* downstreamResult, ComPtr<ISlangSharedLibrary>& outSharedLibrary)
-{
- ComPtr<ISlangSharedLibrary> lib;
- SLANG_RETURN_ON_FAIL(downstreamResult->getHostCallableSharedLibrary(lib));
-
- if (SLANG_SUCCEEDED(lib->queryInterface(ISlangSharedLibrary::getTypeGuid(), (void**)outSharedLibrary.writeRef())))
- {
- return SLANG_OK;
- }
-
- ComPtr<ISlangSharedLibrary_Dep1> libDep1;
- if (SLANG_SUCCEEDED(lib->queryInterface(ISlangSharedLibrary_Dep1::getTypeGuid(), (void**)libDep1.writeRef())))
- {
- // Okay, we need to adapt for now
- outSharedLibrary = new SharedLibraryAdapter_Dep1(libDep1);
- return SLANG_OK;
- }
- return SLANG_E_NOT_FOUND;
-}
-
-}
diff --git a/source/compiler-core/slang-downstream-dep1.h b/source/compiler-core/slang-downstream-dep1.h
deleted file mode 100644
index 94d3d73b8..000000000
--- a/source/compiler-core/slang-downstream-dep1.h
+++ /dev/null
@@ -1,200 +0,0 @@
-#ifndef SLANG_DOWNSTREAM_DEP1_H
-#define SLANG_DOWNSTREAM_DEP1_H
-
-
-#include "slang-downstream-compiler.h"
-
-namespace Slang
-{
-
-// (DEPRECIATED)
-
-
-struct SemanticVersion_Dep1
-{
- uint32_t m_major;
- uint16_t m_minor;
- uint16_t m_patch;
-};
-
-struct DownstreamCompileOptions_Dep1
-{
- typedef uint32_t Flags;
- enum class SomeEnum { First, B, C };
-
- struct Define
- {
- String nameWithSig; ///< If macro takes parameters include in brackets
- String value;
- };
-
- struct CapabilityVersion
- {
- SomeEnum kind;
- SemanticVersion_Dep1 version;
- };
-
- SomeEnum optimizationLevel = SomeEnum::First;
- SomeEnum debugInfoType = SomeEnum::First;
- SlangCompileTarget targetType = SLANG_HOST_EXECUTABLE;
- SlangSourceLanguage sourceLanguage = SLANG_SOURCE_LANGUAGE_CPP;
- SomeEnum floatingPointMode = SomeEnum::First;
- SomeEnum pipelineType = SomeEnum::First;
- SlangMatrixLayoutMode matrixLayout = SLANG_MATRIX_LAYOUT_MODE_UNKNOWN;
-
- Flags flags = 0;
-
- SomeEnum platform = SomeEnum::First;
-
- /// The path/name of the output module. Should not have the extension, as that will be added for each of the target types.
- /// If not set a module path will be internally generated internally on a command line based compiler
- String modulePath;
-
- List<Define> defines;
-
- /// The contents of the source to compile. This can be empty is sourceFiles is set.
- /// If the compiler is a commandLine file this source will be written to a temporary file.
- String sourceContents;
- /// 'Path' that the contents originated from. NOTE! This is for reporting only and doesn't have to exist on file system
- String sourceContentsPath;
-
- /// The names/paths of source to compile. This can be empty if sourceContents is set.
- List<String> sourceFiles;
-
- List<String> includePaths;
- List<String> libraryPaths;
-
- /// Libraries to link against.
- List<ComPtr<IArtifact>> libraries;
-
- List<CapabilityVersion> requiredCapabilityVersions;
-
- /// For compilers/compiles that require an entry point name, else can be empty
- String entryPointName;
- /// Profile name to use, only required for compiles that need to compile against a a specific profiles.
- /// Profile names are tied to compilers and targets.
- String profileName;
-
- /// The stage being compiled for
- SlangStage stage = SLANG_STAGE_NONE;
-
- /// Arguments that are specific to a particular compiler implementation.
- List<String> compilerSpecificArguments;
-
- /// NOTE! Not all downstream compilers can use the fileSystemExt/sourceManager. This option will be ignored in those scenarios.
- ISlangFileSystemExt* fileSystemExt = nullptr;
- SourceManager* sourceManager = nullptr;
-};
-
-// Compiler description
-struct DownstreamCompilerDesc_Dep1
-{
- SlangPassThrough type; ///< The type of the compiler
-
- /// TODO(JS): Would probably be better if changed to SemanticVersion, but not trivial to change
- // because this type is part of the DownstreamCompiler interface, which is used with `slang-llvm`.
- Int majorVersion; ///< Major version (interpretation is type specific)
- Int minorVersion; ///< Minor version (interpretation is type specific)
-};
-
-struct DownstreamDiagnostic_Dep1
-{
- enum class Severity
- {
- Unknown,
- Info,
- Warning,
- Error,
- CountOf,
- };
- enum class Stage
- {
- Compile,
- Link,
- };
-
- Severity severity = Severity::Unknown; ///< The severity of error
- Stage stage = Stage::Compile; ///< The stage the error came from
- String text; ///< The text of the error
- String code; ///< The compiler specific error code
- String filePath; ///< The path the error originated from
- Int fileLine = 0; ///< The line number the error came from
-};
-
-struct DownstreamDiagnostics_Dep1
-{
- typedef DownstreamDiagnostic_Dep1 Diagnostic;
-
- String rawDiagnostics;
-
- SlangResult result = SLANG_OK;
- List<Diagnostic> diagnostics;
-};
-
-class DownstreamCompileResult_Dep1 : public RefObject
-{
-public:
- SLANG_CLASS_GUID(0xdfc5d318, 0x8675, 0x40ef, { 0xbd, 0x7b, 0x4, 0xa4, 0xff, 0x66, 0x11, 0x30 })
-
- virtual SlangResult getHostCallableSharedLibrary(ComPtr<ISlangSharedLibrary>& outLibrary) { SLANG_UNUSED(outLibrary); return SLANG_FAIL; }
- virtual SlangResult getBinary(ComPtr<ISlangBlob>& outBlob) { SLANG_UNUSED(outBlob); return SLANG_FAIL; }
-
- const DownstreamDiagnostics_Dep1& getDiagnostics() const { return m_diagnostics; }
-
- /// Ctor
- DownstreamCompileResult_Dep1(const DownstreamDiagnostics_Dep1& diagnostics) :
- m_diagnostics(diagnostics)
- {}
-
-protected:
- DownstreamDiagnostics_Dep1 m_diagnostics;
-};
-
-class DownstreamCompiler_Dep1: public RefObject
-{
-public:
- typedef RefObject Super;
-
- /// Get the desc of this compiler
- const DownstreamCompilerDesc_Dep1& getDesc() const { return m_desc; }
- /// Compile using the specified options. The result is in resOut
- virtual SlangResult compile(const DownstreamCompileOptions_Dep1& options, RefPtr<DownstreamCompileResult_Dep1>& outResult) = 0;
- /// Some compilers have support converting a binary blob into disassembly. Output disassembly is held in the output blob
- virtual SlangResult disassemble(SlangCompileTarget sourceBlobTarget, const void* blob, size_t blobSize, ISlangBlob** out);
-
- /// True if underlying compiler uses file system to communicate source
- virtual bool isFileBased() = 0;
-
-protected:
-
- DownstreamCompilerDesc_Dep1 m_desc;
-};
-
-class DownstreamCompilerAdapter_Dep1 : public DownstreamCompilerBase
-{
-public:
- // IDownstreamCompiler
- virtual SLANG_NO_THROW const Desc& SLANG_MCALL getDesc() SLANG_OVERRIDE { return m_desc; }
- virtual SLANG_NO_THROW SlangResult SLANG_MCALL compile(const CompileOptions& options, IArtifact** outArtifact) SLANG_OVERRIDE;
- virtual SLANG_NO_THROW bool SLANG_MCALL canConvert(const ArtifactDesc& from, const ArtifactDesc& to) SLANG_OVERRIDE;
- virtual SLANG_NO_THROW SlangResult SLANG_MCALL convert(IArtifact* from, const ArtifactDesc& to, IArtifact** outArtifact) SLANG_OVERRIDE;
- virtual SLANG_NO_THROW bool SLANG_MCALL isFileBased() SLANG_OVERRIDE { return m_dep->isFileBased(); }
-
- DownstreamCompilerAdapter_Dep1(DownstreamCompiler_Dep1* dep, ArtifactPayload disassemblyPayload);
-
-protected:
-
- DownstreamCompilerDesc m_desc;
-
- ArtifactPayload m_disassemblyPayload;
- RefPtr<DownstreamCompiler_Dep1> m_dep;
-};
-
-struct DownstreamUtil_Dep1
-{
- static SlangResult getDownstreamSharedLibrary(DownstreamCompileResult_Dep1* downstreamResult, ComPtr<ISlangSharedLibrary>& outSharedLibrary);
-};
-
-}
-
-#endif
diff --git a/source/compiler-core/slang-llvm-compiler.cpp b/source/compiler-core/slang-llvm-compiler.cpp
index 4cb3b7260..382dd0842 100644
--- a/source/compiler-core/slang-llvm-compiler.cpp
+++ b/source/compiler-core/slang-llvm-compiler.cpp
@@ -1,25 +1,7 @@
// slang-llvm-compiler.cpp
#include "slang-llvm-compiler.h"
-#include "slang-downstream-dep1.h"
-
#include "../core/slang-common.h"
-#include "../../slang-com-helper.h"
-
-#include "../core/slang-blob.h"
-
-#include "../core/slang-string-util.h"
-#include "../core/slang-string-slice-pool.h"
-
-#include "../core/slang-io.h"
-#include "../core/slang-shared-library.h"
-#include "../core/slang-semantic-version.h"
-#include "../core/slang-char-util.h"
-
-#include "slang-include-system.h"
-#include "slang-source-loc.h"
-
-#include "../core/slang-shared-library.h"
namespace Slang
{
@@ -36,19 +18,17 @@ namespace Slang
return SLANG_FAIL;
}
- typedef SlangResult(*CreateDownstreamCompilerFunc_Dep1)(RefPtr<DownstreamCompiler_Dep1>& out);
+ typedef SlangResult(*CreateDownstreamCompilerFunc)(const Guid& intf, IDownstreamCompiler** outCompiler);
- auto fn = (CreateDownstreamCompilerFunc_Dep1)library->findFuncByName("createLLVMDownstreamCompiler");
+ auto fn = (CreateDownstreamCompilerFunc)library->findFuncByName("createLLVMDownstreamCompiler_V2");
if (!fn)
{
return SLANG_FAIL;
}
- RefPtr<DownstreamCompiler_Dep1> downstreamCompilerDep1;
-
- SLANG_RETURN_ON_FAIL(fn(downstreamCompilerDep1));
+ ComPtr<IDownstreamCompiler> downstreamCompiler;
- ComPtr<IDownstreamCompiler> downstreamCompiler(new DownstreamCompilerAdapter_Dep1(downstreamCompilerDep1, ArtifactPayload::None));
+ SLANG_RETURN_ON_FAIL(fn(IDownstreamCompiler::getTypeGuid(), downstreamCompiler.writeRef()));
set->addSharedLibrary(library);
set->addCompiler(downstreamCompiler);