From 6ab0baf910dea838dca2d29557c3361297180a34 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Mon, 22 Aug 2022 17:39:56 -0400 Subject: Improve binary compatibility for DownstreamCompiler types (#2371) * #include an absolute path didn't work - because paths were taken to always be relative. * WIP replacing DownstreamCompileResult. * First attempt at replacing DownstreamCompileResult with IArtifact and associated types. * Small renaming around CharSlice. * ICastable -> ISlangCastable Added IClonable Fix issue with cloning in ArtifactDiagnostics. * Only add the blob if one is defined in DXC. * Guard adding blob representation. * Make cloneInterface available across code base. Set enums backing type for ArtifactDiagnostic. * Added ::create for ArtifactDiagnostics. * Use SemanticVersion for DownstreamCompilerDesc. Set sizes for enum types. * Depreciate old incompatible CompileOptions. Change SemanticVersion use 32 bits for the patch. * Split out CastableUtil. * Change IDownstreamCompiler to use canConvert and convert to use artifact types. * Fix typos. * Fix typo bug. Allow trafficing in PTX assembly/binaries * struct DownstreamCompilerBaseUtil -> struct DownstreamCompilerUtilBase Co-authored-by: Yong He --- source/compiler-core/slang-downstream-compiler-util.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'source/compiler-core/slang-downstream-compiler-util.cpp') diff --git a/source/compiler-core/slang-downstream-compiler-util.cpp b/source/compiler-core/slang-downstream-compiler-util.cpp index 9f6a96e43..9f43a6c88 100644 --- a/source/compiler-core/slang-downstream-compiler-util.cpp +++ b/source/compiler-core/slang-downstream-compiler-util.cpp @@ -196,8 +196,7 @@ DownstreamCompilerMatchVersion DownstreamCompilerUtil::getCompiledVersion() { DownstreamCompilerDesc desc; desc.type = type; - desc.majorVersion = version.m_major; - desc.minorVersion = version.m_minor; + desc.version = version; return findCompiler(compilers, desc); } @@ -209,7 +208,7 @@ DownstreamCompilerMatchVersion DownstreamCompilerUtil::getCompiledVersion() if (desc.type == type) { - outVersions.add(SemanticVersion(int(desc.majorVersion), int(desc.minorVersion), 0)); + outVersions.add(desc.version); } } } @@ -455,12 +454,12 @@ static SlangResult _findPaths(const String& path, const char* libraryName, Strin out << TypeTextUtil::getPassThroughAsHumanText(desc.type); // Append the version if there is a version - if (desc.majorVersion || desc.minorVersion) + if (desc.version.isSet()) { out << " "; - out << desc.majorVersion; + out << desc.version.m_major; out << "."; - out << desc.minorVersion; + out << desc.version.m_minor; } } -- cgit v1.2.3