From 90a9f43573ec0777c2ae4fa20c8fdc51a4ae7b3a Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Mon, 17 Apr 2023 15:09:37 -0400 Subject: Round trip source map (#2810) * #include an absolute path didn't work - because paths were taken to always be relative. * Make output of obfuscation locs work in a slang-module. * Tidy up detection for writing serialized source locs. * Support for .zip references. Handling of obfuscated source maps read from containers. A test to check obfuscated source map working on a module. * When using obfuscation, always obfuscate locs instead of stripping them. We keep a source map, so we can still produce reasonable errors. * Write out source locs if debug information is enabled. * Check output without sourcemap. * Small fixes. * Small improvements around hash calculation for source map name. * Disable test that fails on x86 gcc linux for now. * Fix issues around obfuscated source map using lines rather than columns. Fix some issues around encoding/decoding. * Make column calculation of source locs take into account utf8/tabs. Don't special case obfuscated source map for lookup for source loc. * Support following multiple source maps. * Small fixes/improvements around SourceMap lookup. --- source/compiler-core/slang-artifact-desc-util.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source/compiler-core/slang-artifact-desc-util.cpp') diff --git a/source/compiler-core/slang-artifact-desc-util.cpp b/source/compiler-core/slang-artifact-desc-util.cpp index fb1c2dbd2..67501782a 100644 --- a/source/compiler-core/slang-artifact-desc-util.cpp +++ b/source/compiler-core/slang-artifact-desc-util.cpp @@ -460,7 +460,15 @@ static const KindExtension g_cpuKindExts[] = /* static */bool ArtifactDescUtil::isLinkable(const ArtifactDesc& desc) { - if (isDerivedFrom(desc.kind, ArtifactKind::CompileBinary)) + // If is a container with compile results *assume* that result is linkable + if (isDerivedFrom(desc.kind, ArtifactKind::Container) && + isDerivedFrom(desc.payload, ArtifactPayload::CompileResults)) + { + return true; + } + + // if it's a compile binary or a container + if (isDerivedFrom(desc.kind, ArtifactKind::CompileBinary)) { if (isDerivedFrom(desc.payload, ArtifactPayload::KernelLike)) { -- cgit v1.2.3