Page MenuHomeFreeBSD

llvm: add a build knob for enabling assertions
ClosedPublic

Authored by kevans on Apr 2 2020, 8:34 PM.

Details

Summary

For head/, this will remain eternally default-on to maintain the status quo. For stable/ branches, it should be flipped to default-off to maintain the status quo.

There's value in being able to flip it one way or the other easily on head or stable branches, whether you want to gain some performance back on head/ (for machines there's little chance you'll actually hit an assertion) or potentially diagnose a problem with the version of llvm on an older branch.

This would push re@'s post-branch commit from removing the comment marker in lib/clang/llvm.build.mk to flipping the option to __DEFAULT_NO_OPTIONS -- it's unclear if this is acceptable.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Let's call it MK_LLVM_ASSERTIONS since that is the term used by upstream, even though they only use the NDEBUG macro for it. (Upstream uses the CMake configuration option -DLLVM_ENABLE_ASSERTIONS=On). For the rest I'm fine with this patch.

This revision is now accepted and ready to land.Apr 3 2020, 3:36 PM
In D24264#533992, @dim wrote:

Let's call it MK_LLVM_ASSERTIONS since that is the term used by upstream, even though they only use the NDEBUG macro for it. (Upstream uses the CMake configuration option -DLLVM_ENABLE_ASSERTIONS=On). For the rest I'm fine with this patch.

Got it- will change pre-commit, assuming re@ is OK with it.

This revision was automatically updated to reflect the committed changes.