Jelajahi Sumber

* converted unit initialization to compilerproc/hlcg

git-svn-id: branches/hlcgllvm@26028 -
Jonas Maebe 11 tahun lalu
induk
melakukan
cd92791d09
5 mengubah file dengan 8 tambahan dan 11 penghapusan
  1. 4 9
      compiler/hlcgobj.pas
  2. 1 0
      rtl/inc/compproc.inc
  3. 1 1
      rtl/inc/system.inc
  4. 1 0
      rtl/java/jcompproc.inc
  5. 1 1
      rtl/java/jsystem.inc

+ 4 - 9
compiler/hlcgobj.pas

@@ -2778,7 +2778,7 @@ implementation
     var
       tmpreg: tregister;
     begin
-      tmpreg:=getintregister(list,size);
+      tmpreg:=getregisterfordef(list,size);
       a_load_const_reg(list,size,a,tmpreg);
       a_cmp_reg_reg_label(list,size,cmp_op,tmpreg,reg,l);
     end;
@@ -2787,7 +2787,7 @@ implementation
     var
       tmpreg: tregister;
     begin
-      tmpreg:=getintregister(list,size);
+      tmpreg:=getregisterfordef(list,size);
       a_load_ref_reg(list,size,size,ref,tmpreg);
       a_cmp_const_reg_label(list,size,cmp_op,a,tmpreg,l);
     end;
@@ -4035,19 +4035,14 @@ implementation
             end;
         end;
 
-      { TODO: create high level version (create compilerprocs in system unit,
-          look up procdef, use hlcgobj.a_call_name()) }
-
       { call startup helpers from main program }
       if (current_procinfo.procdef.proctypeoption=potype_proginit) then
        begin
          { initialize units }
-         cg.allocallcpuregisters(list);
          if not(current_module.islibrary) then
-           cg.a_call_name(list,'FPC_INITIALIZEUNITS',false)
+           g_call_system_proc(list,'fpc_initializeunits',nil)
          else
-           cg.a_call_name(list,'FPC_LIBINITIALIZEUNITS',false);
-         cg.deallocallcpuregisters(list);
+           g_call_system_proc(list,'fpc_libinitializeunits',nil);
        end;
 
       list.concat(Tai_force_line.Create);

+ 1 - 0
rtl/inc/compproc.inc

@@ -667,6 +667,7 @@ procedure fpc_stackcheck(stack_size:SizeUInt); compilerproc;
 {$endif}
 
 procedure fpc_InitializeUnits; compilerproc;
+procedure fpc_LibInitializeUnits;compilerproc;
 // not generated by compiler, called directly in system unit
 // procedure fpc_FinalizeUnits; compilerproc;
 

+ 1 - 1
rtl/inc/system.inc

@@ -879,7 +879,7 @@ end;
 
 procedure internal_initializeunits; external name 'FPC_INITIALIZEUNITS';
 
-procedure fpc_LibInitializeUnits;[public,alias:'FPC_LIBINITIALIZEUNITS'];
+procedure fpc_LibInitializeUnits;[public,alias:'FPC_LIBINITIALIZEUNITS'];compilerproc;
 begin
 {$ifdef FPC_HAS_FEATURE_DYNLIBS}
   IsLibrary:=true;

+ 1 - 0
rtl/java/jcompproc.inc

@@ -632,6 +632,7 @@ procedure fpc_stackcheck(stack_size:SizeUInt); compilerproc;
 {$endif}
 
 procedure fpc_InitializeUnits; compilerproc;
+procedure fpc_LibInitializeUnits;compilerproc;
 // not generated by compiler, called directly in system unit
 // procedure fpc_FinalizeUnits; compilerproc;
 

+ 1 - 1
rtl/java/jsystem.inc

@@ -878,7 +878,7 @@ end;
 
 procedure internal_initializeunits; external name 'FPC_INITIALIZEUNITS';
 
-procedure fpc_LibInitializeUnits;[public,alias:'FPC_LIBINITIALIZEUNITS'];
+procedure fpc_LibInitializeUnits;[public,alias:'FPC_LIBINITIALIZEUNITS'];compilerproc;
 begin
 {$ifdef FPC_HAS_FEATURE_DYNLIBS}
   IsLibrary:=true;