compiler, rtl: some rtti related changes:

- write pint instead of 32 bit for record field offset (compiler uses aintsize = pint in TRecordDef), use PtrInt in RTL for record reading
  - add tkRecord to TTypeData (field and type names are taken from Delphi help)
  - add tkProcedure as alias to tkProcVar

git-svn-id: trunk@24424 -
This commit is contained in:
paul 2013-05-04 16:05:04 +00:00
parent 802b7db26e
commit e23534eec4
3 changed files with 17 additions and 2 deletions

View File

@ -175,7 +175,7 @@ implementation
not is_objc_class_or_protocol(tfieldvarsym(sym).vardef) then
begin
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_sym(ref_rtti(tfieldvarsym(sym).vardef,rt)));
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_32bit(tfieldvarsym(sym).fieldoffset));
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_pint(tfieldvarsym(sym).fieldoffset));
inc(fieldcnt);
end;
end;

View File

@ -20,7 +20,7 @@ type
PRecordElement=^TRecordElement;
TRecordElement=packed record
TypeInfo: Pointer;
Offset: Longint;
Offset: PtrInt;
end;
PRecordInfo=^TRecordInfo;

View File

@ -152,6 +152,12 @@ unit typinfo;
UnitName : ShortString
// here the properties follow as array of TPropInfo
);
tkRecord:
(
RecSize: Integer;
ManagedFldCount: Integer;
{ManagedFields: array[1..ManagedFldCount] of TManagedField}
);
tkHelper:
(HelperParent : PTypeInfo;
ExtendedInfo : PTypeInfo;
@ -213,6 +219,14 @@ unit typinfo;
end;
// unsed, just for completeness
TManagedField =
{$ifndef FPC_REQUIRES_PROPER_ALIGNMENT}
packed
{$endif FPC_REQUIRES_PROPER_ALIGNMENT}
record
TypeRef: PTypeInfo;
FldOffset: PtrInt;
end;
TPropData =
{$ifndef FPC_REQUIRES_PROPER_ALIGNMENT}
packed
@ -249,6 +263,7 @@ unit typinfo;
TPropList = array[0..65535] of PPropInfo;
const
tkProcedure = tkProcVar; // for compatibility with Delphi
tkAny = [Low(TTypeKind)..High(TTypeKind)];
tkMethods = [tkMethod];
tkProperties = tkAny-tkMethods-[tkUnknown];