From d4f99c8bac8b28f18c864a717d8833db6a1c872d Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 22 Mar 2023 12:04:33 -0400 Subject: Source map obfuscation (#2717) * #include an absolute path didn't work - because paths were taken to always be relative. * WIP source map. * Split out handling of RttiTypeFuncs to a map type. * Make RttiTypeFuncsMap hold default impls. * Slightly more sophisticated RttiTypeFuncsMap * Source map decoding. * Fix tabs. * Fix asserts due to negative values. * Use less obscure mechanisms in SourceMap. * Source map decoding. Simplifying SourceMap usage. * First attempt at ouputting a source map as part of emit. * Added support for -source-map option. SourceMap is added to the artifact. * Small improvements around column calculation in SourceWriter. * Source Loc obuscation WIP. * Fix some issues around SourceMap obfuscation. * Split out obfuscation into its own file. * Keep obfuscated SourceMap even through serialization bottleneck. --- source/slang/slang.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/slang/slang.cpp') diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index 14b59d156..bd19670d9 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -2377,6 +2377,9 @@ void FrontEndCompileRequest::generateIR() if (useSerialIRBottleneck) { + // Keep the obfuscated source map (if there is one) + RefPtr obfuscatedSourceMap = irModule->getObfuscatedSourceMap(); + IRSerialData serialData; { // Write IR out to serialData - copying over SourceLoc information directly @@ -2395,6 +2398,7 @@ void FrontEndCompileRequest::generateIR() // Set irModule to the read module irModule = irReadModule; + irModule->setObfuscatedSourceMap(obfuscatedSourceMap); } // Set the module on the translation unit -- cgit v1.2.3