inline.d: remove copy/pasta, fix obtuse logic#5121
Conversation
|
Hard to review. Please separate commits to:
|
596058f to
cd01efb
Compare
|
I appreciate the sentiment, but I think you'll find in this case that one doesn't work without the other, because the logic had to be fixed to make the refactoring work, and vice versa. |
|
As far as I see, there's bunch of unrelated changes to the "logic improvement" - updating copyright comment, variable renaming ( I really know, such the code refactoring is - even if it's trivial renaming - necessary for further improvements. But such the squashed one big commit is unfriendly for the reviewers. If you want to do multiple things in one PR, they should be separated in the same number of commits. I think considering to the reviewability is the duty of contributors. |
|
Consider things in proportion. The I know I've complained to you about refactorings mixed up with bug fixes. I have good reason to believe that those instances did impede review, due mostly to the size of them. I think you'll agree, though, that this is not the case here, and changing the file comment at the top hardly impedes understanding. |
|
Walter, you made the changes so of course you understand them. Others reading your PRs do not immediately know which parts are related, and which aren't. Splitting up commits is so much easier than arguing about it. |
|
Of course the refactoring changes are so small in this PR. But it was actually obstacle to my quick reviewing. And I've reviewed this PR beyond the obstacles. The total change looks good to me. |
|
After the review, I've found four improvements for the
If you had separated those changes (and refactorings) into independent commits, the review would have quickly finished. Especially, the #4 is difficult to understand from the diff view. I'd really prefer to record it as a commit log in the git history. |
|
They are connected, @yebblies. The changes to visitCallExp caused scanVar's setting of eresult to break things. How was I supposed to make that a separate commit? Replace the return value with null and then ignore it? If I did that, I'd get (properly) dinged in code review. Notice that visitCallExp now handles both inlining for statements and inlining for expressions. Trying to keep the original logic in scanVar did not work with that. Having visitCallExp do double duty now required rewriting the logic that triggered the verbose message printing, moving it outside the { } solved that. The logic before was almost impossible to follow, particularly how eresult was set, because the save/restore of it implied recursion when it actually worked quite differently, and the save/restore was a hack somebody put in to work around scanVar setting eresult. Both functions need to be redone to untangle it. I changed result to sresult because I tired of all the false positives when grepping for Again, it's about proportion. This is NOT a 500 line refactoring. It's a decent shrink, more than the line count suggests because I added many lines of comments. This PR is a necessary step towards fixing the inlining issues everyone gripes about. Please pull it. If there's anything else you don't understand about it, I'll be happy to explain. |
|
BTW, the git diff view makes things look more complex than they are. Just use that as a guide to where the changes are, and bring up the file separately, and you'll see that the logic flows better and is much simpler. You'll also find that searching for |
|
I wish you'll open a more reviewer-friendly PR in the next time. |
|
Auto-merge toggled on |
inline.d: remove copy/pasta, fix obtuse logic
|
This pull request introduced a regression: |
Trying to understand how this worked revealed a bunch of copy/pasta code with mistakes, false assumptions, and misleading logic. Straightened it out.