[PATCH] D28404: IRGen: Add optnone attribute on function during O0

Mehdi AMINI via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 9 16:07:22 PST 2017


mehdi_amini added a comment.



> I'm now thinking along the lines of a `-foptimize-off` flag (bikesheds welcome) which would set the default for the pragma to 'off'.  How is that different than what you wanted for `-O0`?  It is defined in terms of an existing pragma, which is WAY easier to explain and WAY easier to implement.  And, it still lets us say that `-c -O0 -flto` is a mistake, if that seems like a useful thing to say.

Well -O0 being actually "disable optimization", I found "way easier" to handle everything the same way (pragma, command line, etc.). I kind of find it confusing for the user to differentiate `-O0` from `-foptimize=off`. What is supposed to change between the two?


https://reviews.llvm.org/D28404





More information about the cfe-commits mailing list