From 5fa5ff1730e3020d3c552e34d05789e3f69243a2 Mon Sep 17 00:00:00 2001 From: svenbarth Date: Fri, 13 Jan 2017 16:25:22 +0000 Subject: [PATCH] + 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 - --- compiler/ncgrtti.pas | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/compiler/ncgrtti.pas b/compiler/ncgrtti.pas index 9fff6a3f72..f196c2148e 100644 --- a/compiler/ncgrtti.pas +++ b/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;