On Thu, Jun 16, 2022 at 5:05 PM Prathamesh Kulkarni via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: > > Hi, > I just noticed -fdump-statistics supports asmname sub-option, which > according to the doc states: > "If DECL_ASSEMBLER_NAME has been set for a given decl, use that in the dump > instead of DECL_NAME. Its primary use is ease of use working backward from > mangled names in the assembly file." > > When passed -fdump-statistics-asmname, the dump however still contains the > original name of functions. The patch modifies statistics.cc to emit asm > name of function instead. Also for C++, it helps to better disambiguate > overloaded function names in the stats dump file. > I have attached stats dump for a simple test-case. > > Does it look OK ?
decl_assembler_name has the side-effect of computing and setting it if it is not set already - I think that's unwanted. You probably want to use it only if DECL_ASSEMBLER_NAME_SET_P which then means when it gets it later the dump will be split. Richard. > > Thanks, > Prathamesh