* insert vmt as hidden field in objectdefs

* don't output hidden fields in the debug info

git-svn-id: trunk@11334 -
This commit is contained in:
Jonas Maebe 2008-07-06 09:41:56 +00:00
parent 98e843c092
commit c00108009d
3 changed files with 9 additions and 3 deletions

View File

@ -1870,7 +1870,7 @@ implementation
fieldoffset,
fieldnatsize: aint;
begin
if sp_static in sym.symoptions then
if ([sp_static,sp_hidden] * sym.symoptions <> []) then
exit;
if (tabstractrecordsymtable(sym.owner).usefieldalignment<>bit_alignment) or

View File

@ -351,6 +351,8 @@ implementation
newss : ansistring;
ss : pansistring absolute arg;
begin
if (sp_hidden in tsym(p).symoptions) then
exit;
{ static variables from objects are like global objects }
if (Tsym(p).typ=fieldvarsym) and
not(sp_static in Tsym(p).symoptions) then

View File

@ -3968,6 +3968,8 @@ implementation
procedure tobjectdef.insertvmt;
var
vs: tfieldvarsym;
begin
if objecttype in [odt_interfacecom,odt_interfacecorba,odt_dispinterface] then
exit;
@ -3986,8 +3988,10 @@ implementation
end;
vmt_offset:=tObjectSymtable(symtable).datasize;
tObjectSymtable(symtable).datasize:=
tObjectSymtable(symtable).datasize+sizeof(pint);
vs:=tfieldvarsym.create('_vptr$'+objname^,vs_value,voidpointertype,[]);
hidesym(vs);
tObjectSymtable(symtable).insert(vs);
tObjectSymtable(symtable).addfield(vs);
include(objectoptions,oo_has_vmt);
end;
end;