瀏覽代碼

* Added assembler comments about unused parameters.

git-svn-id: trunk@46522 -
yury 5 年之前
父節點
當前提交
de3a479be3
共有 1 個文件被更改,包括 10 次插入2 次删除
  1. 10 2
      compiler/ncgcal.pas

+ 10 - 2
compiler/ncgcal.pas

@@ -128,13 +128,14 @@ implementation
 
 
     uses
     uses
       systems,
       systems,
-      verbose,globals,
+      verbose,globals,cutils,
       symconst,symtable,symtype,symsym,defutil,paramgr,
       symconst,symtable,symtype,symsym,defutil,paramgr,
       pass_2,
       pass_2,
       nld,ncnv,
       nld,ncnv,
       ncgutil,blockutl,
       ncgutil,blockutl,
       cgobj,tgobj,hlcgobj,
       cgobj,tgobj,hlcgobj,
       procinfo,
       procinfo,
+      aasmtai,
       wpobase;
       wpobase;
 
 
 
 
@@ -306,7 +307,14 @@ implementation
           exit;
           exit;
         { If we can't skip loading of the parameter, load an undefined dummy value. }
         { If we can't skip loading of the parameter, load an undefined dummy value. }
         if not can_skip_para_push(parasym) then
         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;
       end;