Page MenuHomePhabricator

Factor out libc++ version file to allow Clang to more easily sniff for the installed version
AbandonedPublic

Authored by rsmith on Oct 27 2016, 3:25 PM.

Details

Reviewers
mclow.lists
Summary

Clang would like to enable some language-version-specific functionality only if the installed C++ standard library supports it (so far, sized deallocation and aligned allocation, but more cases are expected to follow). Right now, it's hard for the Clang driver to determine which version of libc++ it's found (this is typically easy for libstdc++, since the version is right there in the path).

The idea here is that the __version file is always a single-line file that simply defines the libc++ version, and Clang can determine the installed version by just reading this file. There doesn't seem to be a way to make the file contain only the version number, so it contains the relevant #define instead.

Diff Detail

Repository
rL LLVM

Event Timeline

rsmith updated this revision to Diff 76115.Oct 27 2016, 3:25 PM
rsmith retitled this revision from to Factor out libc++ version file to allow Clang to more easily sniff for the installed version.
rsmith updated this object.
rsmith added reviewers: mclow.lists, EricWF.
rsmith set the repository for this revision to rL LLVM.
rsmith added a subscriber: cfe-commits.
EricWF edited edge metadata.Oct 27 2016, 8:22 PM

@rsmith I would really like to avoid the cost of an additional include in <__config>. Would something like https://reviews.llvm.org/D26062 work instead?

EricWF resigned from this revision.Oct 27 2016, 11:20 PM
EricWF removed a reviewer: EricWF.

An alternative solution has been committed.

rsmith abandoned this revision.Oct 27 2016, 11:39 PM