Will this code:
inline int funcA(int a) __attribute__((always_inline))
{
return a + 1;
}
inline int funcB(int b) __attribute__((always_inline))
{
return funcA(b + 2);
}
int main()
{
return funcB(3);
}
transformed to code like this?:
int main()
{
return ((3) + 2) + 1;
}
GCC, ARM (iPhone)
Inlining function calls is not something the language requires compilers to do. It’s a quality of implementation issue (QoI). But any of GCC, MSVC and clang will do it. Of course, you have to enable optimization.
For instance