summaryrefslogtreecommitdiff
path: root/source/slang/slang-lower-to-ir.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2023-04-17 15:09:37 -0400
committerGitHub <noreply@github.com>2023-04-17 15:09:37 -0400
commit90a9f43573ec0777c2ae4fa20c8fdc51a4ae7b3a (patch)
tree360750778be872a086674024a9ce5a68bf4e7cb3 /source/slang/slang-lower-to-ir.cpp
parenta3f622ace1bdef1f1a4150ec85d1328d1a589333 (diff)
Round trip source map (#2810)
* #include an absolute path didn't work - because paths were taken to always be relative. * Make output of obfuscation locs work in a slang-module. * Tidy up detection for writing serialized source locs. * Support for .zip references. Handling of obfuscated source maps read from containers. A test to check obfuscated source map working on a module. * When using obfuscation, always obfuscate locs instead of stripping them. We keep a source map, so we can still produce reasonable errors. * Write out source locs if debug information is enabled. * Check output without sourcemap. * Small fixes. * Small improvements around hash calculation for source map name. * Disable test that fails on x86 gcc linux for now. * Fix issues around obfuscated source map using lines rather than columns. Fix some issues around encoding/decoding. * Make column calculation of source locs take into account utf8/tabs. Don't special case obfuscated source map for lookup for source loc. * Support following multiple source maps. * Small fixes/improvements around SourceMap lookup.
Diffstat (limited to 'source/slang/slang-lower-to-ir.cpp')
-rw-r--r--source/slang/slang-lower-to-ir.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp
index 8cceaff02..110f85b87 100644
--- a/source/slang/slang-lower-to-ir.cpp
+++ b/source/slang/slang-lower-to-ir.cpp
@@ -9652,7 +9652,7 @@ RefPtr<IRModule> generateIRForTranslationUnit(
// We don't do the obfuscation remapping here, because DCE and other passes may
// change what locs are actually needed, we need to be sure
// that if we have obfuscation enabled we don't forget to obfuscate.
- stripOptions.stripSourceLocs = linkage->m_obfuscateCode && !linkage->m_generateSourceMap;
+ stripOptions.stripSourceLocs = false;
stripFrontEndOnlyInstructions(module, stripOptions);
// Stripping out decorations could leave some dead code behind
@@ -9667,7 +9667,7 @@ RefPtr<IRModule> generateIRForTranslationUnit(
options.keepExportsAlive = true;
eliminateDeadCode(module, options);
- if (linkage->m_obfuscateCode && linkage->m_generateSourceMap)
+ if (linkage->m_obfuscateCode)
{
// The obfuscated source map is stored on the module
obfuscateModuleLocs(module, compileRequest->getSourceManager());