4 ms·
I have read this article before and I really like the idea of doing so. I would love to read more about how you guys modified the compiler!
by gobwas 6y ago
I have read this article before and I really like the idea of doing so. I would love to read more about how you guys modified the compiler!
- Julio-Guerra 6y agoWe haven't modified the compiler but instead plugged into it an external instrumentation tool using the compiler option `-toolexec`. With this option, the compiler invokes every toolchain binary (compile, asm, link, etc.) through the provided program. So you can basically write a proxy program intercepting calls to `compile` to do source-code instrumentation, exactly like you would with go generate, but now automatically done during compilation on every package.
- gobwas 6y agoAh, cool! Thank you so much, didn't know about this parameter :D Will try it definitely.