Просмотр исходного кода

+ new method TRTTIWriter.methods_write_rtti() to ensure that the TypeInfo of parameters and result type of methods is written (can be restricted to certain visibilities and whether hidden parameters shall be checked as well)

git-svn-id: trunk@35290 -
svenbarth 8 лет назад
Родитель
Сommit
5fa5ff1730
1 измененных файлов с 21 добавлено и 0 удалено
  1. 21 0
      compiler/ncgrtti.pas

+ 21 - 0
compiler/ncgrtti.pas

@@ -46,6 +46,7 @@ interface
         procedure fields_write_rtti(st:tsymtable;rt:trttitype);
         procedure params_write_rtti(def:tabstractprocdef;rt:trttitype;allow_hidden:boolean);
         procedure fields_write_rtti_data(tcb: ttai_typedconstbuilder; def: tabstractrecorddef; rt: trttitype);
+        procedure methods_write_rtti(st:tsymtable;rt:trttitype;visibilities:tvisibilities;allow_hidden:boolean);
         procedure write_rtti_extrasyms(def:Tdef;rt:Trttitype;mainrtti:Tasmsymbol);
         procedure published_write_rtti(st:tsymtable;rt:trttitype);
         function  published_properties_count(st:tsymtable):longint;
@@ -420,6 +421,26 @@ implementation
       end;
 
 
+    procedure TRTTIWriter.methods_write_rtti(st:tsymtable;rt:trttitype;visibilities:tvisibilities;allow_hidden:boolean);
+      var
+        i,j : longint;
+        sym : tprocsym;
+        def : tabstractprocdef;
+      begin
+        for i:=0 to st.symlist.count-1 do
+          if tsym(st.symlist[i]).typ=procsym then
+            begin
+              sym:=tprocsym(st.symlist[i]);
+              for j:=0 to sym.procdeflist.count-1 do
+                begin
+                  def:=tabstractprocdef(sym.procdeflist[j]);
+                  write_rtti(def.returndef,rt);
+                  params_write_rtti(def,rt,allow_hidden);
+                end;
+            end;
+      end;
+
+
     procedure TRTTIWriter.published_write_rtti(st:tsymtable;rt:trttitype);
       var
         i   : longint;