In order to get more familiar with the llvm sources I've recently
decided to try to add support for the always_inline and noline function
attributes.
I believe it is better to let the compiler decide when or not to inline a
function. Most of the times a developer goes overboard with inlining and ends
up with a lot of duplicated code that performs worse (this happened in the
company I used to work for).
While the core implementation does not look very complicated both on the
gcc and llvm side it seems that there are no provisions in the bytecode
to actually store such additonal information (need 2 bits in this case).
Did I miss something ?If not, are there any plans to enhance the bytecode for function, type
and variable attributes ? Calling convention (cdecl, stdcall, ..) will
sooner or later be needed for Windows, ELF visibility would be nice, and
things like packed/aligned are often required when talking to the OS
or some other library.
The is a plan to add calling conventions to llvm functions. See:
http://nondot.org/sabre/LLVMNotes/CustomCallingConventions.txt
If you are interested in tackling this it, it would be a great contribution to
LLVM!
Even if llvm basically does ignore any "unsupported" attributes the
CWriter could still use a number of them without major changes.
This will limit the C backend's portability. We would like to avoid using
anything out of ANSI C if we can.