Also add a comment when a label has been optimized out when compiled DEBUG_LABEL

This commit is contained in:
Pierre Muller 2022-05-31 13:00:04 +00:00
parent ad72542e9e
commit f27b55e9b2

View File

@ -1303,12 +1303,14 @@ implementation
ait_label :
begin
if (tai_label(hp).labsym.is_used) then
begin
{$ifdef DEBUG_LABEL}
writer.AsmWrite(asminfo^.comment);
writer.AsmWriteLn('References = ' + tostr(tai_label(hp).labsym.getrefs));
if tai_label(hp).labsym.getrefs=0 then
writer.AsmWriteln(asminfo^.comment+'Optimized out label '+tai_label(hp).labsym.name);
{$endif DEBUG_LABEL}
if (tai_label(hp).labsym.is_used) then
begin
if tai_label(hp).labsym.bind in [AB_GLOBAL,AB_PRIVATE_EXTERN] then
begin
if (tai_label(hp).labsym.bind=AB_PRIVATE_EXTERN) then