瀏覽代碼

compiler: tmodulestate comments and removed unused ms_error

mattias 1 周之前
父節點
當前提交
0b176e43f7
共有 4 個文件被更改,包括 14 次插入20 次删除
  1. 0 1
      compiler/ctask.pas
  2. 10 12
      compiler/finput.pas
  3. 3 6
      compiler/fppu.pas
  4. 1 1
      compiler/pgenutil.pas

+ 0 - 1
compiler/ctask.pas

@@ -221,7 +221,6 @@ begin
     ms_compiling_wait : cancontinue:=m.usedunitsloaded(true,firstwaiting);
     ms_compiled : cancontinue:=true;
     ms_processed : cancontinue:=true;
-    ms_moduleerror : cancontinue:=true;
   else
     InternalError(2024011802);
   end;

+ 10 - 12
compiler/finput.pas

@@ -115,16 +115,15 @@ interface
 
      type
         tmodulestate = (ms_unknown,
-          ms_registered,
-          ms_load,
-          ms_compile,
-          ms_compiling_waitintf,
-          ms_compiling_waitimpl,
-          ms_compiling_waitfinish,
-          ms_compiling_wait,
-          ms_compiled,
-          ms_processed,
-          ms_moduleerror
+          ms_registered, // tmodule created
+          ms_load,       // loading ppu
+          ms_compile,    // parsing and compiling
+          ms_compiling_waitintf,  // waiting for used units of interface section
+          ms_compiling_waitimpl,  // waiting for used units of implementation section
+          ms_compiling_waitfinish,// after impl section parsed, waiting for other impl sections needed by specializations
+          ms_compiling_wait,      // waiting for used units of program section
+          ms_compiled,   // compiling complete, ppu written
+          ms_processed   // task complete
         );
         tmodulestates = set of tmodulestate;
 
@@ -139,8 +138,7 @@ interface
           'Compiling_Waiting_finish',
           'Compiling_Waiting',
           'Compiled',
-          'Processed',
-          'Error'
+          'Processed'
         );
 
      type

+ 3 - 6
compiler/fppu.pas

@@ -1847,7 +1847,6 @@ var
 
     procedure tppumodule.getppucrc;
       begin
-
          { create new ppufile }
          ppufile:=tcompilerppufile.create(ppufilename);
          ppufile.crc_only:=true;
@@ -1975,7 +1974,7 @@ var
               tppumodule(pu.u).loadppu(self);
               { if this unit is scheduled for compilation or compiled we can stop }
               if state in [ms_compile,ms_compiled,ms_processed] then
-               exit;
+                exit;
               { add this unit to the dependencies }
               pu.u.adddependency(self,true);
               { need to recompile the current unit, check the interface
@@ -2208,7 +2207,6 @@ var
                            ms_compiling_waitfinish, ms_compiling_wait, ms_compiled,
                            ms_processed];
 
-
         begin
           { try to load the unit a second time first }
           Message1(unit_u_second_load_unit,modulename^);
@@ -2247,7 +2245,7 @@ var
          end;
         { PPU is not needed anymore }
         if assigned(ppufile) then
-            discardppu;
+          discardppu;
       end;
 
     procedure tppumodule.recompile_from_sources(from_module : tmodule);
@@ -2291,8 +2289,7 @@ var
         { Reset the module }
         reset(true);
         { mark this module for recompilation }
-        if not (state in [ms_compile]) then
-          state:=ms_compile;
+        state:=ms_compile;
         setdefgeneration;
       end;
 

+ 1 - 1
compiler/pgenutil.pas

@@ -286,7 +286,7 @@ uses
           exit;
 
         if (hmodule.state = ms_load) and hmodule.interface_compiled then
-           Exit;
+          Exit;
 
         if not (hmodule.state in [ms_compiled,ms_processed]) then
           begin