Bladeren bron

* problems with rtti fixed, hope it works

florian 27 jaren geleden
bovenliggende
commit
d5aea5e17f
4 gewijzigde bestanden met toevoegingen van 36 en 17 verwijderingen
  1. 6 3
      compiler/cg386ld.pas
  2. 6 3
      compiler/cg386mem.pas
  3. 18 9
      compiler/symdef.inc
  4. 6 2
      compiler/symdefh.inc

+ 6 - 3
compiler/cg386ld.pas

@@ -413,7 +413,7 @@ implementation
                                    { increment source reference counter }
                                    new(r);
                                    reset_reference(r^);
-                                   r^.symbol:=stringdup(lab2str(p^.right^.resulttype^.get_rtti_label));
+                                   r^.symbol:=stringdup(p^.right^.resulttype^.get_rtti_label);
                                    emitpushreferenceaddr(exprasmlist,r^);
 
                                    emitpushreferenceaddr(exprasmlist,p^.right^.location.reference);
@@ -426,7 +426,7 @@ implementation
                                    { decrement destination reference counter }
                                    new(r);
                                    reset_reference(r^);
-                                   r^.symbol:=stringdup(lab2str(p^.left^.resulttype^.get_rtti_label));
+                                   r^.symbol:=stringdup(p^.left^.resulttype^.get_rtti_label);
                                    emitpushreferenceaddr(exprasmlist,r^);
 
                                    emitpushreferenceaddr(exprasmlist,p^.left^.location.reference);
@@ -689,7 +689,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.30  1998-11-18 17:45:24  peter
+  Revision 1.31  1998-11-20 15:35:54  florian
+    * problems with rtti fixed, hope it works
+
+  Revision 1.30  1998/11/18 17:45:24  peter
     * fixes for VALUEPARA
 
   Revision 1.29  1998/11/18 15:44:11  peter

+ 6 - 3
compiler/cg386mem.pas

@@ -148,7 +148,7 @@ implementation
                   begin
                      new(r);
                      reset_reference(r^);
-                     r^.symbol:=stringdup(lab2str(ppointerdef(p^.left^.resulttype)^.definition^.get_rtti_label));
+                     r^.symbol:=stringdup(lab2str(ppointerdef(p^.left^.resulttype)^.definition^.get_inittable_label));
                      emitpushreferenceaddr(exprasmlist,r^);
                      { push pointer adress }
                      case p^.left^.location.loc of
@@ -168,7 +168,7 @@ implementation
                   begin
                      new(r);
                      reset_reference(r^);
-                     r^.symbol:=stringdup(lab2str(ppointerdef(p^.left^.resulttype)^.definition^.get_rtti_label));
+                     r^.symbol:=stringdup(lab2str(ppointerdef(p^.left^.resulttype)^.definition^.get_inittable_label));
                      emitpushreferenceaddr(exprasmlist,r^);
                      { push pointer adress }
                      case p^.left^.location.loc of
@@ -702,7 +702,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.18  1998-11-17 00:36:40  peter
+  Revision 1.19  1998-11-20 15:35:55  florian
+    * problems with rtti fixed, hope it works
+
+  Revision 1.18  1998/11/17 00:36:40  peter
     * more ansistring fixes
 
   Revision 1.17  1998/11/16 15:35:09  pierre

+ 18 - 9
compiler/symdef.inc

@@ -335,11 +335,11 @@
       end;
 
 
-    function tdef.get_rtti_label : plabel;
+    function tdef.get_rtti_label : string;
       begin
          if not(has_rtti) then
            generate_rtti;
-         get_rtti_label:=rtti_label;
+         get_rtti_label:=lab2str(rtti_label);
       end;
 
 
@@ -798,7 +798,7 @@
          rttilist^.concat(new(pai_const,init_32bit(min)));
          rttilist^.concat(new(pai_const,init_32bit(max)));
          if assigned(basedef) then
-           rttilist^.concat(new(pai_const,init_symbol(strpnew(lab2str(basedef^.get_rtti_label)))))
+           rttilist^.concat(new(pai_const,init_symbol(strpnew(basedef^.get_rtti_label))))
          else
            rttilist^.concat(new(pai_const,init_32bit(0)));
          {!!!!!!! Name list }
@@ -1405,7 +1405,7 @@
       begin
          rttilist^.concat(new(pai_const,init_8bit(tkSet)));
          rttilist^.concat(new(pai_const,init_8bit(otULong)));
