[llvm] [RISCV] Assert extensions are sorted at compile time. NFCI (PR #77442)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 9 10:00:59 PST 2024


lukel97 wrote:

> Does this give a good error message when it fails? I've inserted a print in the runtime code more than once due to bad merge resolution in my downstream to figure out which extension is misplaced.

Just the same message that the current runtime check gives, e.g. "blah is not sorted". It would be nice if static_assert could actually print out the failing value or report a non-literal string, [but it looks like we won't be able to until C++23.](https://en.cppreference.com/w/cpp/language/static_assert)

I guess as a workaround you could comment out the static_assert when it fails, then call `isSorted` at runtime and add an assert.


https://github.com/llvm/llvm-project/pull/77442


More information about the llvm-commits mailing list