This has been on the table for ages, but no one's gotten around to doing it.
I'm attaching a (mostly untested) patch which fixes the simple cases. For
instance, it causes this test to come out in the expected order:
void func1() { }
asm ("# ASM");
void func2() { }
It doesn't handle variable declarations, and it won't be useful until it
does. Right now declarations are written to the assembly file early, before
functions are assembled. Steven pointed out (thank you, Steven) that this
is much easier on the tree-profiling branch, where that is no longer the
case. So, I'm not going to extend the patch to declarations until that
piece is merged.
In the mean time, any fundamental objections to the approach?