mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-14 20:19:25 +02:00

tcallnode constructor, so that when it's needed later during pass 1, its value doesn't depend on the context in which pass 1 is executed (e.g. when inlining) (mantis #18121) git-svn-id: trunk@30908 -
56 lines
759 B
ObjectPascal
56 lines
759 B
ObjectPascal
unit uw18121;
|
|
{$inline on}
|
|
|
|
interface
|
|
|
|
{$mode objfpc}{$H+}
|
|
uses
|
|
SysUtils;
|
|
|
|
type
|
|
{ T1 }
|
|
|
|
TPointerList = class
|
|
private
|
|
i: Pointer;
|
|
procedure SetF(v: Pointer);
|
|
function GetF: Pointer;
|
|
end;
|
|
|
|
{ TPointerList2 }
|
|
|
|
TPointerList2 = class(TPointerList)
|
|
public
|
|
procedure SetF(v: PInteger); inline;
|
|
procedure WriteLn;
|
|
end;
|
|
|
|
implementation
|
|
|
|
procedure TPointerList.SetF(v: Pointer);
|
|
begin
|
|
i := v;
|
|
end;
|
|
|
|
function TPointerList.GetF: Pointer;
|
|
begin
|
|
Result := i;
|
|
end;
|
|
|
|
{ TPointerList2 }
|
|
|
|
procedure TPointerList2.SetF(v: PInteger); inline;
|
|
begin
|
|
inherited SetF(Pointer(v));
|
|
end;
|
|
|
|
procedure TPointerList2.WriteLn;
|
|
var
|
|
S: string;
|
|
begin
|
|
S := Format('%P', [i]);
|
|
System.WriteLn(S);
|
|
end;
|
|
|
|
end.
|