This fixes a regression introduced (over three years ago!) by fcd33149b48885ab8e4ca4ffb6977bce5be2e623.
Why you say regression, do you have a case where fcd33149b48885ab8e4ca4ffb6977bce5be2e623 actually regressed things?
-O0 implies optnone. For -Xclang -disable-O0-optnone -O0 -finline-functions, the patch can indeed make a difference. -disable-O0-optnone is currently a debug aid AFAICT.
GCC -O0 -finline-functions does not seem to have a difference.
The old order looks good. The new ordering does not seen to be needed? The assert is also unnecessary.
Hi @MaskRay – I was just looking at the source history. I didn't test the old way. As it turns out there isn't a regression, but just some unexplained code in the current clang option parsing. And the -disable-O0-optnone is a useful hint. Thanks! I've been hacking on clang and trying to get the normal inliner pass to run at -O0, but with no luck so far.