-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Increase use of C constexpr constant expressions in the code base. #7720
Comments
This requires rather modern compilers, though. |
For a lot of stuff like this compilers that are actually C 17 standard compliant should be sufficient... but yeah - for more complex stuff like the rule list this would be rather tricky and would probably also require quite some restructuring, so that we'd have to evaluate separately. |
I think one may want to start with the obvious stuff, and create smaller PRs for each iteration (whenever they come up), and by the time, evaluate whether or not it makes sense to also migrate the more complex stuff. However, I'd highly recommend to apply |
Hi everyone! This issue has been closed due to inactivity. |
Came up in #7655 (comment) with one minor example for this.
But in general I'd expect a lot of places in the compiler could be refactored to benefit from constant expressions. One prominent example would be the simplification rule list, which is entirely compile time constant and with a bit of care could be constexpr initialized to a
std::array
which could live statically in the data segment. That might especially have beneficial consequences for the emscripten builds and the stack issues.There's probably a lot of other places as well.
The text was updated successfully, but these errors were encountered: