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-compiler.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/slang/slang-compiler.cpp') diff --git a/source/slang/slang-compiler.cpp b/source/slang/slang-compiler.cpp index ff38bbbde..839a4e67c 100644 --- a/source/slang/slang-compiler.cpp +++ b/source/slang/slang-compiler.cpp @@ -14,6 +14,8 @@ #include "../compiler-core/slang-lexer.h" +#include "../compiler-core/slang-json-source-map-util.h" + // Artifact #include "../compiler-core/slang-artifact-desc-util.h" #include "../compiler-core/slang-artifact-representation-impl.h" @@ -1907,7 +1909,7 @@ namespace Slang JSONValue jsonValue; - SLANG_RETURN_ON_FAIL(sourceMap->encode(jsonContainer, sink, jsonValue)); + SLANG_RETURN_ON_FAIL(JSONSourceMapUtil::encode(sourceMap, jsonContainer, sink, jsonValue)); // Convert into a string JSONWriter writer(JSONWriter::IndentationStyle::Allman); -- cgit v1.2.3