Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Change default optimisation level to O1 when exporting to uVision #11212
When exporting to uVision the default level is O0 which is wasteful as dead code and variables are included. O1 removes this without causing debugging issues.
Pull request type
Default uVision optimisation level changed to O1. It matches the debug profile.
Ideally the export should match debug profile which it now does?
It would be possible to output uVision projects that include all 3 profiles as different project targets
Or alternatively pass the profiles optimisation level to the exporter.
Sadly both are a bit beyond the time I can commit to this.
How do exporters and profiles interact? Are the exporters supposed to export according to a specified profile, or create an export with all profiles?
I think it's got to be one of the above, and either way, it would be preferable to pick the optimisation level up from the profile, just like the language selection. I was messing with that mapping in #11225; I'm not familiar with how all the plumbing hangs together, but presumably that concept could easily be copied over for the optimisation and debug options.
My initial expectation were the same but I checked some and could not find optimization being exported.
They contain "non valid flag" checks:
This means exporters are using predefined optimization level in templates and even ignores some other flags as we can see.
Ideally yes (exporting profiles is not that simple but if we can use the profile then it would be as simple as export debug or export release. Having multiple profiles is supported by many tools, but might require bit more work to refactor templates). It might be worth creating a new ticket for this (to find out why there are these non valid options in each exporter).