This is an archive of the discontinued LLVM Phabricator instance.

emit '(assertions enabled)' in the version string for a build of clang with assertions enabled
Needs RevisionPublic

Authored by arphaman on Feb 22 2019, 4:05 PM.
Tokens
"Love" token, awarded by Gaelan.

Details

Reviewers
dexonsmith
Summary

This patch adds an additional '(assertions enabled)' in the version string for a build of clang with assertions enabled.

This is a useful way to differentiate between clang binaries that have assertions enabled and the ones that don't if they are based on the same version.

Diff Detail

Repository
rC Clang

Event Timeline

arphaman created this revision.Feb 22 2019, 4:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 22 2019, 4:05 PM
Herald added a subscriber: jkorous. · View Herald Transcript

I like this. Can you start a discussion on cfe-dev (if you haven't already)? This is user-visible so I want to be sure other vendors are happy with this; if not, we can hide it behind a CMake flag.

lib/Basic/Version.cpp
117

Can we just make this " (+asserts)" or " (-NDEBUG)"? If we wanted to generalize this, I'd expect to want a list of compiler features similar to CPU features.

arphaman updated this revision to Diff 188023.Feb 22 2019, 6:42 PM
arphaman marked an inline comment as done.

Use "(+asserts)" as suggested.

I like this. Can you start a discussion on cfe-dev (if you haven't already)? This is user-visible so I want to be sure other vendors are happy with this; if not, we can hide it behind a CMake flag.

Sure, I started a cfe-dev thread.

dexonsmith requested changes to this revision.Oct 16 2020, 7:18 PM

Marking as "Request changes" to get this off my queue; are you still interested in pursuing this?

This revision now requires changes to proceed.Oct 16 2020, 7:18 PM