basic block labels in assembly (.s file)

Hi, All,

If I use ‘llc’ to generate .s file, I notice usually the basic block labels are like “.LBB_number:”. Is there a way that I can change the labels to other names, for example, to “.MyLabel_number:” ? I think this should be related to AsmPrinter, but I cannot narrow down to certain specific source code.

Any help and suggestion is appreciated.

Regards,

Xiangyang

Hi,

Does this need to be done in AsmPrinter?

Maybe it's possible to script this. In python, it could be:

with open(Path, 'rb') as F:
    re.subn(r'\.LBB_(\d+)', lambda M: '.MyLabel_' + M.group(1), F.read())

vedant

Hi, All,

If I use 'llc' to generate .s file, I notice usually the basic block labels
are like ".LBB_number:". Is there a way that I can change the labels to
other names, for example, to ".MyLabel_number:" ? I think this should be
related to AsmPrinter, but I cannot narrow down to certain specific source
code.

The '.L' prefix comes from the value of your target's MCAsmInfo::PrivateLabelPrefix.
This is configurable.

-Tom