* ppudump: Mark objects with abstract methods in the JSON/XML output.

* pas2jni: Properly handle inherited classes when an ancestor has abstract methods.

git-svn-id: trunk@35746 -
This commit is contained in:
yury 2017-04-07 09:53:54 +00:00
parent 9093047a7a
commit ea61dee00b
3 changed files with 13 additions and 3 deletions
compiler/utils/ppuutils
utils/pas2jni

View File

@ -3349,7 +3349,10 @@ begin
writeln([space,' IID String : ',objdef.IID]);
end;
writeln([space,' Abstract methods : ',getlongint]);
l:=getlongint;
if l > 0 then
objdef.Options:=objdef.Options + [ooAbstractMethods];
writeln([space,' Abstract methods : ',l]);
if tobjecttyp(b)=odt_helper then
begin

View File

@ -256,7 +256,7 @@ type
end;
TPpuObjType = (otUnknown, otClass, otObject, otInterface, otHelper);
TPpuObjOption = (ooIsAbstract, ooCopied);
TPpuObjOption = (ooIsAbstract, ooCopied, ooAbstractMethods);
TPpuObjOptions = set of TPpuObjOption;
{ TPpuObjectDef }
@ -460,7 +460,7 @@ const
('', 'class', 'object', 'interface', 'helper');
ObjOptionNames: array[TPpuObjOption] of string =
('abstract','copied');
('abstract','copied','abstract_methods');
PropOptionNames: array[TPpuPropOption] of string =
('default');

View File

@ -411,6 +411,13 @@ var
AncestorClass:=TClassDef(_GetRef(it.Get('Ancestor', TJSONObject(nil)), TClassDef));
if CType in [ctObject, ctRecord] then
Size:=it.Integers['Size'];
arr:=it.Get('Options', TJSONArray(nil));
if arr <> nil then
for j:=0 to arr.Count - 1 do begin
s:=arr.Strings[j];
if s = 'abstract_methods' then
HasAbstractMethods:=True;
end;
_ReadDefs(d, it, 'Fields');
end;
dtProc, dtProcType: