This is an archive of the discontinued LLVM Phabricator instance.

[NFC][libcxxabi] Refactor libcxxabi/src/cxa_guard_impl.h
AbandonedPublic

Authored by DanielMcIntosh-IBM on Aug 18 2021, 4:44 PM.

Details

Reviewers
ldionne
EricWF
zibi
Group Reviewers
Restricted Project
Summary

The new version doesn't need the curiously recurring template pattern, is
consistent about naming of GlobalMutex vs GlobalLock, has a lot more comments,
and has a much better separation of concerns than before.

In addition to being much cleaner and easier to understand, these changes are
also going to be needed later, when another set of changes gets put upstream
(pending approval by IBM management).

If this set of changes it too large for a single PR/commit, I can easily break
it down into the following 5 change sets:

  • Rename GlobalLock to GlobalMutex
  • Make InitByteGlobalMutex check GetThreadID instead of PlatformThreadID
  • Split InitByteXXX classes
  • Added GuardBase class
  • Moved cxa_guard_acquire/release/abort into GuardBase

Diff Detail

Event Timeline

DanielMcIntosh-IBM requested review of this revision.Aug 18 2021, 4:44 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 18 2021, 4:44 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne requested changes to this revision.Sep 3 2021, 12:09 PM

Sorry for the delay.

As you mention, this change is kind of large to review as-is. If you can split it into a few changes that are easier to review, it would be helpful. As it stands, it's difficult for me to validate that this is good since I don't know the code by heart and there's several unrelated changes bunched together.

It would also be awesome if you could put up for review the subsequent change that this will all be useful for (although I understand you might not be allowed to yet).

This revision now requires changes to proceed.Sep 3 2021, 12:09 PM
This comment was removed by DanielMcIntosh-IBM.

Added a 6th set of changes, getting rid of the multiple inheritance