瀏覽代碼

symsym.pas:
+ add an overload of check_hints() that allows to specify the current file position
* have the previous check_hints() procedure be an inline procedure as it simply calls the new overload

git-svn-id: trunk@31513 -

svenbarth 10 年之前
父節點
當前提交
5255c936d3
共有 1 個文件被更改,包括 14 次插入7 次删除
  1. 14 7
      compiler/symsym.pas

+ 14 - 7
compiler/symsym.pas

@@ -484,7 +484,8 @@ interface
     function internal_static_field_name(const fieldname: TSymStr): TSymStr;
     function get_high_value_sym(vs: tparavarsym):tsym; { marking it as inline causes IE 200311075 during loading from ppu file }
 
-    procedure check_hints(const srsym: tsym; const symoptions: tsymoptions; const deprecatedmsg : pshortstring);
+    procedure check_hints(const srsym: tsym; const symoptions: tsymoptions; const deprecatedmsg : pshortstring);inline;
+    procedure check_hints(const srsym: tsym; const symoptions: tsymoptions; const deprecatedmsg : pshortstring;filepos:tfileposinfo);
 
 implementation
 
@@ -522,22 +523,28 @@ implementation
 
 
     procedure check_hints(const srsym: tsym; const symoptions: tsymoptions; const deprecatedmsg : pshortstring);
+      begin
+        check_hints(srsym,symoptions,deprecatedmsg,current_filepos);
+      end;
+
+
+    procedure check_hints(const srsym: tsym; const symoptions: tsymoptions; const deprecatedmsg : pshortstring;filepos:tfileposinfo);
       begin
         if not assigned(srsym) then
           internalerror(200602051);
         if sp_hint_deprecated in symoptions then
           if (sp_has_deprecated_msg in symoptions) and (deprecatedmsg <> nil) then
-            Message2(sym_w_deprecated_symbol_with_msg,srsym.realname,deprecatedmsg^)
+            MessagePos2(filepos,sym_w_deprecated_symbol_with_msg,srsym.realname,deprecatedmsg^)
           else
-            Message1(sym_w_deprecated_symbol,srsym.realname);
+            MessagePos1(filepos,sym_w_deprecated_symbol,srsym.realname);
         if sp_hint_experimental in symoptions then
-          Message1(sym_w_experimental_symbol,srsym.realname);
+          MessagePos1(filepos,sym_w_experimental_symbol,srsym.realname);
         if sp_hint_platform in symoptions then
-          Message1(sym_w_non_portable_symbol,srsym.realname);
+          MessagePos1(filepos,sym_w_non_portable_symbol,srsym.realname);
         if sp_hint_library in symoptions then
-          Message1(sym_w_library_symbol,srsym.realname);
+          MessagePos1(filepos,sym_w_library_symbol,srsym.realname);
         if sp_hint_unimplemented in symoptions then
-          Message1(sym_w_non_implemented_symbol,srsym.realname);
+          MessagePos1(filepos,sym_w_non_implemented_symbol,srsym.realname);
       end;
 
 {****************************************************************************