From ca1f93a916ce6b984cba402c8d3710988f2b618f Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Mon, 27 Mar 2023 13:57:42 -0400 Subject: 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 --- source/slang/slang-emit.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/slang/slang-emit.cpp') 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 Slang::String get_slang_cpp_host_prelude(); @@ -1148,7 +1150,7 @@ SlangResult CodeGenContext::emitEntryPointsSourceFromIR(ComPtr& outAr RefPtr 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 -- cgit v1.2.3