Browse Source

+ add a new symoption for symbols created for nameless types during implicit function specialization so that they can be recognized

Sven/Sarah Barth 3 years ago
parent
commit
6a6a17717a
3 changed files with 19 additions and 15 deletions
  1. 1 0
      compiler/pgenutil.pas
  2. 3 1
      compiler/symconst.pas
  3. 15 14
      compiler/utils/ppuutils/ppudump.pp

+ 1 - 0
compiler/pgenutil.pas

@@ -758,6 +758,7 @@ uses
           else
             begin
               newtype:=ctypesym.create(def.fullownerhierarchyname(false)+typName[def.typ]+'$'+def.unique_id_str,def);
+              include(newtype.symoptions,sp_generic_unnamed_type);
               newtype.owner:=def.owner;
               { ensure that there's no warning }
               newtype.refs:=1;

+ 3 - 1
compiler/symconst.pas

@@ -214,7 +214,9 @@ type
                               "overridden" with a completely different symbol }
     sp_explicitrename,      { this is used to keep track of type renames created
                               by the user }
-    sp_generic_const
+    sp_generic_const,
+    sp_generic_unnamed_type { type symbol created for an anonymous type during
+                              an implicit function specialization }
   );
   tsymoptions=set of tsymoption;
 

+ 15 - 14
compiler/utils/ppuutils/ppudump.pp

@@ -1705,20 +1705,21 @@ const
   symopts=ord(high(tsymoption)) - ord(low(tsymoption));
   { sp_none = 0 corresponds to nothing }
   symopt : array[1..symopts] of tsymopt=(
-     (mask:sp_static;             str:'Static'),
-     (mask:sp_hint_deprecated;    str:'Hint Deprecated'),
-     (mask:sp_hint_platform;      str:'Hint Platform'),
-     (mask:sp_hint_library;       str:'Hint Library'),
-     (mask:sp_hint_unimplemented; str:'Hint Unimplemented'),
-     (mask:sp_hint_experimental;  str:'Hint Experimental'),
-     (mask:sp_has_overloaded;     str:'Has overloaded'),
-     (mask:sp_internal;           str:'Internal'),
-     (mask:sp_implicitrename;     str:'Implicit Rename'),
-     (mask:sp_generic_para;       str:'Generic Parameter'),
-     (mask:sp_has_deprecated_msg; str:'Has Deprecated Message'),
-     (mask:sp_generic_dummy;      str:'Generic Dummy'),
-     (mask:sp_explicitrename;     str:'Explicit Rename'),
-     (mask:sp_generic_const;      str:'Generic Constant Parameter')
+     (mask:sp_static;              str:'Static'),
+     (mask:sp_hint_deprecated;     str:'Hint Deprecated'),
+     (mask:sp_hint_platform;       str:'Hint Platform'),
+     (mask:sp_hint_library;        str:'Hint Library'),
+     (mask:sp_hint_unimplemented;  str:'Hint Unimplemented'),
+     (mask:sp_hint_experimental;   str:'Hint Experimental'),
+     (mask:sp_has_overloaded;      str:'Has overloaded'),
+     (mask:sp_internal;            str:'Internal'),
+     (mask:sp_implicitrename;      str:'Implicit Rename'),
+     (mask:sp_generic_para;        str:'Generic Parameter'),
+     (mask:sp_has_deprecated_msg;  str:'Has Deprecated Message'),
+     (mask:sp_generic_dummy;       str:'Generic Dummy'),
+     (mask:sp_explicitrename;      str:'Explicit Rename'),
+     (mask:sp_generic_const;       str:'Generic Constant Parameter'),
+     (mask:sp_generic_unnamed_type;str:'Generic Unnamed Type')
   );
 var
   symoptions : tsymoptions;