Details
- Reviewers
JDevlieghere - Commits
- rG759465ee34c0: [YAMLVFSWriter] Fix for delimiters
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Support/VirtualFileSystem.cpp | ||
---|---|---|
2065–2066 | I feel this delimiter should also be conditional on IsCurrentDirEmpty but need to think about it a bit more. I'll add a testcase for entries like this: /a/ /a/b/ |
We also need to put a delimiter conditionally whenever we are changing the "current directory" (represtented by DirStack.back()).
Basically there are two cases:
- We are popping from DirStack - that means there's always some previous directory entry.
E. g. the transition from
a [ b [ ] ]
to
a [ b [ ], <--- this is the delimiter c [ ] ]
- We are adding a subdirectory to existing directory with already existing entries.
E. g. the transition from
a [ b.txt ]
to
a [ b.txt, <--- this is the delimiter c [ ] ]
llvm/lib/Support/VirtualFileSystem.cpp | ||
---|---|---|
2065–2066 | Hopefully now addressed. |
Thank you for fixing this Jan. I ran the LLDB reproducer test suite and everything passes.
llvm/lib/Support/VirtualFileSystem.cpp | ||
---|---|---|
2043–2044 | So this is set to true whenever we start a new directory, and is set to false whenever we write a file entry. Would it make sense to make this variable a member and toggle it inside startDirectory and writeEntry respectively? | |
2057 | Not a fan of this name. What about IsDirPoppedFromStack? |
llvm/lib/Support/VirtualFileSystem.cpp | ||
---|---|---|
2043–2044 | Maybe... I'd assume that if we just reset it at the start of write() method it should work. That said - I kind of prefer to keep the whole lifecycle of the variable visible in this method as it's imo easier to understand than having to check two other methods (no matter how trivial). | |
2057 | Sounds good |
So this is set to true whenever we start a new directory, and is set to false whenever we write a file entry. Would it make sense to make this variable a member and toggle it inside startDirectory and writeEntry respectively?