This is an archive of the discontinued LLVM Phabricator instance.

[libcxxabi] Fix NO_THREADS version of test_exception_storage.pass.cpp
ClosedPublic

Authored by DanielMcIntosh-IBM on Nov 2 2021, 1:44 PM.

Details

Summary

thread_code returns param, which for NO_THREADS is going to be
&thread_globals. Thus, the return value will never be null. The test
was probably meant to check if *thread_code(&thread_globals) == 0.
However, to avoid the extra cast, and to bring the NO_THREADS version
more in line with the regular version of the test, this changes it to
check if thread_globals == 0 directly.

Diff Detail

Event Timeline

DanielMcIntosh-IBM requested review of this revision.Nov 2 2021, 1:44 PM
DanielMcIntosh-IBM created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptNov 2 2021, 1:44 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
jroelofs resigned from this revision.Nov 2 2021, 2:39 PM

Looks ok to me, that said I'm not one of this project's group reviewers, so you'll need someone else's approval.

DanielMcIntosh-IBM retitled this revision from [libcxx] Tidy up test_exception_storage.pass.cpp, and fix the NO_THREADS version to [libcxxabi] Tidy up test_exception_storage.pass.cpp, and fix the NO_THREADS version.Nov 2 2021, 3:55 PM
ikudrin added a subscriber: ikudrin.Nov 3 2021, 7:06 AM

It is better to split the patch so that the fix is separated from other improvements.

As for the other two patches, I am afraid I am not the right person to review them.

Looks ok to me, that said I'm not one of this project's group reviewers, so you'll need someone else's approval.

Thanks for the review (ish) @jroelofs. I'm aware that you're not one of the libc++ reviewers, but I still wanted your feedback because you were the author (and reviewer?) for D3386. In addition to being closely related to D113058, D113054, D113065, D113066, D113069, D112567 and D110351, which basically address a run-time dependent equivalent to NO_THREADS, it was also the change that introduced the if (thread_code(&thread_globals) == 0) line this change is supposed to fix.
With that in mind, even though you can't give the final approval, I still feel that your feedback on this and the others would be valuable.

Similarly, @ikudrin, I added you to this as well as D113054 and D112567 because of your authorship of D17815, which was somewhat related. I know in this case it isn't that closely related, but most of the people who have done related work are no longer active.

I now have a web of 16 inter-related changes and another 3 unrelated ones all mostly waiting on review by ldionne, which is a rather large review load for one person with other responsibilities. If I'm going to have any chance of landing them in a reasonable time frame, I need to spread it out a bit. Unfortunately, there aren't many people suitable for reviewing them who are still active other than Louis, so I would appreciate any feedback either of you can give on the changes I've requested your review of. Thank you in advance.

Remove the <cstdlib> to <cstddef> change as per ikudrin's comment.

DanielMcIntosh-IBM retitled this revision from [libcxxabi] Tidy up test_exception_storage.pass.cpp, and fix the NO_THREADS version to [libcxxabi] Fix NO_THREADS version of test_exception_storage.pass.cpp.Nov 3 2021, 8:16 AM
DanielMcIntosh-IBM edited the summary of this revision. (Show Details)

It is better to split the patch so that the fix is separated from other improvements.

As for the other two patches, I am afraid I am not the right person to review them.

As for specifically the issue of splitting the patch up:

  • The early returns kind of go hand in hand with fixing the NO_THREADS part of the test, since that's the only place we can do the early return, so I'm inclined to keep them together.
  • arc won't let me submit it without removing the extra space on line 44
  • for the cstdlib to cstddef change, I'd rather just drop it entirely, as I have done than create a separate review for it,
ldionne accepted this revision.Nov 3 2021, 8:36 AM

This looks reasonable to me. I agree this was probably the intention all along.

This revision is now accepted and ready to land.Nov 3 2021, 8:36 AM

No change - rebase to re-run CI now that main is green