This is an archive of the discontinued LLVM Phabricator instance.

[CMake] Use `LLVM_ENABLE_ASSERTIONS` to enable assertions in `libc++`
ClosedPublic

Authored by akyrtzi on Feb 8 2023, 3:38 PM.

Details

Summary

Follow-up to https://reviews.llvm.org/D142279 for also enabling libc++ assertions.
This is particularly useful to recover the assertion checks we had with llvm::Optional, before moving to std::optional.

Diff Detail

Event Timeline

akyrtzi created this revision.Feb 8 2023, 3:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 8 2023, 3:38 PM
akyrtzi requested review of this revision.Feb 8 2023, 3:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 8 2023, 3:38 PM

I think we should verify the performance impact to running tests is minimal before landing this, like they did with the _GLIBCXX_ASSERTIONS change. Also CCing @ldionne in case he has opinions on us using libc++ assertions. Otherwise LGTM.

I think we should verify the performance impact to running tests is minimal before landing this, like they did with the _GLIBCXX_ASSERTIONS change.

It isn't scientific but I did one timing of running the llvm & clang tests before this change and one timing running them after, and after took a bit less time, so probably this is lost in the noise.

I think this is fine.

benlangmuir accepted this revision.Feb 10 2023, 11:17 AM

Since perf impact is minimal, LGTM.

This revision is now accepted and ready to land.Feb 10 2023, 11:17 AM
This revision was landed with ongoing or failed builds.Feb 10 2023, 5:51 PM
This revision was automatically updated to reflect the committed changes.
foad added a subscriber: foad.Mar 2 2023, 5:12 AM