+ added basic olevariant support

This commit is contained in:
florian 2003-10-06 22:23:41 +00:00
parent 3d27318cb2
commit 6684d2c520
4 changed files with 39 additions and 10 deletions

View File

@ -986,7 +986,6 @@ implementation
{ reset to normal non static function } { reset to normal non static function }
if (current_procinfo.procdef.parast.symtablelevel=normal_function_level) then if (current_procinfo.procdef.parast.symtablelevel=normal_function_level) then
allow_only_static:=false; allow_only_static:=false;
current_procinfo:=oldprocinfo; current_procinfo:=oldprocinfo;
end; end;
@ -1291,7 +1290,10 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.157 2003-10-03 14:45:09 peter Revision 1.158 2003-10-06 22:23:41 florian
+ added basic olevariant support
Revision 1.157 2003/10/03 14:45:09 peter
* more proc directive for procvar fixes * more proc directive for procvar fixes
Revision 1.156 2003/10/02 21:20:32 peter Revision 1.156 2003/10/02 21:20:32 peter

View File

@ -167,6 +167,7 @@ implementation
addtype('Int64',cs64bittype); addtype('Int64',cs64bittype);
adddef('TypedFile',tfiledef.createtyped(voidtype)); adddef('TypedFile',tfiledef.createtyped(voidtype));
addtype('Variant',cvarianttype); addtype('Variant',cvarianttype);
addtype('OleVariant',colevarianttype);
{ Internal types } { Internal types }
addtype('$formal',cformaltype); addtype('$formal',cformaltype);
addtype('$void',voidtype); addtype('$void',voidtype);
@ -190,6 +191,7 @@ implementation
addtype('$openchararray',openchararraytype); addtype('$openchararray',openchararraytype);
addtype('$file',cfiletype); addtype('$file',cfiletype);
addtype('$variant',cvarianttype); addtype('$variant',cvarianttype);
addtype('$olevariant',cvarianttype);
addtype('$s32real',s32floattype); addtype('$s32real',s32floattype);
addtype('$s64real',s64floattype); addtype('$s64real',s64floattype);
addtype('$s80real',s80floattype); addtype('$s80real',s80floattype);
@ -252,6 +254,7 @@ implementation
globaldef('file',cfiletype); globaldef('file',cfiletype);
globaldef('pvmt',pvmttype); globaldef('pvmt',pvmttype);
globaldef('variant',cvarianttype); globaldef('variant',cvarianttype);
globaldef('olevariant',colevarianttype);
globaldef('methodpointer',methodpointertype); globaldef('methodpointer',methodpointertype);
{$ifdef i386} {$ifdef i386}
ordpointertype:=u32bittype; ordpointertype:=u32bittype;
@ -361,7 +364,8 @@ implementation
charpointertype.setdef(tpointerdef.create(cchartype)); charpointertype.setdef(tpointerdef.create(cchartype));
voidfarpointertype.setdef(tpointerdef.createfar(voidtype)); voidfarpointertype.setdef(tpointerdef.createfar(voidtype));
cfiletype.setdef(tfiledef.createuntyped); cfiletype.setdef(tfiledef.createuntyped);
cvarianttype.setdef(tvariantdef.create); cvarianttype.setdef(tvariantdef.create(vt_normalvariant));
colevarianttype.setdef(tvariantdef.create(vt_olevariant));
registerdef:=oldregisterdef; registerdef:=oldregisterdef;
end; end;
@ -505,7 +509,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.56 2003-09-28 17:55:04 peter Revision 1.57 2003-10-06 22:23:41 florian
+ added basic olevariant support
Revision 1.56 2003/09/28 17:55:04 peter
* parent framepointer changed to hidden parameter * parent framepointer changed to hidden parameter
* tloadparentfpnode added * tloadparentfpnode added

View File

@ -168,6 +168,10 @@ type
normset,smallset,varset normset,smallset,varset
); );
tvarianttype = (
vt_normalvariant,vt_olevariant
);
tcallercallee = (callerside,calleeside); tcallercallee = (callerside,calleeside);
{ basic type for tprocdef and tprocvardef } { basic type for tprocdef and tprocvardef }
@ -375,7 +379,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.65 2003-09-28 17:55:04 peter Revision 1.66 2003-10-06 22:23:41 florian
+ added basic olevariant support
Revision 1.65 2003/09/28 17:55:04 peter
* parent framepointer changed to hidden parameter * parent framepointer changed to hidden parameter
* tloadparentfpnode added * tloadparentfpnode added

View File

@ -138,7 +138,8 @@ interface
end; end;
tvariantdef = class(tstoreddef) tvariantdef = class(tstoreddef)
constructor create; varianttype : tvarianttype;
constructor create(v : tvarianttype);
constructor ppuload(ppufile:tcompilerppufile); constructor ppuload(ppufile:tcompilerppufile);
function gettypename:string;override; function gettypename:string;override;
procedure ppuwrite(ppufile:tcompilerppufile);override; procedure ppuwrite(ppufile:tcompilerppufile);override;
@ -696,8 +697,9 @@ interface
cfiletype, { get the same definition for all file } cfiletype, { get the same definition for all file }
{ used for stabs } { used for stabs }
methodpointertype, { typecasting of methodpointers to extract self } methodpointertype, { typecasting of methodpointers to extract self }
{ we use only one variant def } { we use only one variant def for every variant class }
cvarianttype, cvarianttype,
colevarianttype,
{ unsigned ord type with the same size as a pointer } { unsigned ord type with the same size as a pointer }
ordpointertype, ordpointertype,
defaultordconsttype, { pointer to type of ordinal constants } defaultordconsttype, { pointer to type of ordinal constants }
@ -2192,9 +2194,10 @@ implementation
TVARIANTDEF TVARIANTDEF
****************************************************************************} ****************************************************************************}
constructor tvariantdef.create; constructor tvariantdef.create(v : tvarianttype);
begin begin
inherited create; inherited create;
varianttype:=v;
deftype:=variantdef; deftype:=variantdef;
setsize; setsize;
end; end;
@ -2203,6 +2206,7 @@ implementation
constructor tvariantdef.ppuload(ppufile:tcompilerppufile); constructor tvariantdef.ppuload(ppufile:tcompilerppufile);
begin begin
inherited ppuloaddef(ppufile); inherited ppuloaddef(ppufile);
varianttype:=tvarianttype(ppufile.getbyte);
deftype:=variantdef; deftype:=variantdef;
setsize; setsize;
end; end;
@ -2211,6 +2215,7 @@ implementation
procedure tvariantdef.ppuwrite(ppufile:tcompilerppufile); procedure tvariantdef.ppuwrite(ppufile:tcompilerppufile);
begin begin
inherited ppuwritedef(ppufile); inherited ppuwritedef(ppufile);
ppufile.putbyte(byte(varianttype));
ppufile.writeentry(ibvariantdef); ppufile.writeentry(ibvariantdef);
end; end;
@ -2223,7 +2228,12 @@ implementation
function tvariantdef.gettypename : string; function tvariantdef.gettypename : string;
begin begin
gettypename:='Variant'; case varianttype of
vt_normalvariant:
gettypename:='Variant';
vt_olevariant:
gettypename:='OleVariant';
end;
end; end;
@ -5903,7 +5913,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.172 2003-10-05 21:21:52 peter Revision 1.173 2003-10-06 22:23:41 florian
+ added basic olevariant support
Revision 1.172 2003/10/05 21:21:52 peter
* c style array of const generates callparanodes * c style array of const generates callparanodes
* varargs paraloc fixes * varargs paraloc fixes