Clang exposes attribute 'minsize' which can be used to perform optimizations to reduce code size as much as possible. Like optimization flag -Oz.
This patch exposes attribute 'optsize' which can be used to perform optimizations to reduce code size and at the same time the impact on performance stays minimal. Like optimization flag -Os.
I would like to hold off on this until we have more agreement on https://reviews.llvm.org/D126984 because I would like clang::optsize to be expressed as one of the spellings of the attribute proposed there instead of introducing a separate semantic attribute for it. Then we can also shift clang::optnone as well. (Though I'm guessing we may have to figure out something for the documentation so that we don't cram all of the docs into one place -- that leaks an implementation detail.)