-         rttilist^.concat(new(pai_const,init_symbol(strpnew(lab2str(setof^.get_rtti_label)))));
+         rttilist^.concat(new(pai_const,init_symbol(strpnew(setof^.get_rtti_label))));
       end;
 
 
@@ -1595,7 +1595,7 @@
          { count of elements }
          rttilist^.concat(new(pai_const,init_32bit(highrange-lowrange+1)));
          { element type }
-         rttilist^.concat(new(pai_const,init_symbol(strpnew(lab2str(definition^.get_rtti_label)))));
+         rttilist^.concat(new(pai_const,init_symbol(strpnew(definition^.get_rtti_label))));
       end;
 
 
@@ -1814,7 +1814,7 @@
 
     procedure write_field_rtti(sym : psym);{$ifndef fpc}far;{$endif}
       begin
-         rttilist^.concat(new(pai_const,init_symbol(strpnew(lab2str(pvarsym(sym)^.definition^.get_rtti_label)))));
+         rttilist^.concat(new(pai_const,init_symbol(strpnew(pvarsym(sym)^.definition^.get_rtti_label))));
          rttilist^.concat(new(pai_const,init_32bit(pvarsym(sym)^.address)));
       end;
 
@@ -2657,6 +2657,7 @@
          if (name^='TOBJECT') and not(cs_compilesystem in aktmoduleswitches) and
            isclass and (childof=pointer($ffffffff)) then
            class_tobject:=@self;
+         has_rtti:=true;
        end;
 
 
@@ -3076,7 +3077,7 @@
            proctypesinfo:=0;
          if (sym^.typ=propertysym) and ((sym^.properties and sp_published)<>0) then
            begin
-              rttilist^.concat(new(pai_const,init_symbol(strpnew(lab2str(ppropertysym(sym)^.proptype^.get_rtti_label)))));
+              rttilist^.concat(new(pai_const,init_symbol(strpnew(ppropertysym(sym)^.proptype^.get_rtti_label))));
               writeproc(ppropertysym(sym)^.readaccesssym,ppropertysym(sym)^.readaccessdef,0);
               writeproc(ppropertysym(sym)^.writeaccesssym,ppropertysym(sym)^.writeaccessdef,2);
               { isn't it stored ? }
@@ -3152,7 +3153,7 @@
 
          { write owner typeinfo }
          if assigned(childof) and ((childof^.options and oo_can_have_published)<>0) then
-           rttilist^.concat(new(pai_const,init_symbol(strpnew(lab2str(childof^.get_rtti_label)))))
+           rttilist^.concat(new(pai_const,init_symbol(strpnew(childof^.get_rtti_label))))
          else
            rttilist^.concat(new(pai_const,init_32bit(0)));
 
@@ -3186,6 +3187,11 @@
          is_publishable:=isclass;
       end;
 
+    function  tobjectdef.get_rtti_label : string;
+
+      begin
+         get_rtti_label:=rtti_name;
+      end;
 
 {****************************************************************************
                                   TERRORDEF
@@ -3207,7 +3213,10 @@
 
 {
   $Log$
-  Revision 1.70  1998-11-18 15:44:16  peter
+  Revision 1.71  1998-11-20 15:35:59  florian
+    * problems with rtti fixed, hope it works
+
+  Revision 1.70  1998/11/18 15:44:16  peter
     * VALUEPARA for tp7 compatible value parameters
 
   Revision 1.69  1998/11/10 17:54:56  peter

+ 6 - 2
compiler/symdefh.inc

@@ -83,7 +83,7 @@
           procedure write_child_init_data;virtual;
 
           { rtti }
-          function  get_rtti_label : plabel;
+          function  get_rtti_label : string;virtual;
           procedure generate_rtti;virtual;
           procedure write_rtti_data;virtual;
           procedure write_child_rtti_data;virtual;
@@ -192,6 +192,7 @@
           procedure write_child_init_data;virtual;
 
           { rtti }
+          function  get_rtti_label : string;virtual;
           procedure generate_rtti;virtual;
           procedure write_rtti_data;virtual;
           procedure write_child_rtti_data;virtual;
@@ -483,7 +484,10 @@
 
 {
   $Log$
-  Revision 1.9  1998-11-10 10:09:14  peter
+  Revision 1.10  1998-11-20 15:36:00  florian
+    * problems with rtti fixed, hope it works
+
+  Revision 1.9  1998/11/10 10:09:14  peter
     * va_list -> array of const
 
   Revision 1.8  1998/11/09 11:44:37  peter