diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2020-11-11 09:56:50 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-11 09:56:50 -0500 |
| commit | 8f0895e0f8257da2fd10b6325931627a9a1792ba (patch) | |
| tree | 448c221583fe160df70a2e90fd2c8b80b82634b6 /source/slang/slang-serialize-source-loc.cpp | |
| parent | 7bcc2b15c8be4aebc6b9b8f05af6db7a451b228b (diff) | |
Include hierarchy output (#1595)
* #include an absolute path didn't work - because paths were taken to always be relative.
* Improve diagnostic for token pasting.
* Token paste location test.
* Output include hierarchy.
* WIP on includes hierarchy.
* Improved include hierarchy output - to handle source files without tokens.
Improved test case.
* Small comment improvements.
Fixed a typo with not returning a reference.
* Slight simplification of the ViewInitiatingHierarchy, by adding GetOrAddValue to Dictionary.
* Remove the need for ViewInitiatingHierarchy type.
* Improve output of path in diagnostic for includes hierarchy.
* Remove comment in diagnostic for token-paste-location.slang
* Update command line docs to include `-output-includes`
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'source/slang/slang-serialize-source-loc.cpp')
| -rw-r--r-- | source/slang/slang-serialize-source-loc.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/slang/slang-serialize-source-loc.cpp b/source/slang/slang-serialize-source-loc.cpp index 1de3f9a27..7e9cca106 100644 --- a/source/slang/slang-serialize-source-loc.cpp +++ b/source/slang/slang-serialize-source-loc.cpp @@ -247,7 +247,10 @@ SlangResult SerialSourceLocReader::read(const SerialSourceLocData* serialData, S pathInfo.foundPath = debugStringSlices[UInt(srcSourceInfo.m_pathIndex)]; SourceFile* sourceFile = sourceManager->createSourceFileWithSize(pathInfo, srcSourceInfo.m_range.getCount()); - SourceView* sourceView = sourceManager->createSourceView(sourceFile, nullptr); + + // Here the initiatingSourecLoc is passed as 0, as that information is not currently saved + // This simplifies the serialization - as currently for this data we save only a single view per file. + SourceView* sourceView = sourceManager->createSourceView(sourceFile, nullptr, SourceLoc::fromRaw(0)); // We need to accumulate all line numbers, for this source file, both adjusted and unadjusted List<SerialSourceLocData::LineInfo> lineInfos; |
