From 588991f6df3d6813378721166a7260990835817e Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 19 Apr 2023 17:06:56 -0400 Subject: Make SourceMap a value type (#2812) * #include an absolute path didn't work - because paths were taken to always be relative. * Moved JSON source map writing logic to JSONSourceMapUtil. * Use ArtifactHandler to read/write SourceMaps. Use ObjectCastableAdapter to hold SourceMap Only serialize SourceMap <-> JSON on demand. * Make some types swappable. * BoxValue impl. * Added asBoxValue. * Remove const get funcs. * Fix typo in asBoxValue. * Fix another typo in asBoxValue. * Slightly simplify conversion to blob of SourceMap. * Small fix for asBoxValue --- source/slang/slang-compiler.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source/slang/slang-compiler.cpp') diff --git a/source/slang/slang-compiler.cpp b/source/slang/slang-compiler.cpp index 907f39f48..b5fd27d55 100644 --- a/source/slang/slang-compiler.cpp +++ b/source/slang/slang-compiler.cpp @@ -1913,11 +1913,10 @@ namespace Slang auto artifactDesc = ArtifactDesc::make(ArtifactKind::Json, ArtifactPayload::SourceMap, ArtifactStyle::Obfuscated); // Create the source map artifact - auto sourceMapArtifact = Artifact::create(artifactDesc, sourceMap->m_file.getUnownedSlice()); + auto sourceMapArtifact = Artifact::create(artifactDesc, sourceMap->get().m_file.getUnownedSlice()); // Add the repesentation - ComPtr castableAdapter(new ObjectCastableAdapter(sourceMap)); - sourceMapArtifact->addRepresentation(castableAdapter); + sourceMapArtifact->addRepresentation(sourceMap); // Associate with the container m_containerArtifact->addAssociated(sourceMapArtifact); -- cgit v1.2.3