Is it during a pre-processing or compilation stage, say on gcc? Is it different on other compilers?
The stack frame is created at runtime by modifying the stack register of the processor (esp
for Intel x86).
The compiler only dump specific instructions to reserve space on the stack at each function call. This space is then recovered when the function exits.