This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Remove unused macro in __config
ClosedPublic

Authored by ldionne on Sep 22 2021, 1:51 PM.

Details

Reviewers
None
Group Reviewers
Restricted Project
Commits
rGe6126faba060: [libc++] Remove unused macro in __config
Summary

That macro was being defined but not used anywhere, so it must be
safe to remove it.

Diff Detail

Event Timeline

ldionne requested review of this revision.Sep 22 2021, 1:51 PM
ldionne created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptSep 22 2021, 1:51 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
jloser added a subscriber: jloser.EditedSep 22 2021, 2:10 PM

This is safe for libc++ use, so LGTM since CI is passing. As an aside, it looks like there are a few other spots in llvm that could benefit from the removal too:

git grep '__MAC_OS_X_VERSION_MIN_REQUIRED'
clang-tools-extra/clangd/unittests/JSONTransportTests.cpp:#if !(defined(_WIN32) || (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) &&          \
clang-tools-extra/clangd/unittests/JSONTransportTests.cpp:                          __MAC_OS_X_VERSION_MIN_REQUIRED < 101300))
llvm/lib/Support/LockFileManager.cpp:#if defined(__APPLE__) && defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && (__MAC_OS_X_VERSION_MIN_REQUIRED > 1050)
xgupta added a subscriber: xgupta.Sep 23 2021, 4:15 AM
ldionne updated this revision to Diff 374518.Sep 23 2021, 5:46 AM

Remove uses of __MAC_OS_X_VERSION_MIN_REQUIRED in LLVM

Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptSep 23 2021, 5:46 AM

I think it's used in a few places from a quick git grep: [...]

__MAC_OS_X_VERSION_MIN_REQUIRED is defined by Apple's <Availability.h>. It is equivalent to __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__, which is set by the compiler. I suspect libc++ was defining it at some point for internal use (e.g. in the code I removed in https://reviews.llvm.org/rGebaf1d5e2b87), but now it's not needed anymore.

This is safe for libc++ use, so LGTM since CI is passing. As an aside, it looks like there are a few other spots in llvm that could benefit from the removal too:

git grep '__MAC_OS_X_VERSION_MIN_REQUIRED'
clang-tools-extra/clangd/unittests/JSONTransportTests.cpp:#if !(defined(_WIN32) || (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) &&          \
clang-tools-extra/clangd/unittests/JSONTransportTests.cpp:                          __MAC_OS_X_VERSION_MIN_REQUIRED < 101300))
llvm/lib/Support/LockFileManager.cpp:#if defined(__APPLE__) && defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && (__MAC_OS_X_VERSION_MIN_REQUIRED > 1050)

Good point -- those could either have been using the value defined in <Availability.h> or unknowingly using the one set by libc++. I'll move those over to __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__, which is always defined by the compiler.

ldionne accepted this revision as: Restricted Project.Sep 23 2021, 10:09 AM

Other CI failures appear unrelated to the change, so I'm shipping this.

This revision was not accepted when it landed; it landed in state Needs Review.Sep 23 2021, 10:09 AM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.