This fixes a regression introduced (over three years ago!) by fcd33149b48885ab8e4ca4ffb6977bce5be2e623.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Hi @lebedev.ri – Before I add a small new test file, is there an existing one that you know of that would be good to extend?
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.
clang/lib/Frontend/CompilerInvocation.cpp | ||
---|---|---|
702 | 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.
I'm abandoning this due to lack of time and the problem being more involved than I thought.
The old order looks good. The new ordering does not seen to be needed? The assert is also unnecessary.