Forráskód Böngészése

+ handle exports in the llvm-mc wasm32 assembler writer

git-svn-id: branches/wasm@46994 -
nickysn 4 éve
szülő
commit
ceeb614473
1 módosított fájl, 12 hozzáadás és 3 törlés
  1. 12 3
      compiler/aggas.pas

+ 12 - 3
compiler/aggas.pas

@@ -836,6 +836,17 @@ implementation
             end;
             end;
           writer.AsmWriteLn(')');
           writer.AsmWriteLn(')');
         end;
         end;
+
+
+      procedure WriteImportExport(hp:tai_impexp);
+        var
+          symstypestr: string;
+        begin
+          Str(hp.symstype,symstypestr);
+          writer.AsmWriteLn(asminfo^.comment+'ait_importexport(extname='''+hp.extname+''', intname='''+hp.intname+''', extmodule='''+hp.extmodule+''', symstype='+symstypestr+')');
+          if hp.extmodule='' then
+            writer.AsmWriteLn(#9'.export_name '+hp.intname+', '+hp.extname);
+        end;
 {$endif WASM}
 {$endif WASM}
 
 
     var
     var
@@ -1603,9 +1614,7 @@ implementation
            ait_functype:
            ait_functype:
              WriteFuncType(tai_functype(hp));
              WriteFuncType(tai_functype(hp));
            ait_importexport:
            ait_importexport:
-             begin
-               writer.AsmWriteLn(asminfo^.comment+'TODO: ait_importexport');
-             end;
+             WriteImportExport(tai_impexp(hp));
 {$endif WASM}
 {$endif WASM}
 
 
            else
            else