This is an archive of the discontinued LLVM Phabricator instance.

[libcxxabi] Fix -Werror build for 32-bit non-ARM.
ClosedPublic

Authored by danalbert on Feb 4 2015, 3:22 PM.

Details

Summary

The inclusion of Unwind-EHABI.h was insufficiently guarded
(LIBCXXABI_ARM_EHABI was beign checked without ever being defined).

Move the check into the header file itself, add the check to the
source file, and clean up the existing checks.

LIBCXXABI_ARM_EHABI didn't have a canonical defintion; it was
duplicated across cxxabi.h, libunwind.h, and unwind.h. Move the
definition into __cxxabi_config.h and clean up the old cruft (note: we
will have to ship this header).

There are also a few drive-by formatting/whitespace cleanups.

Diff Detail

Event Timeline

danalbert updated this revision to Diff 19357.Feb 4 2015, 3:22 PM
danalbert retitled this revision from to [libcxxabi] Fix -Werror build for 32-bit non-ARM..
danalbert updated this object.
danalbert edited the test plan for this revision. (Show Details)
danalbert added reviewers: jroelofs, thakis.
danalbert added a subscriber: Unknown Object (MLST).
danalbert updated this revision to Diff 19367.Feb 4 2015, 5:49 PM

Diff against master rather than my WIP branch.

danalbert updated this revision to Diff 19375.Feb 4 2015, 6:51 PM

Rebase onto HEAD.

compnerd accepted this revision.Feb 5 2015, 2:52 PM
compnerd added a reviewer: compnerd.
compnerd added a subscriber: compnerd.

LGTM with the first suggestion (about readability). I am less worried if you want to merge the drive-by formatting cleanup rather than separating it.

include/__cxxabi_config.h
14

I think this is more readable as:

#if defined(__arm__) && !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__ARM_DWARF_EH__)

That maps to what the condition really is: you need ARM, non-SJLJ, non-DWARF exceptions. Apple uses SJLJ exceptions, so adding !defined(__APPLE__) seems ... repetitive.

src/Unwind/UnwindCursor.hpp
26

Unless Im mistaken, this part looks like it could be split out into a separate change.

src/cxa_exception.cpp
263 ↗(On Diff #19375)

Along with the previous.

src/cxa_exception.hpp
27 ↗(On Diff #19375)

And this.

This revision is now accepted and ready to land.Feb 5 2015, 2:52 PM
danalbert updated this revision to Diff 19439.Feb 5 2015, 3:51 PM
danalbert edited edge metadata.

Moved formatting changes into separate commit (r228360).

danalbert updated this revision to Diff 19440.Feb 5 2015, 3:53 PM

Forgot to address compnerd's readability comment.

danalbert closed this revision.Feb 5 2015, 3:56 PM
rengolin added inline comments.
src/Unwind/Unwind-EHABI.h
16

Is this duplication intended?

danalbert added inline comments.Feb 14 2015, 11:24 AM
src/Unwind/Unwind-EHABI.h
16

Bad merge after splitting/rebasing my change. It was fixed right after in a follow up patch.

The idea of making this header public may be worrying, if we end up requiring the user to include it. If this is just a matter of compiler-logic, than it should be fine.

src/Unwind/Unwind-EHABI.h
16

I can't see it. Has this change been merged already?

The idea of making this header public may be worrying, if we end up requiring the user to include it. If this is just a matter of compiler-logic, than it should be fine.

The user will never have to include it manually. It's the job of each header to make sure it is included when needed. I've turned on -Wundef to try to keep us honest about that.

src/Unwind/Unwind-EHABI.h
16

The user will never have to include it manually. It's the job of each header to make sure it is included when needed. I've turned on -Wundef to try to keep us honest about that.

Sounds good. Waiting for Saleems reply on his requests.

cheers,
--renato

src/Unwind/Unwind-EHABI.h
16

Right. You'll squash all of them on the same commit, right?