This is an archive of the discontinued LLVM Phabricator instance.

[libunwind] Factor out sigreturn check condition. NFC
ClosedPublic

Authored by smeenai on May 24 2022, 4:22 PM.

Details

Summary

Create a macro for this instead of duplicating the architecture checks
everywhere. (It's a little redundant to use it when we're checking for a
specific architecture, but I'm also applying it there for consistency.)

Diff Detail

Event Timeline

smeenai created this revision.May 24 2022, 4:22 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMay 24 2022, 4:22 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
smeenai requested review of this revision.May 24 2022, 4:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 24 2022, 4:22 PM
rprichard accepted this revision.May 25 2022, 9:10 PM
rprichard added inline comments.
libunwind/src/UnwindCursor.hpp
35

nit: For consistency, I wonder if this should define _LIBUNWIND_CHECK_LINUX_SIGRETURN to 1 instead of empty. __libunwind_config.h defines most of its boolean _LIBUNWIND_* macros to 1. (Exceptions I see include _LIBUNWIND_ARM_EHABI and _LIBUNWIND_TARGET_I386.)

Alternately, the headers could define the boolean macros to empty, because we're always using defined(...) to test whether they're set.

I'm also happy with this patch as-is, though.

MaskRay accepted this revision.May 25 2022, 9:24 PM
This revision is now accepted and ready to land.May 25 2022, 9:24 PM
smeenai updated this revision to Diff 432190.May 25 2022, 9:38 PM
smeenai marked an inline comment as done.

Define macro to 1

rprichard accepted this revision.May 25 2022, 10:00 PM
This revision was automatically updated to reflect the committed changes.