From 68bf31e586b9d1805c19dd42492086c7c780c2a4 Mon Sep 17 00:00:00 2001 From: kaizhangNV <149626564+kaizhangNV@users.noreply.github.com> Date: Mon, 3 Jun 2024 14:04:33 -0700 Subject: Add an option to disable source map in obfuscation (#4260) Add option "-disable-source-map" to disable the source map in obfuscation. --- source/slang/slang-lower-to-ir.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source/slang/slang-lower-to-ir.cpp') diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp index 403e2a921..5c4196839 100644 --- a/source/slang/slang-lower-to-ir.cpp +++ b/source/slang/slang-lower-to-ir.cpp @@ -10984,13 +10984,13 @@ RefPtr generateIRForTranslationUnit( // eliminateDeadCode(module, dceOptions); + if (stripOptions.shouldStripNameHints && linkage->m_optionSet.shouldHaveSourceMap()) + { + // The obfuscated source map is stored on the module + obfuscateModuleLocs(module, compileRequest->getSourceManager()); + } } - if (linkage->m_optionSet.shouldObfuscateCode()) - { - // The obfuscated source map is stored on the module - obfuscateModuleLocs(module, compileRequest->getSourceManager()); - } // TODO: consider doing some more aggressive optimizations // (in particular specialization of generics) here, so -- cgit v1.2.3