diff options
Diffstat (limited to 'source/compiler-core/slang-source-map.cpp')
| -rw-r--r-- | source/compiler-core/slang-source-map.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/source/compiler-core/slang-source-map.cpp b/source/compiler-core/slang-source-map.cpp index 4ea50eb3f..7a6e368a4 100644 --- a/source/compiler-core/slang-source-map.cpp +++ b/source/compiler-core/slang-source-map.cpp @@ -4,7 +4,7 @@ namespace Slang { void SourceMap::clear() { - String empty; + const String empty; m_file = empty; m_sourceRoot = empty; @@ -23,6 +23,18 @@ void SourceMap::clear() m_slicePool.clear(); } +void SourceMap::swapWith(ThisType& rhs) +{ + m_file.swapWith(rhs.m_file); + m_sourceRoot.swapWith(rhs.m_sourceRoot); + m_sources.swapWith(rhs.m_sources); + m_names.swapWith(rhs.m_names); + m_sourcesContent.swapWith(rhs.m_sourcesContent); + m_lineStarts.swapWith(rhs.m_lineStarts); + m_lineEntries.swapWith(rhs.m_lineEntries); + m_slicePool.swapWith(rhs.m_slicePool); +} + void SourceMap::advanceToLine(Index nextLineIndex) { const Count currentLineIndex = getGeneratedLineCount() - 1; |
