summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-emit-source-writer.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2023-04-20 11:55:26 -0400
committerGitHub <noreply@github.com>2023-04-20 11:55:26 -0400
commit467fa3a5dcdd36e310b084747d6f4fcd6ca81249 (patch)
tree193104aad3da77fffddb4b9be3edad4bcfdf76ac /source/slang/slang-emit-source-writer.cpp
parent4d24f55226870055c8dcbb3409efc5355da134d7 (diff)
Improvements outputting containers (#2815)
* #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. * WIP Api improvements around sourcemap/artifact/line-directive. * Small fix for asBoxValue * WIP outputting container with multiple artifacts. * Added ArtifactContailerUtil::filter to produce an artifact hierarchy that only contains "signficant" and "blobable" artifacts. * Make emitting IR disjoint to using a container. Added -emit-ir option. Simplfiy output. * Fix typo in options parsing. * Add a test that ouputs with an emit source map. * Enable emitting our SlangIR module if no targets are specified. * Fix issues constructing container. * Extra checks getting obfuscated source map from a translation unit. * Fix typo.
Diffstat (limited to 'source/slang/slang-emit-source-writer.cpp')
-rw-r--r--source/slang/slang-emit-source-writer.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/slang/slang-emit-source-writer.cpp b/source/slang/slang-emit-source-writer.cpp
index 985d0a0bf..27cbd1932 100644
--- a/source/slang/slang-emit-source-writer.cpp
+++ b/source/slang/slang-emit-source-writer.cpp
@@ -391,6 +391,7 @@ void SourceWriter::_emitLineDirectiveIfNeeded(const HumaneSourceLoc& sourceLocat
auto mode = getLineDirectiveMode();
switch (mode)
{
+ case LineDirectiveMode::SourceMap:
case LineDirectiveMode::None:
return;
@@ -451,6 +452,7 @@ void SourceWriter::_emitLineDirective(const HumaneSourceLoc& sourceLocation)
switch (mode)
{
default:
+ case LineDirectiveMode::SourceMap:
case LineDirectiveMode::None:
SLANG_UNEXPECTED("should not be trying to emit '#line' directive");
return;