summaryrefslogtreecommitdiff
path: root/source/slang/slang-emit.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2023-03-27 13:57:42 -0400
committerGitHub <noreply@github.com>2023-03-27 10:57:42 -0700
commitca1f93a916ce6b984cba402c8d3710988f2b618f (patch)
treef39b638210d38efdc7e2bb746c06b881323d0f53 /source/slang/slang-emit.cpp
parent2179480e28bdd46c71cec269a8f55ba93aa54f53 (diff)
Using SourceMap for location output (#2736)
* #include an absolute path didn't work - because paths were taken to always be relative. * WIP using SourceMap with SourceManager. * Add a test to check obfuscation map is working. --------- Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'source/slang/slang-emit.cpp')
-rw-r--r--source/slang/slang-emit.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/slang/slang-emit.cpp b/source/slang/slang-emit.cpp
index fe72efcc7..6a0f46e0a 100644
--- a/source/slang/slang-emit.cpp
+++ b/source/slang/slang-emit.cpp
@@ -82,6 +82,8 @@
#include "../compiler-core/slang-artifact-impl.h"
#include "../compiler-core/slang-artifact-associated-impl.h"
+#include "../compiler-core/slang-json-source-map-util.h"
+
#include <assert.h>
Slang::String get_slang_cpp_host_prelude();
@@ -1148,7 +1150,7 @@ SlangResult CodeGenContext::emitEntryPointsSourceFromIR(ComPtr<IArtifact>& outAr
RefPtr<JSONContainer> jsonContainer(new JSONContainer(&sourceMapSourceManager));
JSONValue jsonValue;
- SLANG_RETURN_ON_FAIL(sourceMap->encode(jsonContainer, &sourceMapSink, jsonValue));
+ SLANG_RETURN_ON_FAIL(JSONSourceMapUtil::encode(sourceMap, jsonContainer, &sourceMapSink, jsonValue));
// Okay now convert this into a text file and then a blob