Today symbol names generated for machine basic block sections use a unary encoding to reduce bloat. This is essential when every basic block in the binary is assigned a symbol however with basic block clusters (rG05192e585ce175b55f2a26b83b4ed7882785c8e6) when we only need to generate a few non-temporary symbols we can assign more descriptive names making them more user friendly. With this change -
- Cold cluster section for function foo is named "foo.cold"
- Exception cluster section for function foo is named "foo.eh"
- Other cluster sections identified by their ids are named "foo.ID"
Using this format works well with existing tools. It will demangle as expected and works with existing symbolizers, profilers and debuggers out of the box.
$ c++filt _Z3foov.cold
foo() [clone .cold]
$ c++filt _Z3foov.eh
foo() [clone .eh]
$c++filt _Z3foov.1234
foo() [clone 1234]
Tests for basicblock-sections are updated with some cleanup where appropriate.
Just a comment: I like this because it will demangle as expected and works well with existing symbolizers, profilers and debuggers out of the box.
$ c++filt _Z3foov.cold
foo() [clone .cold]
$ c++filt _Z3foov.eh
foo() [clone .eh]
$c++filt _Z3foov.1234
foo() [clone 1234]