Explorar o código

* keep track of the current specialization state of the current module

Sven/Sarah Barth hai 7 meses
pai
achega
db83f9c696
Modificáronse 3 ficheiros con 9 adicións e 3 borrados
  1. 1 0
      compiler/fmodule.pas
  2. 5 3
      compiler/pgentype.pas
  3. 3 0
      compiler/pgenutil.pas

+ 1 - 0
compiler/fmodule.pas

@@ -232,6 +232,7 @@ interface
         waitingunits: tfpobjectlist;
 
         finishstate: pointer;
+        specializestate : pointer;
 
         namespace: pshortstring; { for JVM target: corresponds to Java package name }
 

+ 5 - 3
compiler/pgentype.pas

@@ -34,10 +34,12 @@ const
   inline_specialization_block_types = [bt_type,bt_var_type,bt_const_type,bt_body,bt_except];
 
 type
+  pspecializationstate = ^tspecializationstate;
   tspecializationstate = record
-    oldsymtablestack   : tsymtablestack;
-    oldextendeddefs    : tfphashobjectlist;
-    oldgenericdummysyms: tfphashobjectlist;
+    oldsymtablestack    : tsymtablestack;
+    oldextendeddefs     : tfphashobjectlist;
+    oldgenericdummysyms : tfphashobjectlist;
+    oldspecializestate  : pspecializationstate;
   end;
 
   tspecializationcontext=class

+ 3 - 0
compiler/pgenutil.pas

@@ -2740,6 +2740,8 @@ uses
       state.oldsymtablestack:=symtablestack;
       state.oldextendeddefs:=current_module.extendeddefs;
       state.oldgenericdummysyms:=current_module.genericdummysyms;
+      state.oldspecializestate:=pspecializationstate(current_module.specializestate);
+      current_module.specializestate:=@state;
       current_module.extendeddefs:=TFPHashObjectList.create(true);
       current_module.genericdummysyms:=tfphashobjectlist.create(true);
       symtablestack:=tdefawaresymtablestack.create;
@@ -2819,6 +2821,7 @@ uses
       current_module.extendeddefs:=state.oldextendeddefs;
       current_module.genericdummysyms.free;
       current_module.genericdummysyms:=state.oldgenericdummysyms;
+      current_module.specializestate:=state.oldspecializestate;
       symtablestack.free;
       symtablestack:=state.oldsymtablestack;
       { clear the state record to be on the safe side }