Browse Source

* also write definitions for abstract methods
* write "abstract" modifier for abstract classes

git-svn-id: branches/jvmbackend@18634 -

Jonas Maebe 14 years ago
parent
commit
92fbbcff88
1 changed files with 5 additions and 1 deletions
  1. 5 1
      compiler/agjasmin.pas

+ 5 - 1
compiler/agjasmin.pas

@@ -570,6 +570,8 @@ implementation
                         AsmWrite('.class ');
                         AsmWrite('.class ');
                         if oo_is_sealed in tobjectdef(obj).objectoptions then
                         if oo_is_sealed in tobjectdef(obj).objectoptions then
                           AsmWrite('final ');
                           AsmWrite('final ');
+                        if oo_is_abstract in tobjectdef(obj).objectoptions then
+                          AsmWrite('abstract ');
                         if toplevelowner.symtabletype=globalsymtable then
                         if toplevelowner.symtabletype=globalsymtable then
                           AsmWrite('public ');
                           AsmWrite('public ');
                         if (oo_is_enum_class in tobjectdef(obj).objectoptions) then
                         if (oo_is_enum_class in tobjectdef(obj).objectoptions) then
@@ -714,7 +716,8 @@ implementation
         if (pd.procsym.owner.symtabletype in [globalsymtable,staticsymtable,localsymtable]) or
         if (pd.procsym.owner.symtabletype in [globalsymtable,staticsymtable,localsymtable]) or
            (po_classmethod in pd.procoptions) then
            (po_classmethod in pd.procoptions) then
           result:=result+'static ';
           result:=result+'static ';
-        if is_javainterface(tdef(pd.owner.defowner)) then
+        if (po_abstractmethod in pd.procoptions) or
+           is_javainterface(tdef(pd.owner.defowner)) then
           result:=result+'abstract ';
           result:=result+'abstract ';
         if (pd.procsym.owner.symtabletype in [globalsymtable,staticsymtable,localsymtable]) or
         if (pd.procsym.owner.symtabletype in [globalsymtable,staticsymtable,localsymtable]) or
            (po_finalmethod in pd.procoptions) or
            (po_finalmethod in pd.procoptions) or
@@ -900,6 +903,7 @@ implementation
     procedure TJasminAssembler.WriteProcDef(pd: tprocdef);
     procedure TJasminAssembler.WriteProcDef(pd: tprocdef);
       begin
       begin
         if not assigned(pd.exprasmlist) and
         if not assigned(pd.exprasmlist) and
+           not(po_abstractmethod in pd.procoptions) and
            (not is_javainterface(pd.struct) or
            (not is_javainterface(pd.struct) or
             (pd.proctypeoption in [potype_unitinit,potype_unitfinalize])) then
             (pd.proctypeoption in [potype_unitinit,potype_unitfinalize])) then
           exit;
           exit;