浏览代码

* converted program termination to compilerproc/hlcg

git-svn-id: branches/hlcgllvm@26029 -
Jonas Maebe 11 年之前
父节点
当前提交
9e6764e443
共有 5 个文件被更改,包括 11 次插入5 次删除
  1. 1 1
      compiler/hlcgobj.pas
  2. 1 0
      rtl/inc/compproc.inc
  3. 4 2
      rtl/inc/system.inc
  4. 1 0
      rtl/java/jcompproc.inc
  5. 4 2
      rtl/java/jsystem.inc

+ 1 - 1
compiler/hlcgobj.pas

@@ -4060,7 +4060,7 @@ implementation
       { call __EXIT for main program }
       if (not DLLsource) and
          (current_procinfo.procdef.proctypeoption=potype_proginit) then
-        cg.a_call_name(list,'FPC_DO_EXIT',false);
+        g_call_system_proc(list,'fpc_do_exit',nil);
     end;
 
   procedure thlcgobj.inittempvariables(list: TAsmList);

+ 1 - 0
rtl/inc/compproc.inc

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

+ 4 - 2
rtl/inc/system.inc

@@ -1019,12 +1019,14 @@ Begin
 End;
 
 
-Procedure do_exit;[Public,Alias:'FPC_DO_EXIT'];
+Procedure fpc_do_exit;[Public,Alias:'FPC_DO_EXIT']; compilerproc;
 begin
   InternalExit;
   System_exit;
 end;
 
+procedure internal_do_exit; external name 'FPC_DO_EXIT';
+
 
 Procedure lib_exit;[Public,Alias:'FPC_LIB_EXIT'];
 begin
@@ -1042,7 +1044,7 @@ Begin
 {$endif FPC_LIMITED_EXITCODE}
     ExitCode:=ErrNum;
 {$endif FPC_HAS_FEATURE_EXITCODE}
-  Do_Exit;
+  internal_do_exit;
 end;
 
 

+ 1 - 0
rtl/java/jcompproc.inc

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

+ 4 - 2
rtl/java/jsystem.inc

@@ -1028,12 +1028,14 @@ Begin
 End;
 
 
-Procedure do_exit;[Public,Alias:'FPC_DO_EXIT'];
+Procedure fpc_do_exit;[Public,Alias:'FPC_DO_EXIT']; compilerproc;
 begin
   InternalExit;
   System_exit;
 end;
 
+procedure internal_do_exit; external name 'FPC_DO_EXIT';
+
 
 Procedure lib_exit;[Public,Alias:'FPC_LIB_EXIT'];
 begin
@@ -1044,7 +1046,7 @@ end;
 Procedure Halt(ErrNum: Longint);
 Begin
   ExitCode:=Errnum;
-  Do_Exit;
+  internal_do_exit;
 end;
 
 (*