This is an archive of the discontinued LLVM Phabricator instance.

Make __FreeBSD_cc_version predefined macro configurable at build time
ClosedPublic

Authored by dim on May 6 2016, 3:34 PM.

Details

Summary

The FreeBSDTargetInfo class has always set the __FreeBSD_cc_version predefined macro to a rather static value, calculated from the major OS version.

In the FreeBSD base system, we would like to start incrementing the value of this macro whenever we make any signifant change to clang, so we need a way to configure the macro's value at build time.

I am proposing to use FREEBSD_CC_VERSION for this, which we can define using the -D command line option in the FreeBSD build system. Stock builds will still keep the earlier value.

Diff Detail

Event Timeline

dim updated this revision to Diff 56476.May 6 2016, 3:34 PM
dim retitled this revision from to Make __FreeBSD_cc_version predefined macro configurable at build time.
dim updated this object.
dim added reviewers: bkramer, rsmith.
dim added subscribers: bdrewery, emaste.

LGTM assuming the #ifndef style is OK

dim added a comment.May 11 2016, 11:21 AM

@bkramer, @rsmith, is this an acceptable way of getting this macro in?

Belatedly adding cfe-commits.

This revision was automatically updated to reflect the committed changes.