mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-26 13:09:26 +02:00
+ tai_aggregatetypedconst.changetorecord() to change the type of an
aggregate to a (new) recorddef o the size of the original type and that of the record must match o will be used by the LLVM generator in case of a variant record, or an array of variant records with constant data that does not match our canonical LLVM definition git-svn-id: trunk@32718 -
This commit is contained in:
parent
00c777e51a
commit
926e62c886
@ -93,6 +93,9 @@ type
|
||||
function valuecount: longint;
|
||||
procedure insertvaluebeforepos(val: tai_abstracttypedconst; pos: longint);
|
||||
function replacevalueatpos(val: tai_abstracttypedconst; pos: longint): tai_abstracttypedconst;
|
||||
{ change the type to a record, regardless of how the aggregate was created;
|
||||
the size of the original type and the record must match }
|
||||
procedure changetorecord(_def: trecorddef);
|
||||
procedure finish;
|
||||
destructor destroy; override;
|
||||
end;
|
||||
@ -747,6 +750,17 @@ implementation
|
||||
end;
|
||||
|
||||
|
||||
procedure tai_aggregatetypedconst.changetorecord(_def: trecorddef);
|
||||
begin
|
||||
{ must be a record of the same size as the current data }
|
||||
if assigned(fdef) and
|
||||
(fdef.size<>_def.size) then
|
||||
internalerror(2015122402);
|
||||
fdef:=_def;
|
||||
fadetyp:=tck_record;
|
||||
end;
|
||||
|
||||
|
||||
procedure tai_aggregatetypedconst.finish;
|
||||
begin
|
||||
if fisstring then
|
||||
|
Loading…
Reference in New Issue
Block a user