+ some front end stuff for vs_hidden added

This commit is contained in:
florian 2002-12-15 19:34:31 +00:00
parent 938f46f246
commit 3f5541e996
3 changed files with 95 additions and 51 deletions

View File

@ -78,6 +78,8 @@ interface
procedure Clear;
{ inserts an Item }
procedure Insert(Item:TLinkedListItem);
{ inserts an Item after Loc }
procedure InsertAfter(Item,Loc : TLinkedListItem);
{ concats an Item }
procedure Concat(Item:TLinkedListItem);
{ deletes an Item }
@ -318,7 +320,7 @@ implementation
begin
{$ifndef Delphi}
inc(TotalMem,memavail-startmem);
{$endif}
{$endif}
startmem:=0;
end;
end;
@ -472,6 +474,20 @@ end;
end;
procedure TLinkedList.InsertAfter(Item,Loc : TLinkedListItem);
begin
Item.Next:=Loc.Next;
Loc.Next:=Item;
Item.Previous:=Loc;
if assigned(Item.Next) then
Item.Next.Previous:=Item
else
{ if we've no next item, we've to adjust FLast }
FLast:=Item;
inc(FCount);
end;
procedure TLinkedList.Concat(Item:TLinkedListItem);
begin
if FFirst=nil then
@ -1821,7 +1837,10 @@ end;
end.
{
$Log$
Revision 1.21 2002-11-24 18:18:39 carl
Revision 1.22 2002-12-15 19:34:31 florian
+ some front end stuff for vs_hidden added
Revision 1.21 2002/11/24 18:18:39 carl
- remove some unused defines
Revision 1.20 2002/10/05 12:43:23 carl

View File

@ -128,7 +128,7 @@ implementation
(tsym(indexnext).typ=varsym) and
(copy(tvarsym(indexnext).name,1,4)='high') then
begin
{ removing it is to complicated,
{ removing it is too complicated,
we just hide it PM }
highname:='hidden'+copy(tvarsym(indexnext).name,5,high(name));
Message(parser_w_cdecl_has_no_high);
@ -365,6 +365,9 @@ implementation
begin
hvs:=tvarsym.create('$high'+vs.name,s32bittype);
hvs.varspez:=vs_const;
{$ifdef vs_hidden}
aktprocdef.concatpara(s32bittype,hvs,vs_hidden,nil);
{$endif vs_hidden}
currparast.insert(hvs);
end;
aktprocdef.concatpara(tt,vs,varspez,tdefaultvalue);
@ -2076,7 +2079,10 @@ const
end.
{
$Log$
Revision 1.87 2002-12-07 14:27:07 carl
Revision 1.88 2002-12-15 19:34:31 florian
+ some front end stuff for vs_hidden added
Revision 1.87 2002/12/07 14:27:07 carl
* 3% memory optimization
* changed some types
+ added type checking with different size for call node and for

View File

@ -3186,12 +3186,22 @@ implementation
hp : TParaItem;
hpc : tconstsym;
begin
{ look for a visible parameter }
hp:=TParaItem(Para.last);
while assigned(hp) do
begin
if hp.paratyp<>vs_hidden then
break;
hp:=TParaItem(hp.previous);
end;
{ no visible parameter? }
if not(assigned(hp)) then
begin
typename_paras:='';
exit;
end;
hp:=TParaItem(Para.last);
s:='(';
while assigned(hp) do
begin
@ -3201,50 +3211,53 @@ implementation
s:=s+'const'
else if hp.paratyp=vs_out then
s:=s+'out';
if assigned(hp.paratype.def.typesym) then
if hp.paratyp<>vs_hidden then
begin
if hp.paratyp in [vs_var,vs_const,vs_out] then
s := s + ' ';
hs:=hp.paratype.def.typesym.realname;
if hs[1]<>'$' then
s:=s+hp.paratype.def.typesym.realname
else
s:=s+hp.paratype.def.gettypename;
end;
{ default value }
if assigned(hp.defaultvalue) then
begin
hpc:=tconstsym(hp.defaultvalue);
hs:='';
case hpc.consttyp of
conststring,
constresourcestring :
hs:=strpas(pchar(hpc.value.valueptr));
constreal :
str(pbestreal(hpc.value.valueptr)^,hs);
constord :
hs:=tostr(hpc.value.valueord);
constpointer :
hs:=tostr(hpc.value.valueordptr);
constbool :
begin
if hpc.value.valueord<>0 then
hs:='TRUE'
else
hs:='FALSE';
if assigned(hp.paratype.def.typesym) then
begin
if hp.paratyp in [vs_var,vs_const,vs_out] then
s := s + ' ';
hs:=hp.paratype.def.typesym.realname;
if hs[1]<>'$' then
s:=s+hp.paratype.def.typesym.realname
else
s:=s+hp.paratype.def.gettypename;
end;
{ default value }
if assigned(hp.defaultvalue) then
begin
hpc:=tconstsym(hp.defaultvalue);
hs:='';
case hpc.consttyp of
conststring,
constresourcestring :
hs:=strpas(pchar(hpc.value.valueptr));
constreal :
str(pbestreal(hpc.value.valueptr)^,hs);
constord :
hs:=tostr(hpc.value.valueord);
constpointer :
hs:=tostr(hpc.value.valueordptr);
constbool :
begin
if hpc.value.valueord<>0 then
hs:='TRUE'
else
hs:='FALSE';
end;
constnil :
hs:='nil';
constchar :
hs:=chr(hpc.value.valueord);
constset :
hs:='<set>';
end;
constnil :
hs:='nil';
constchar :
hs:=chr(hpc.value.valueord);
constset :
hs:='<set>';
end;
if hs<>'' then
s:=s+'="'+hs+'"';
end;
if hs<>'' then
s:=s+'="'+hs+'"';
end;
end;
hp:=TParaItem(hp.previous);
if assigned(hp) then
if assigned(hp) and (hp.paratyp<>vs_hidden) then
s:=s+',';
end;
s:=s+')';
@ -3810,17 +3823,20 @@ implementation
end;
{ we need to use the symtable where the procsym is inserted,
because that is visible to the world }
s:=mangledname_prefix('',procsym.owner)+procsym.name+'$';
s:=mangledname_prefix('',procsym.owner)+procsym.name;
if overloadnumber>0 then
s:=s+tostr(overloadnumber)+'$';
s:=s+'$'+tostr(overloadnumber);
{ add parameter types }
hp:=TParaItem(Para.last);
if assigned(hp) and (hp.paratyp<>vs_hidden) then
s:=s+'$';
while assigned(hp) do
begin
s:=s+hp.paratype.def.mangledparaname;
if hp.paratyp<>vs_hidden then
s:=s+hp.paratype.def.mangledparaname;
hp:=TParaItem(hp.previous);
if assigned(hp) then
s:=s+'$';
if assigned(hp) and (hp.paratyp<>vs_hidden) then
s:=s+'$';
end;
_mangledname:=stringdup(s);
mangledname:=_mangledname^;
@ -5522,7 +5538,10 @@ implementation
end.
{
$Log$
Revision 1.116 2002-12-15 11:26:02 peter
Revision 1.117 2002-12-15 19:34:31 florian
+ some front end stuff for vs_hidden added
Revision 1.116 2002/12/15 11:26:02 peter
* ignore vs_hidden parameters when choosing overloaded proc
Revision 1.115 2002/12/07 14:27:09 carl