mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-24 17:49:07 +02:00
+ tabstractrecordsymtable.findfieldbyoffset() method to get the (first, in
case of variant records) fieldvarsym corresponding to the given offset git-svn-id: branches/hlcgllvm@28321 -
This commit is contained in:
parent
4f906fb9c9
commit
dedf7e9384
@ -102,6 +102,7 @@ interface
|
||||
procedure alignrecord(fieldoffset:asizeint;varalign:shortint);
|
||||
procedure addfield(sym:tfieldvarsym;vis:tvisibility);
|
||||
procedure addfieldlist(list: tfpobjectlist; maybereorder: boolean);
|
||||
function findfieldbyoffset(offset:asizeint): tfieldvarsym;
|
||||
procedure addalignmentpadding;
|
||||
procedure insertdef(def:TDefEntry);override;
|
||||
function is_packed: boolean;
|
||||
@ -1239,6 +1240,25 @@ implementation
|
||||
end;
|
||||
|
||||
|
||||
function tabstractrecordsymtable.findfieldbyoffset(offset: asizeint): tfieldvarsym;
|
||||
var
|
||||
i: longint;
|
||||
sym: tsym;
|
||||
begin
|
||||
for i:=0 to SymList.count-1 do
|
||||
begin
|
||||
sym:=tsym(symlist[i]);
|
||||
if (sym.typ=fieldvarsym) and
|
||||
(tfieldvarsym(sym).fieldoffset=offset) then
|
||||
begin
|
||||
result:=tfieldvarsym(sym);
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
result:=nil;
|
||||
end;
|
||||
|
||||
|
||||
procedure tabstractrecordsymtable.addalignmentpadding;
|
||||
var
|
||||
padded_datasize: asizeint;
|
||||
|
Loading…
Reference in New Issue
Block a user