3 ms·
Interesting, GCC has '-fstack-usage' to output the stack usage of each function into .su files, I didn't realise LLVM was lacking this feature. There is a tool
by snops 7y ago
Interesting, GCC has '-fstack-usage' to output the stack usage of each function into .su files, I didn't realise LLVM was lacking this feature.
There is a tool in rust[1] I just found that makes LLVM emit this information for rust code, but it stores it within[2] the .stack_sizes section in the emitted .elf instead. Possibly a similar trick could be added to Zig
[1] https://github.com/japaric/stack-sizes https://github.com/japaric/stack-sizes
[2] https://llvm.org/docs/CodeGenerator.html#emitting-function-stack-size-information https://llvm.org/docs/CodeGenerator.html#emitting-function-s...
- mwcampbell 7y agoI was referring to T1's ability to guarantee a particular stack size for the whole program (if I understand correctly), not individual functions.