Browse Source

* 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 -

yury 8 years ago
parent
commit
ea61dee00b

+ 4 - 1
compiler/utils/ppuutils/ppudump.pp

@@ -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

+ 2 - 2
compiler/utils/ppuutils/ppuout.pp

@@ -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');

+ 7 - 0
utils/pas2jni/ppuparser.pas

@@ -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: