I have a C file with functions and calls. I'm searching for a way to inline all calls. The output has to be a C file with only one function implementation.
There are very few extern functions which should not be inlined (like
scanf or functions marked with
extern). It would be ok if I had to list these functions manually.
Do the inlining by hand
The files are too big. One file has 2'757 functions and 1'500'000 lines of code.
A self-written script doing plain text processing.
The C standard can be quite complicated sometimes. I wouldn't trust such a script to get everything right.
Decompiling after compiling with inlining.
Even with the
inlinekeyword the compiler decides what to inline. There is no guarantee that all functions will be inlined. The output could be very messy.
I tagged this question as compiler because I thought I had seen a compiler option for
clang that did exactly what I wanted. But I cannot find said option anymore. I'm not even sure such an option did exist.