This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Remove old workaround for buildit
ClosedPublic

Authored by ldionne on Apr 15 2019, 9:10 AM.

Details

Summary

I'm not sure what the problem was at the time, however I don't think
this is necessary since buildit doesn't exist anymore.

Instead of the workaround, the correct thing to do is to leave out
the get_new_handler/set_new_handler definitions from libc++ when
we're getting them from libc++abi.

Diff Detail

Repository
rL LLVM

Event Timeline

ldionne created this revision.Apr 15 2019, 9:10 AM
ldionne marked an inline comment as done.Apr 15 2019, 9:20 AM
ldionne added inline comments.
libcxx/src/new.cpp
26 ↗(On Diff #195202)

The reasoning here is that for Apple builds, we never define _LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY (maybe we used to but we don't anymore). Hence, the conditional is equivalent to:

#if defined(__APPLE__) && 1

Furthermore, we always define _LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS for Apple builds, and nobody else I'm aware of does it, so this conditional is equivalent to

#if defined(_LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS) && 1

Now we take the #else branch and that's the refactor.

The only thing this could break is if someone builds libc++ with _LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS but their ABI library doesn't provide get_new_handler/set_new_handler. However, I'm not aware of any such user (and frankly if they exist then they're probably following these reviews).

EricWF accepted this revision.Apr 16 2019, 8:27 AM

I think this is fine.

This revision is now accepted and ready to land.Apr 16 2019, 8:27 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 16 2019, 12:25 PM

This looks ok to me.