-
Notifications
You must be signed in to change notification settings - Fork 753
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NFC] Source maps: Simplify the code and add comments #5912
Conversation
Codecov Report
@@ Coverage Diff @@
## main #5912 +/- ##
==========================================
- Coverage 42.63% 42.61% -0.02%
==========================================
Files 484 484
Lines 74882 74843 -39
Branches 11942 11927 -15
==========================================
- Hits 31925 31898 -27
+ Misses 39748 39747 -1
+ Partials 3209 3198 -11
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This is much easier to understand. By the way we had a similar data fields before #5504 - Then it was
std::pair<uint32_t, Function::DebugLocation> nextDebugLocation;
And now it is
size_t nextDebugPos;
Function::DebugLocation nextDebugLocation;
Then I wonder what #5504 was for..? Given that #5504 seemed to fix something and this is NFC I guess I've missed something...
Yes, I think some parts of that PR were not needed, which are partially reverted here, unless I am mistaken. But other parts of that PR were good fixes, namely and |
Co-authored-by: Heejin Ahn <aheejin@gmail.com>
Co-authored-by: Heejin Ahn <aheejin@gmail.com>
Almost entirely trivial, except for this part: - if (nextDebugLocation.availablePos == 0 && - nextDebugLocation.previousPos <= pos) { + if (nextDebugLocation.availablePos == 0) { return; I believe removing the extra check has no effect. Removing it does not change anything in the test suite, and logically, if we set availablePos to 0 then we definitely want to return here - we set it to 0 to indicate there is nothing left to read, which is what the code after it does. As a result, we can remove the previousPos field entirely.
Almost entirely trivial, except for this part:
I believe removing the extra check has no effect. Removing it does not change
anything in the test suite, and logically, if we set
availablePos
to 0 then wedefinitely want to return here - we set it to 0 to indicate there is nothing left
to read, which is what the code after it does.
As a result, we can remove the
previousPos
field entirely.cc @JesseCodeBones - am I missing something about
previousPos
? Do you havean example maybe that shows it is needed?