Browse Source

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 years ago
parent
commit
5255c936d3
1 changed files with 14 additions and 7 deletions
  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 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 }
     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
 implementation
 
 
@@ -522,22 +523,28 @@ implementation
 
 
 
 
     procedure check_hints(const srsym: tsym; const symoptions: tsymoptions; const deprecatedmsg : pshortstring);
     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
       begin
         if not assigned(srsym) then
         if not assigned(srsym) then
           internalerror(200602051);
           internalerror(200602051);
         if sp_hint_deprecated in symoptions then
         if sp_hint_deprecated in symoptions then
           if (sp_has_deprecated_msg in symoptions) and (deprecatedmsg <> nil) 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
           else
-            Message1(sym_w_deprecated_symbol,srsym.realname);
+            MessagePos1(filepos,sym_w_deprecated_symbol,srsym.realname);
         if sp_hint_experimental in symoptions then
         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
         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
         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
         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;
       end;
 
 
 {****************************************************************************
 {****************************************************************************