From de3a479be3a56a2bcb4f43c778d735b4b95e4d99 Mon Sep 17 00:00:00 2001 From: yury <jura@cp-lab.com> Date: Thu, 20 Aug 2020 20:08:10 +0000 Subject: [PATCH] * Added assembler comments about unused parameters. git-svn-id: trunk@46522 - --- compiler/ncgcal.pas | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/compiler/ncgcal.pas b/compiler/ncgcal.pas index 5c3b830393..245e6561d5 100644 --- a/compiler/ncgcal.pas +++ b/compiler/ncgcal.pas @@ -128,13 +128,14 @@ implementation uses systems, - verbose,globals, + verbose,globals,cutils, symconst,symtable,symtype,symsym,defutil,paramgr, pass_2, nld,ncnv, ncgutil,blockutl, cgobj,tgobj,hlcgobj, procinfo, + aasmtai, wpobase; @@ -306,7 +307,14 @@ implementation exit; { If we can't skip loading of the parameter, load an undefined dummy value. } if not can_skip_para_push(parasym) then - hlcg.a_load_undefined_cgpara(current_asmdata.CurrAsmList,left.resultdef,tempcgpara); + begin + if cs_asm_source in current_settings.globalswitches then + current_asmdata.CurrAsmList.concat(tai_comment.Create(strpnew('Parameter '+parasym.realname+' is unused, loading undefined value'))); + hlcg.a_load_undefined_cgpara(current_asmdata.CurrAsmList,left.resultdef,tempcgpara); + end + else + if cs_asm_source in current_settings.globalswitches then + current_asmdata.CurrAsmList.concat(tai_comment.Create(strpnew('Parameter '+parasym.realname+' is unused'))); end;