|
|
@@ -52,6 +52,13 @@ interface
|
|
|
sourcefn : TPathStr; { Source specified with "uses .. in '..'" }
|
|
|
comments : TCmdStrList;
|
|
|
nsprefix : TCmdStr; { Namespace prefix the unit was found with }
|
|
|
+{$ifdef EnableCTaskPPU}
|
|
|
+ loadedfrommodule: tmodule;
|
|
|
+ ppu_waitingfor_crc: boolean;
|
|
|
+ class var cycle_stamp: dword;
|
|
|
+ var
|
|
|
+ cycle_search_stamp: dword;
|
|
|
+{$endif}
|
|
|
{$ifdef Test_Double_checksum}
|
|
|
interface_read_crc_index,
|
|
|
interface_write_crc_index,
|
|
|
@@ -65,6 +72,7 @@ interface
|
|
|
{$endif def Test_Double_checksum}
|
|
|
constructor create(LoadedFrom:TModule;const amodulename: string; const afilename:TPathStr;_is_unit:boolean);
|
|
|
destructor destroy;override;
|
|
|
+ function statestr: string; override;
|
|
|
procedure reset(for_recompile: boolean);override;
|
|
|
procedure re_resolve(loadfrom: tmodule);
|
|
|
function openppufile:boolean;
|
|
|
@@ -72,11 +80,19 @@ interface
|
|
|
procedure getppucrc;
|
|
|
procedure writeppu;
|
|
|
function loadppu(from_module : tmodule) : boolean;
|
|
|
+{$ifdef EnableCTaskPPU}
|
|
|
+ function continueloadppu : boolean;
|
|
|
+ function canreload(out firstwaiting: tmodule): boolean;
|
|
|
+ procedure reload;
|
|
|
+ function ppuloadcancontinue(out firstwaiting: tmodule): boolean;
|
|
|
+ function is_reload_needed(pu: tdependent_unit): boolean; override;
|
|
|
+ procedure recompile_cycle;
|
|
|
+{$endif}
|
|
|
procedure post_load_or_compile(from_module : tmodule; second_time: boolean);
|
|
|
procedure discardppu;
|
|
|
- function needrecompile:boolean;
|
|
|
+ function needrecompile:boolean; // EnableCTaskPPU: remove
|
|
|
procedure setdefgeneration;
|
|
|
- procedure reload_flagged_units;
|
|
|
+ procedure reload_flagged_units; // EnableCTaskPPU: remove
|
|
|
procedure end_of_parsing;override;
|
|
|
private
|
|
|
unitimportsymsderefs : tfplist;
|
|
|
@@ -90,20 +106,24 @@ interface
|
|
|
function check_loadfrompackage: boolean;
|
|
|
procedure check_reload(from_module: tmodule; var do_load: boolean);
|
|
|
function openppu(ppufiletime:longint):boolean;
|
|
|
- procedure prepare_second_load(from_module: tmodule);
|
|
|
+ procedure prepare_second_load(from_module: tmodule); // EnableCTaskPPU: remove
|
|
|
procedure recompile_from_sources(from_module: tmodule);
|
|
|
function search_unit_files(loaded_from : tmodule; onlysource:boolean):TAvailableUnitFiles;
|
|
|
function search_unit(loaded_from : tmodule; onlysource,shortname:boolean):TAvailableUnitFiles;
|
|
|
function loadfrompackage:boolean;
|
|
|
procedure load_interface;
|
|
|
procedure load_implementation;
|
|
|
- procedure load_usedunits;
|
|
|
+ function load_usedunits: boolean;
|
|
|
+{$ifdef EnableCTaskPPU}
|
|
|
+ function load_usedunits_section: boolean;
|
|
|
+ function ppu_check_used_crcs: boolean;
|
|
|
+{$endif}
|
|
|
procedure printcomments;
|
|
|
procedure queuecomment(const s:TMsgStr;v,w:longint);
|
|
|
procedure buildderefunitimportsyms;
|
|
|
procedure derefunitimportsyms;
|
|
|
procedure freederefunitimportsyms;
|
|
|
- procedure try_load_ppufile(from_module: tmodule);
|
|
|
+ procedure try_load_ppufile(from_module: tmodule); // EnableCTaskPPU: remove
|
|
|
procedure writesourcefiles;
|
|
|
procedure writeusedunit(intf:boolean);
|
|
|
procedure writelinkcontainer(var p:tlinkcontainer;id:byte;strippath:boolean);
|
|
|
@@ -181,9 +201,26 @@ var
|
|
|
inherited Destroy;
|
|
|
end;
|
|
|
|
|
|
+ function tppumodule.statestr: string;
|
|
|
+ begin
|
|
|
+ Result:=inherited statestr;
|
|
|
+ {$IFDEF EnableCTaskPPU}
|
|
|
+ if state<>ms_load then exit;
|
|
|
+ if ppu_waitingfor_crc then
|
|
|
+ Result:=Result+',waitcrc'
|
|
|
+ else if interface_compiled then
|
|
|
+ Result:=Result+',interface_compiled'
|
|
|
+ else
|
|
|
+ Result:=Result+',waitintf';
|
|
|
+ {$ENDIF}
|
|
|
+ end;
|
|
|
|
|
|
procedure tppumodule.reset(for_recompile : boolean);
|
|
|
begin
|
|
|
+ {$IFDEF EnableCTaskPPU}
|
|
|
+ loadedfrommodule:=nil;
|
|
|
+ ppu_waitingfor_crc:=false;
|
|
|
+ {$ENDIF}
|
|
|
inc(currentdefgeneration);
|
|
|
discardppu;
|
|
|
freederefunitimportsyms;
|
|
|
@@ -215,6 +252,10 @@ var
|
|
|
tunitwpoinfo(wpoinfo).derefimpl;
|
|
|
end;
|
|
|
|
|
|
+ {$IFDEF EnableCTaskPPU}
|
|
|
+ { all dependent units were already flagged recursively for reload }
|
|
|
+ defsgeneration:=currentdefgeneration;
|
|
|
+ {$ELSE}
|
|
|
{ We have to flag the units that depend on this unit even
|
|
|
though it didn't change, because they might also
|
|
|
indirectly depend on the unit that did change (e.g.,
|
|
|
@@ -226,6 +267,7 @@ var
|
|
|
recompile, all old defs are freed) }
|
|
|
flagdependent(loadfrom);
|
|
|
reload_flagged_units;
|
|
|
+ {$ENDIF}
|
|
|
end;
|
|
|
|
|
|
|
|
|
@@ -465,7 +507,6 @@ var
|
|
|
search_unit_files:=found;
|
|
|
end;
|
|
|
|
|
|
-
|
|
|
function tppumodule.search_unit(loaded_from : tmodule; onlysource,shortname:boolean):TAvailableUnitFiles;
|
|
|
var
|
|
|
singlepathstring,
|
|
|
@@ -787,8 +828,13 @@ var
|
|
|
|
|
|
{ now load the unit and all used units }
|
|
|
load_interface;
|
|
|
+ {$IFDEF EnableCTaskPPU}
|
|
|
+ if not load_usedunits then
|
|
|
+ internalerror(2026020415);
|
|
|
+ {$ELSE}
|
|
|
setdefgeneration;
|
|
|
load_usedunits;
|
|
|
+ {$ENDIF}
|
|
|
Message1(unit_u_finished_loading_unit,modulename^);
|
|
|
|
|
|
result:=true;
|
|
|
@@ -1834,8 +1880,8 @@ var
|
|
|
{ create and write header }
|
|
|
ppufile.header.common.size:=ppufile.size;
|
|
|
ppufile.header.checksum:=ppufile.crc;
|
|
|
- ppufile.header.interface_checksum:=ppufile.interface_crc;
|
|
|
- ppufile.header.indirect_checksum:=ppufile.indirect_crc;
|
|
|
+ ppufile.header.interface_checksum:=interface_crc;
|
|
|
+ ppufile.header.indirect_checksum:=indirect_crc;
|
|
|
ppufile.header.common.compiler:=wordversion;
|
|
|
ppufile.header.common.cpu:=word(target_cpu);
|
|
|
ppufile.header.common.target:=word(target_info.system);
|
|
|
@@ -1847,8 +1893,9 @@ var
|
|
|
{ save crc in current module also }
|
|
|
crc_final:=true;
|
|
|
crc:=ppufile.crc;
|
|
|
- interface_crc:=ppufile.interface_crc;
|
|
|
- indirect_crc:=ppufile.indirect_crc;
|
|
|
+ // make sure, the interface_crc is not affected by the implementation
|
|
|
+ // interface_crc:=ppufile.interface_crc;
|
|
|
+ // indirect_crc:=ppufile.indirect_crc;
|
|
|
{$IFDEF Debug_WaitCRC}
|
|
|
writeln('tppumodule.writeppu ',realmodulename^,' crc=',hexstr(crc,8));
|
|
|
{$ENDIF}
|
|
|
@@ -1937,10 +1984,14 @@ var
|
|
|
|
|
|
{ save crc }
|
|
|
crc:=ppufile.crc;
|
|
|
- interface_crc:=ppufile.interface_crc;
|
|
|
- indirect_crc:=ppufile.indirect_crc;
|
|
|
+ if in_interface then
|
|
|
+ begin
|
|
|
+ // make sure, the interface_crc is not affected by the implementation
|
|
|
+ interface_crc:=ppufile.interface_crc;
|
|
|
+ indirect_crc:=ppufile.indirect_crc;
|
|
|
+ end;
|
|
|
{$IFDEF Debug_WaitCRC}
|
|
|
- writeln('tppumodule.getppucrc ',realmodulename^,' crc=',hexstr(crc,8));
|
|
|
+ writeln('tppumodule.getppucrc ',realmodulename^,' in_interface=',in_interface,' crc=',hexstr(crc,8),' interface_crc=',hexstr(interface_crc,8));
|
|
|
{$ENDIF}
|
|
|
|
|
|
{ end of implementation, to generate a correct ppufile
|
|
|
@@ -1972,9 +2023,9 @@ var
|
|
|
{ create and write header, this will only be used
|
|
|
for debugging purposes }
|
|
|
ppufile.header.common.size:=ppufile.size;
|
|
|
- ppufile.header.checksum:=ppufile.crc;
|
|
|
- ppufile.header.interface_checksum:=ppufile.interface_crc;
|
|
|
- ppufile.header.indirect_checksum:=ppufile.indirect_crc;
|
|
|
+ ppufile.header.checksum:=crc;
|
|
|
+ ppufile.header.interface_checksum:=interface_crc;
|
|
|
+ ppufile.header.indirect_checksum:=indirect_crc;
|
|
|
ppufile.header.common.compiler:=wordversion;
|
|
|
ppufile.header.common.cpu:=word(target_cpu);
|
|
|
ppufile.header.common.target:=word(target_info.system);
|
|
|
@@ -1984,80 +2035,95 @@ var
|
|
|
discardppu;
|
|
|
end;
|
|
|
|
|
|
-
|
|
|
- procedure tppumodule.load_usedunits;
|
|
|
+ function tppumodule.load_usedunits: boolean;
|
|
|
// self is a ppu (or in a package)
|
|
|
var
|
|
|
pu : tused_unit;
|
|
|
begin
|
|
|
+ Result:=true;
|
|
|
if current_module<>self then
|
|
|
- internalerror(200212284);
|
|
|
- { load the used units from interface }
|
|
|
- in_interface:=true;
|
|
|
- pu:=tused_unit(used_units.first);
|
|
|
- while assigned(pu) do
|
|
|
- begin
|
|
|
- if pu.in_interface then
|
|
|
+ internalerror(200212284);
|
|
|
+ if not interface_compiled then
|
|
|
+ begin
|
|
|
+ { load the used units from interface }
|
|
|
+ in_interface:=true;
|
|
|
+ {$IFDEF EnableCTaskPPU}
|
|
|
+ if not load_usedunits_section then
|
|
|
+ exit(false); // e.g. fail or some used unit interface is not ready
|
|
|
+ {$ELSE}
|
|
|
+ pu:=tused_unit(used_units.first);
|
|
|
+ while assigned(pu) do
|
|
|
+ begin
|
|
|
+ if pu.in_interface then
|
|
|
+ begin
|
|
|
+ tppumodule(pu.u).loadppu(self);
|
|
|
+ { if this unit is scheduled for compilation or compiled we can stop }
|
|
|
+ if state<>ms_load then
|
|
|
+ exit;
|
|
|
+ { add this unit to the dependencies }
|
|
|
+ pu.u.adddependency(self,true);
|
|
|
+ { need to recompile the current unit, check the interface
|
|
|
+ crc. And when not compiled with -Ur then check the complete
|
|
|
+ crc }
|
|
|
+ if (pu.u.interface_crc<>pu.interface_checksum) or
|
|
|
+ (pu.u.indirect_crc<>pu.indirect_checksum) or
|
|
|
+ (
|
|
|
+ (not(mf_release in moduleflags)) and
|
|
|
+ (pu.u.crc<>pu.checksum)
|
|
|
+ ) then
|
|
|
+ begin
|
|
|
+ Message2(unit_u_recompile_crc_change,realmodulename^,pu.u.ppufilename,@queuecomment);
|
|
|
+ {$ifdef DEBUG_UNIT_CRC_CHANGES}
|
|
|
+ if (pu.u.interface_crc<>pu.interface_checksum) then
|
|
|
+ Comment(V_Normal,' intfcrc change: '+hexstr(pu.u.interface_crc,8)+' for '+pu.u.ppufilename+' <> '+hexstr(pu.interface_checksum,8)+' in unit '+realmodulename^)
|
|
|
+ else if (pu.u.indirect_crc<>pu.indirect_checksum) then
|
|
|
+ Comment(V_Normal,' indcrc change: '+hexstr(pu.u.indirect_crc,8)+' for '+pu.u.ppufilename+' <> '+hexstr(pu.indirect_checksum,8)+' in unit '+realmodulename^)
|
|
|
+ else
|
|
|
+ Comment(V_Normal,' implcrc change: '+hexstr(pu.u.crc,8)+' for '+pu.u.ppufilename+' <> '+hexstr(pu.checksum,8)+' in unit '+realmodulename^);
|
|
|
+ {$endif DEBUG_UNIT_CRC_CHANGES}
|
|
|
+ recompile_reason:=rr_crcchanged;
|
|
|
+ {$IFDEF DEBUG_PPU_CYCLES}
|
|
|
+ writeln('PPUALGO tppumodule.load_usedunits ',modulename^,' interface uses "',pu.u.modulename^,'" old=',state,' new=',ms_compile);
|
|
|
+ {$ENDIF}
|
|
|
+ state:=ms_compile;
|
|
|
+ exit;
|
|
|
+ end;
|
|
|
+ end;
|
|
|
+ pu:=tused_unit(pu.next);
|
|
|
+ end;
|
|
|
+ {$ENDIF}
|
|
|
+ { ok, now load the interface of this unit }
|
|
|
+ if current_module<>self then
|
|
|
+ internalerror(200208187);
|
|
|
+ deflist.count:=ppufile.header.deflistsize;
|
|
|
+ symlist.count:=ppufile.header.symlistsize;
|
|
|
+ globalsymtable:=tglobalsymtable.create(realmodulename^,moduleid);
|
|
|
+ tstoredsymtable(globalsymtable).ppuload(ppufile);
|
|
|
+
|
|
|
+ if ppufile.readentry<>ibexportedmacros then
|
|
|
+ Message(unit_f_ppu_read_error);
|
|
|
+ if boolean(ppufile.getbyte) then
|
|
|
begin
|
|
|
- tppumodule(pu.u).loadppu(self);
|
|
|
- { if this unit is scheduled for compilation or compiled we can stop }
|
|
|
- if state<>ms_load then
|
|
|
- exit;
|
|
|
- { add this unit to the dependencies }
|
|
|
- pu.u.adddependency(self,true);
|
|
|
- { need to recompile the current unit, check the interface
|
|
|
- crc. And when not compiled with -Ur then check the complete
|
|
|
- crc }
|
|
|
- if (pu.u.interface_crc<>pu.interface_checksum) or
|
|
|
- (pu.u.indirect_crc<>pu.indirect_checksum) or
|
|
|
- (
|
|
|
- (not(mf_release in moduleflags)) and
|
|
|
- (pu.u.crc<>pu.checksum)
|
|
|
- ) then
|
|
|
- begin
|
|
|
- Message2(unit_u_recompile_crc_change,realmodulename^,pu.u.ppufilename,@queuecomment);
|
|
|
-{$ifdef DEBUG_UNIT_CRC_CHANGES}
|
|
|
- if (pu.u.interface_crc<>pu.interface_checksum) then
|
|
|
- Comment(V_Normal,' intfcrc change: '+hexstr(pu.u.interface_crc,8)+' for '+pu.u.ppufilename+' <> '+hexstr(pu.interface_checksum,8)+' in unit '+realmodulename^)
|
|
|
- else if (pu.u.indirect_crc<>pu.indirect_checksum) then
|
|
|
- Comment(V_Normal,' indcrc change: '+hexstr(pu.u.indirect_crc,8)+' for '+pu.u.ppufilename+' <> '+hexstr(pu.indirect_checksum,8)+' in unit '+realmodulename^)
|
|
|
- else
|
|
|
- Comment(V_Normal,' implcrc change: '+hexstr(pu.u.crc,8)+' for '+pu.u.ppufilename+' <> '+hexstr(pu.checksum,8)+' in unit '+realmodulename^);
|
|
|
-{$endif DEBUG_UNIT_CRC_CHANGES}
|
|
|
- recompile_reason:=rr_crcchanged;
|
|
|
- {$IFDEF DEBUG_PPU_CYCLES}
|
|
|
- writeln('PPUALGO tppumodule.load_usedunits ',modulename^,' interface uses "',pu.u.modulename^,'" old=',state,' new=',ms_compile);
|
|
|
- {$ENDIF}
|
|
|
- state:=ms_compile;
|
|
|
- exit;
|
|
|
- end;
|
|
|
+ globalmacrosymtable:=tmacrosymtable.Create(true);
|
|
|
+ tstoredsymtable(globalmacrosymtable).ppuload(ppufile)
|
|
|
end;
|
|
|
- pu:=tused_unit(pu.next);
|
|
|
- end;
|
|
|
- { ok, now load the interface of this unit }
|
|
|
- if current_module<>self then
|
|
|
- internalerror(200208187);
|
|
|
- deflist.count:=ppufile.header.deflistsize;
|
|
|
- symlist.count:=ppufile.header.symlistsize;
|
|
|
- globalsymtable:=tglobalsymtable.create(realmodulename^,moduleid);
|
|
|
- tstoredsymtable(globalsymtable).ppuload(ppufile);
|
|
|
-
|
|
|
- if ppufile.readentry<>ibexportedmacros then
|
|
|
- Message(unit_f_ppu_read_error);
|
|
|
- if boolean(ppufile.getbyte) then
|
|
|
- begin
|
|
|
- globalmacrosymtable:=tmacrosymtable.Create(true);
|
|
|
- tstoredsymtable(globalmacrosymtable).ppuload(ppufile)
|
|
|
- end;
|
|
|
|
|
|
- interface_compiled:=true;
|
|
|
+ interface_compiled:=true;
|
|
|
|
|
|
- { read the implementation part, containing
|
|
|
- the implementation uses and ObjData }
|
|
|
- in_interface:=false;
|
|
|
- load_implementation;
|
|
|
+ { read the implementation part, containing
|
|
|
+ the implementation uses and ObjData }
|
|
|
+ in_interface:=false;
|
|
|
+ load_implementation;
|
|
|
+ end;
|
|
|
|
|
|
{ now only read the implementation uses }
|
|
|
+ {$IFDEF EnableCTaskPPU}
|
|
|
+ if not ppu_waitingfor_crc then
|
|
|
+ begin
|
|
|
+ if not load_usedunits_section then
|
|
|
+ exit(false); // fail or some used unit interface is not ready
|
|
|
+ end;
|
|
|
+ {$ELSE}
|
|
|
pu:=tused_unit(used_units.first);
|
|
|
while assigned(pu) do
|
|
|
begin
|
|
|
@@ -2090,30 +2156,222 @@ var
|
|
|
end;
|
|
|
pu:=tused_unit(pu.next);
|
|
|
end;
|
|
|
+ {$ENDIF}
|
|
|
+
|
|
|
+ {$IFDEF EnableCTaskPPU}
|
|
|
+ if not ppu_waitingfor_crc then
|
|
|
+ {$ENDIF}
|
|
|
+ begin
|
|
|
+ { load implementation symtable }
|
|
|
+ if mf_local_symtable in moduleflags then
|
|
|
+ begin
|
|
|
+ localsymtable:=tstaticsymtable.create(realmodulename^,moduleid);
|
|
|
+ tstaticsymtable(localsymtable).ppuload(ppufile);
|
|
|
+ end;
|
|
|
+
|
|
|
+ { we can now dereference all pointers to the implementation parts }
|
|
|
+ tstoredsymtable(globalsymtable).derefimpl(false);
|
|
|
+ { we've just loaded the localsymtable from the ppu file, so everything
|
|
|
+ in it was registered by definition (otherwise it wouldn't have been in
|
|
|
+ there) }
|
|
|
+ if assigned(localsymtable) then
|
|
|
+ tstoredsymtable(localsymtable).derefimpl(false);
|
|
|
+
|
|
|
+ derefunitimportsyms;
|
|
|
+
|
|
|
+ { read whole program optimisation-related information }
|
|
|
+ wpoinfo:=tunitwpoinfo.ppuload(ppufile);
|
|
|
+ tunitwpoinfo(wpoinfo).deref;
|
|
|
+ tunitwpoinfo(wpoinfo).derefimpl;
|
|
|
+ end;
|
|
|
+
|
|
|
+ {$IFDEF EnableCTaskPPU}
|
|
|
+ // check CRCs
|
|
|
+ ppu_waitingfor_crc:=true;
|
|
|
+ if not ppu_check_used_crcs then exit;
|
|
|
+
|
|
|
+ state:=ms_compiled;
|
|
|
+ {$ENDIF}
|
|
|
+ end;
|
|
|
+
|
|
|
+ {$IFDEF EnableCTaskPPU}
|
|
|
+ function tppumodule.load_usedunits_section: boolean;
|
|
|
+ var
|
|
|
+ pu: tused_unit;
|
|
|
+ IntfCRCValid, CRCValid: Boolean;
|
|
|
+ begin
|
|
|
+ Result:=true;
|
|
|
+ pu:=tused_unit(used_units.first);
|
|
|
+ while assigned(pu) do
|
|
|
+ begin
|
|
|
+ if pu.in_interface=in_interface then
|
|
|
+ begin
|
|
|
+ tppumodule(pu.u).loadppu(self);
|
|
|
+ { if this unit is scheduled for compilation or compiled we can stop }
|
|
|
+ if state<>ms_load then
|
|
|
+ begin
|
|
|
+ {$IFDEF DEBUG_PPU_CYCLES}
|
|
|
+ writeln('tppumodule.load_usedunits_section STOPPED ',modulename^,' ',statestr);
|
|
|
+ {$ENDIF}
|
|
|
+ exit(false);
|
|
|
+ end;
|
|
|
+ {$IFDEF DEBUG_PPU_CYCLES}
|
|
|
+ writeln('PPUALGO tppumodule.load_usedunits_section ',modulename^,' (',statestr,') ',BoolToStr(in_interface,'interface','implementation'),' uses "',pu.u.modulename^,'" state=',pu.u.statestr);
|
|
|
+ {$ENDIF}
|
|
|
+
|
|
|
+ if not pu.dependent_added then
|
|
|
+ begin
|
|
|
+ { add this unit to the dependencies }
|
|
|
+ pu.u.adddependency(self,true);
|
|
|
+ pu.dependent_added:=true;
|
|
|
+ end;
|
|
|
+
|
|
|
+ { check crc(s) if recompile is needed.
|
|
|
+ Currently ppus wait for a pas to be compiled, because a ppu cannot
|
|
|
+ use only the interface of a pas.
|
|
|
+ If an unit of a cycle is recompiled, the whole cycle is recompiled.
|
|
|
+
|
|
|
+ If this ppu was compiled with -Ur only check interface_crc, not crc }
|
|
|
+ CRCValid:=(not pu.u.do_reload) and (pu.u.state in [ms_load,ms_compiled,ms_processed]);
|
|
|
+ IntfCRCValid:=CRCValid {or (pu.u.state in [ms_compiling_waitimpl,ms_compiling_waitfinish,ms_compiled_waitcrc])};
|
|
|
+
|
|
|
+ if (IntfCRCValid and
|
|
|
+ ((pu.u.interface_crc<>pu.interface_checksum) or
|
|
|
+ (pu.u.indirect_crc<>pu.indirect_checksum)))
|
|
|
+ or (CRCValid and
|
|
|
+ (not (mf_release in moduleflags)) and
|
|
|
+ (pu.u.crc<>pu.checksum)
|
|
|
+ ) then
|
|
|
+ begin
|
|
|
+ Message2(unit_u_recompile_crc_change,realmodulename^,pu.u.ppufilename,@queuecomment);
|
|
|
+ {$ifdef DEBUG_UNIT_CRC_CHANGES}
|
|
|
+ if (pu.u.interface_crc<>pu.interface_checksum) then
|
|
|
+ Comment(V_Normal,' intfcrc change: '+hexstr(pu.u.interface_crc,8)+' for '+pu.u.ppufilename+' <> '+hexstr(pu.interface_checksum,8)+' in unit '+realmodulename^)
|
|
|
+ else if (pu.u.indirect_crc<>pu.indirect_checksum) then
|
|
|
+ Comment(V_Normal,' indcrc change: '+hexstr(pu.u.indirect_crc,8)+' for '+pu.u.ppufilename+' <> '+hexstr(pu.indirect_checksum,8)+' in unit '+realmodulename^)
|
|
|
+ else
|
|
|
+ Comment(V_Normal,' implcrc change: '+hexstr(pu.u.crc,8)+' for '+pu.u.ppufilename+' <> '+hexstr(pu.checksum,8)+' in unit '+realmodulename^);
|
|
|
+ {$endif DEBUG_UNIT_CRC_CHANGES}
|
|
|
+ recompile_reason:=rr_crcchanged;
|
|
|
+ {$IFDEF DEBUG_PPU_CYCLES}
|
|
|
+ writeln('PPUALGO tppumodule.load_usedunits_section ',modulename^,' ',BoolToStr(in_interface,'interface','implementation'),' uses "',pu.u.modulename^,'" old=',statestr,' new=',ms_compile);
|
|
|
+ {$ENDIF}
|
|
|
+ state:=ms_compile;
|
|
|
+ exit(false);
|
|
|
+ end;
|
|
|
+
|
|
|
+ if (not CRCValid) or (not pu.u.interface_compiled) then
|
|
|
+ begin
|
|
|
+ // an used unit is delayed
|
|
|
+ // Important: load the rest of the uses section
|
|
|
+ {$IFDEF DEBUG_PPU_CYCLES}
|
|
|
+ if not Result then writeln('PPUALGO tppumodule.load_usedunits_section ',modulename^,' ',BoolToStr(in_interface,'interface','implementation'),' uses "',pu.u.modulename^,'", state=',pu.u.statestr,', waiting for crc...');
|
|
|
+ {$ENDIF}
|
|
|
+ Result:=false;
|
|
|
+ end;
|
|
|
+ end;
|
|
|
+ pu:=tused_unit(pu.next);
|
|
|
+ end;
|
|
|
+ end;
|
|
|
|
|
|
- { load implementation symtable }
|
|
|
- if mf_local_symtable in moduleflags then
|
|
|
+ function tppumodule.ppu_check_used_crcs: boolean;
|
|
|
+ var
|
|
|
+ pu: tused_unit;
|
|
|
+ begin
|
|
|
+ Result:=false;
|
|
|
+ pu:=tused_unit(used_units.first);
|
|
|
+ while assigned(pu) do
|
|
|
+ begin
|
|
|
+ if pu.u.state in [ms_load,ms_compiled_waitcrc,ms_compiled,ms_processed] then
|
|
|
+ begin
|
|
|
+ if (pu.u.crc<>pu.checksum) then
|
|
|
begin
|
|
|
- localsymtable:=tstaticsymtable.create(realmodulename^,moduleid);
|
|
|
- tstaticsymtable(localsymtable).ppuload(ppufile);
|
|
|
+ {$ifdef DEBUG_UNIT_CRC_CHANGES}
|
|
|
+ Comment(V_Normal,' implcrc change: '+hexstr(pu.u.crc,8)+' for '+pu.u.ppufilename+' <> '+hexstr(pu.checksum,8)+' in unit '+realmodulename^);
|
|
|
+ {$endif DEBUG_UNIT_CRC_CHANGES}
|
|
|
+ recompile_reason:=rr_crcchanged;
|
|
|
+ {$IFDEF DEBUG_PPU_CYCLES}
|
|
|
+ writeln('PPUALGO tppumodule.ppu_check_used_crcs ',modulename^,' interface uses "',pu.u.modulename^,'" old=',statestr,' new=',ms_compile);
|
|
|
+ {$ENDIF}
|
|
|
+ state:=ms_compile;
|
|
|
+ exit;
|
|
|
end;
|
|
|
+ end else begin
|
|
|
+ // waiting for crc
|
|
|
+ exit;
|
|
|
+ end;
|
|
|
+ pu:=tused_unit(pu.next);
|
|
|
+ end;
|
|
|
+ Result:=true;
|
|
|
+ end;
|
|
|
|
|
|
- { we can now derefence all pointers to the implementation parts }
|
|
|
- tstoredsymtable(globalsymtable).derefimpl(false);
|
|
|
- { we've just loaded the localsymtable from the ppu file, so everything
|
|
|
- in it was registered by definition (otherwise it wouldn't have been in
|
|
|
- there) }
|
|
|
- if assigned(localsymtable) then
|
|
|
- tstoredsymtable(localsymtable).derefimpl(false);
|
|
|
+ function tppumodule.ppuloadcancontinue(out firstwaiting: tmodule): boolean;
|
|
|
+ var
|
|
|
+ pu: tused_unit;
|
|
|
+ uses_busy, check: Boolean;
|
|
|
+ begin
|
|
|
+ Result:=false;
|
|
|
+ firstwaiting:=nil;
|
|
|
+ if state<>ms_load then
|
|
|
+ Internalerror(2026020610);
|
|
|
+
|
|
|
+ if do_reload and not interface_compiled then
|
|
|
+ exit(true);
|
|
|
+
|
|
|
+ pu:=tused_unit(used_units.first);
|
|
|
+ while assigned(pu) do
|
|
|
+ begin
|
|
|
+ check:=false;
|
|
|
+ if do_reload then
|
|
|
+ // waiting for referenced used units
|
|
|
+ check:=pu.in_interface or ppu_waitingfor_crc
|
|
|
+ else if not interface_compiled then
|
|
|
+ // waiting for interface uses
|
|
|
+ check:=pu.in_interface
|
|
|
+ else if not ppu_waitingfor_crc then
|
|
|
+ // waiting for implementation uses
|
|
|
+ check:=not pu.in_interface
|
|
|
+ else
|
|
|
+ // waiting for crcs
|
|
|
+ check:=true;
|
|
|
+
|
|
|
+ if check then
|
|
|
+ begin
|
|
|
+ if not (pu.u.state in [ms_load,ms_compiled_waitcrc,ms_compiled,ms_processed])
|
|
|
+ or not pu.u.interface_compiled
|
|
|
+ or pu.u.do_reload
|
|
|
+ then
|
|
|
+ begin
|
|
|
+ firstwaiting:=pu.u;
|
|
|
+ exit;
|
|
|
+ end;
|
|
|
+ end;
|
|
|
+ pu:=tused_unit(pu.next);
|
|
|
+ end;
|
|
|
+ Result:=true;
|
|
|
+ end;
|
|
|
|
|
|
- derefunitimportsyms;
|
|
|
+ function tppumodule.is_reload_needed(pu: tdependent_unit): boolean;
|
|
|
+ begin
|
|
|
+ if pu.u.state=ms_load then
|
|
|
+ Result:=tppumodule(pu.u).ppu_waitingfor_crc
|
|
|
+ or (pu.in_interface and pu.u.interface_compiled)
|
|
|
+ else
|
|
|
+ Result:=inherited is_reload_needed(pu);
|
|
|
+ end;
|
|
|
|
|
|
- { read whole program optimisation-related information }
|
|
|
- wpoinfo:=tunitwpoinfo.ppuload(ppufile);
|
|
|
- tunitwpoinfo(wpoinfo).deref;
|
|
|
- tunitwpoinfo(wpoinfo).derefimpl;
|
|
|
+ procedure tppumodule.recompile_cycle;
|
|
|
+ var
|
|
|
+ from_module: tmodule;
|
|
|
+ begin
|
|
|
+ recompile_reason:=rr_buildcycle;
|
|
|
+ from_module:=current_module;
|
|
|
+ set_current_module(self);
|
|
|
+ recompile_from_sources(loadedfrommodule);
|
|
|
+ set_current_module(from_module);
|
|
|
end;
|
|
|
|
|
|
+ {$ENDIF EnableCTaskPPU}
|
|
|
|
|
|
function tppumodule.needrecompile:boolean;
|
|
|
var
|
|
|
@@ -2126,6 +2384,7 @@ var
|
|
|
{ need to recompile the current unit, check the interface
|
|
|
crc. And when not compiled with -Ur then check the complete
|
|
|
crc }
|
|
|
+
|
|
|
if (pu.u.interface_crc<>pu.interface_checksum) or
|
|
|
(pu.u.indirect_crc<>pu.indirect_checksum) or
|
|
|
(
|
|
|
@@ -2197,14 +2456,18 @@ var
|
|
|
do_reload:=false;
|
|
|
{ When the unit is already loaded or being loaded
|
|
|
we can maybe skip a complete reload/recompile }
|
|
|
- if assigned(globalsymtable) and
|
|
|
- (not needrecompile) then
|
|
|
+ if assigned(globalsymtable)
|
|
|
+ {$IFDEF EnableCTaskPPU}
|
|
|
+ {$ELSE}
|
|
|
+ and (not needrecompile)
|
|
|
+ {$ENDIF}
|
|
|
+ then
|
|
|
begin
|
|
|
{ When we don't have any data stored yet there
|
|
|
is nothing to resolve }
|
|
|
if interface_compiled and
|
|
|
{ it makes no sense to re-resolve the unit if it is already finally compiled }
|
|
|
- not (state in [ms_compiled_waitcrc,ms_compiled,ms_processed]) then
|
|
|
+ not (state in [ms_compiled,ms_processed]) then
|
|
|
begin
|
|
|
re_resolve(from_module);
|
|
|
end
|
|
|
@@ -2273,14 +2536,14 @@ var
|
|
|
{$ENDIF}
|
|
|
state:=ms_compile;
|
|
|
end;
|
|
|
- if not (state=ms_compile) then
|
|
|
+ if state=ms_load then
|
|
|
begin
|
|
|
load_interface;
|
|
|
setdefgeneration;
|
|
|
- if not (state=ms_compile) then
|
|
|
+ if state=ms_load then
|
|
|
begin
|
|
|
load_usedunits;
|
|
|
- if not (state=ms_compile) then begin
|
|
|
+ if state=ms_load then begin
|
|
|
{$IFDEF DEBUG_PPU_CYCLES}
|
|
|
writeln('PPUALGO tppumodule.try_load_ppufile ',modulename^,' state=',state,' do_reload=',do_reload);
|
|
|
{$ENDIF}
|
|
|
@@ -2297,12 +2560,13 @@ var
|
|
|
|
|
|
var
|
|
|
pu : tused_unit;
|
|
|
+ was_interfaced_compiled: Boolean;
|
|
|
begin
|
|
|
{ recompile the unit or give a fatal error if sources not available }
|
|
|
- if not(sources_avail) then
|
|
|
+ if not sources_avail then
|
|
|
begin
|
|
|
search_unit_files(from_module,true);
|
|
|
- if not(sources_avail) then
|
|
|
+ if not sources_avail then
|
|
|
begin
|
|
|
printcomments;
|
|
|
if recompile_reason=rr_noppu then
|
|
|
@@ -2330,15 +2594,26 @@ var
|
|
|
comments:=nil;
|
|
|
end;
|
|
|
{$IFDEF DEBUG_PPU_CYCLES}
|
|
|
- writeln('PPUALGO tppumodule.recompile_from_sources ',modulename^,' old=',state,' new=',ms_compile);
|
|
|
+ writeln('PPUALGO tppumodule.recompile_from_sources ',modulename^,' old=',statestr,' new=',ms_compile);
|
|
|
{$ENDIF}
|
|
|
{ Flag modules to reload }
|
|
|
flagdependent(from_module);
|
|
|
+ {$IFDEF EnableCTaskPPU}
|
|
|
+ was_interfaced_compiled:=interface_compiled;
|
|
|
+ { disconnect dependending modules }
|
|
|
+ disconnect_depending_modules;
|
|
|
+ {$ENDIF}
|
|
|
{ Reset the module }
|
|
|
reset(true);
|
|
|
{ mark this module for recompilation }
|
|
|
state:=ms_compile;
|
|
|
+ {$IFDEF EnableCTaskPPU}
|
|
|
+ if was_interfaced_compiled then
|
|
|
+ setdefgeneration;
|
|
|
+ queue_module(Self); // queue after reset, so task state is cleared!
|
|
|
+ {$ELSE}
|
|
|
setdefgeneration;
|
|
|
+ {$ENDIF}
|
|
|
end;
|
|
|
|
|
|
procedure tppumodule.post_load_or_compile(from_module : tmodule; second_time : boolean);
|
|
|
@@ -2350,10 +2625,13 @@ var
|
|
|
if in_interface then
|
|
|
internalerror(200212283);
|
|
|
|
|
|
+ {$IFDEF EnableCTaskPPU}
|
|
|
+ {$ELSE}
|
|
|
{ for a second_time recompile reload all dependent units,
|
|
|
for a first time compile register the unit _once_ }
|
|
|
if second_time or do_reload then
|
|
|
reload_flagged_units;
|
|
|
+ {$ENDIF}
|
|
|
|
|
|
{ reopen the old module }
|
|
|
{$ifdef SHORT_ON_FILE_HANDLES}
|
|
|
@@ -2367,14 +2645,75 @@ var
|
|
|
function tppumodule.loadppu(from_module : tmodule) : boolean;
|
|
|
const
|
|
|
ImplIntf : array[boolean] of string[15]=('implementation','interface');
|
|
|
+ {$IFDEF EnableCTaskPPU}
|
|
|
+ begin
|
|
|
+ Result:=false;
|
|
|
+
|
|
|
+ writeln('PPUALGO tppumodule.loadppu START ',modulename^,' (',statestr,') used by "',from_module.modulename^,'" (',from_module.statestr,')');
|
|
|
+
|
|
|
+ Message3(unit_u_load_unit,from_module.modulename^,
|
|
|
+ ImplIntf[from_module.in_interface],
|
|
|
+ modulename^);
|
|
|
+
|
|
|
+ if do_reload then
|
|
|
+ exit(false); // delay reload until used units are ready
|
|
|
+
|
|
|
+ if state>ms_registered then
|
|
|
+ exit(interface_compiled);
|
|
|
+
|
|
|
+ loadedfrommodule:=from_module;
|
|
|
+
|
|
|
+ set_current_module(self);
|
|
|
+
|
|
|
+ if check_loadfrompackage then
|
|
|
+ begin
|
|
|
+ // No need to do anything, restore situation and exit.
|
|
|
+ set_current_module(from_module);
|
|
|
+ {$IFDEF DEBUG_PPU_CYCLES}
|
|
|
+ writeln('PPUALGO tppumodule.loadppu from package: ',modulename^,' (',statestr,') used by "',from_module.modulename^,'" (',from_module.statestr,')');
|
|
|
+ {$ENDIF}
|
|
|
+ exit(state in [ms_compiled,ms_processed]);
|
|
|
+ end;
|
|
|
+
|
|
|
+ { close old_current_ppu on system that are
|
|
|
+ short on file handles like DOS PM }
|
|
|
+{$ifdef SHORT_ON_FILE_HANDLES}
|
|
|
+ if from_module.is_unit and
|
|
|
+ assigned(tppumodule(from_module).ppufile) then
|
|
|
+ tppumodule(from_module).ppufile.tempclose;
|
|
|
+{$endif SHORT_ON_FILE_HANDLES}
|
|
|
+
|
|
|
+ // search ppu file
|
|
|
+ Message1(unit_u_loading_unit,modulename^);
|
|
|
+ if auPPU in search_unit_files(from_module,false) then
|
|
|
+ begin
|
|
|
+ state:=ms_load;
|
|
|
+ fromppu:=true;
|
|
|
+ load_interface;
|
|
|
+ end
|
|
|
+ else begin
|
|
|
+ {$IFDEF DEBUG_PPU_CYCLES}
|
|
|
+ writeln('PPUALGO tppumodule.try_load_ppufile ',modulename^,' no ppu found old=',statestr,' new=',ms_compile);
|
|
|
+ {$ENDIF}
|
|
|
+ // recompile_reason is already set by search_unit_files
|
|
|
+ state:=ms_compile;
|
|
|
+ end;
|
|
|
+
|
|
|
+ Result:=continueloadppu;
|
|
|
+
|
|
|
+ set_current_module(from_module);
|
|
|
+ end;
|
|
|
+
|
|
|
+ {$ELSE}
|
|
|
var
|
|
|
do_load,
|
|
|
second_time: boolean;
|
|
|
|
|
|
begin
|
|
|
+ Result:=false;
|
|
|
+
|
|
|
Inc(LoadCount);
|
|
|
|
|
|
- Result:=false;
|
|
|
Message3(unit_u_load_unit,from_module.modulename^,
|
|
|
ImplIntf[from_module.in_interface],
|
|
|
modulename^);
|
|
|
@@ -2460,6 +2799,172 @@ var
|
|
|
if LoadCount>0 then
|
|
|
Dec(LoadCount);
|
|
|
end;
|
|
|
+ {$ENDIF}
|
|
|
+
|
|
|
+ {$ifdef EnableCTaskPPU}
|
|
|
+ function tppumodule.continueloadppu: boolean;
|
|
|
+ var
|
|
|
+ old_module: tmodule;
|
|
|
+ do_load: boolean;
|
|
|
+ pu: tused_unit;
|
|
|
+ begin
|
|
|
+ old_module:=current_module;
|
|
|
+ set_current_module(self);
|
|
|
+
|
|
|
+ if do_reload then
|
|
|
+ Internalerror(2026021017);
|
|
|
+
|
|
|
+ if state=ms_load then
|
|
|
+ begin
|
|
|
+ if load_usedunits then
|
|
|
+ begin
|
|
|
+ {$IFDEF DEBUG_PPU_CYCLES}
|
|
|
+ writeln('PPUALGO tppumodule.continueloadppu ',modulename^,' finished state=',statestr);
|
|
|
+ {$ENDIF}
|
|
|
+ Message1(unit_u_finished_loading_unit,modulename^);
|
|
|
+ end else if state=ms_load then
|
|
|
+ begin
|
|
|
+ {$IFDEF DEBUG_PPU_CYCLES}
|
|
|
+ writeln('PPUALGO tppumodule.continueloadppu ',modulename^,' delay state=',statestr);
|
|
|
+ {$ENDIF}
|
|
|
+ { loading unfinished or reset, restore current_module }
|
|
|
+ set_current_module(old_module);
|
|
|
+ queue_module(Self);
|
|
|
+ exit;
|
|
|
+ end else if state<>ms_compile then
|
|
|
+ internalerror(2026020510);
|
|
|
+ end;
|
|
|
+
|
|
|
+ { PPU is not needed anymore }
|
|
|
+ if assigned(ppufile) then
|
|
|
+ discardppu;
|
|
|
+
|
|
|
+ if state=ms_compiled then
|
|
|
+ begin
|
|
|
+ Result:=true;
|
|
|
+ post_load_or_compile(loadedfrommodule,false);
|
|
|
+ end else if state=ms_compile then
|
|
|
+ recompile_from_sources(loadedfrommodule)
|
|
|
+ else begin
|
|
|
+ queue_module(Self);
|
|
|
+ end;
|
|
|
+
|
|
|
+ { we are back, restore current_module }
|
|
|
+ set_current_module(old_module);
|
|
|
+ end;
|
|
|
+
|
|
|
+ function tppumodule.canreload(out firstwaiting: tmodule): boolean;
|
|
|
+ var
|
|
|
+ check_impl_uses, check_crc: Boolean;
|
|
|
+ pu: tused_unit;
|
|
|
+ begin
|
|
|
+ firstwaiting:=nil;
|
|
|
+ if not interface_compiled then
|
|
|
+ exit(true);
|
|
|
+
|
|
|
+ // if implementation was parsed then implementation uses must be checked too
|
|
|
+ if state=ms_load then
|
|
|
+ check_impl_uses:=ppu_waitingfor_crc
|
|
|
+ else
|
|
|
+ check_impl_uses:=state in [ms_compiling_waitimpl..ms_compiled,ms_processed];
|
|
|
+
|
|
|
+ // if the crc(s) of used unit are known
|
|
|
+ check_crc:=state in [ms_load,ms_compiled,ms_processed];
|
|
|
+
|
|
|
+ pu:=tused_unit(used_units.first);
|
|
|
+ while assigned(pu) do
|
|
|
+ begin
|
|
|
+ if pu.in_interface or check_impl_uses then
|
|
|
+ begin
|
|
|
+ if not pu.u.interface_compiled
|
|
|
+ or pu.u.do_reload
|
|
|
+ or (check_crc
|
|
|
+ and not (pu.u.state in [ms_load,ms_compiled_waitcrc,ms_compiled,ms_processed])) then
|
|
|
+ begin
|
|
|
+ firstwaiting:=pu.u;
|
|
|
+ exit(false);
|
|
|
+ end;
|
|
|
+ end;
|
|
|
+ pu:=tused_unit(pu.next);
|
|
|
+ end;
|
|
|
+ Result:=true;
|
|
|
+ end;
|
|
|
+
|
|
|
+ procedure tppumodule.reload;
|
|
|
+ var
|
|
|
+ pu: tused_unit;
|
|
|
+ do_load, check_impl_uses, check_crc: Boolean;
|
|
|
+ begin
|
|
|
+ if not do_reload then
|
|
|
+ Internalerror(2026021015);
|
|
|
+
|
|
|
+ if fromppu and (state in [ms_compiled,ms_processed]) then
|
|
|
+ begin
|
|
|
+ // reload ppu: check crcs again
|
|
|
+ state:=ms_load;
|
|
|
+ ppu_waitingfor_crc:=true;
|
|
|
+ end;
|
|
|
+
|
|
|
+ if interface_compiled then
|
|
|
+ begin
|
|
|
+ // if implementation was parsed then implementation uses must be checked too
|
|
|
+ if state=ms_load then
|
|
|
+ check_impl_uses:=ppu_waitingfor_crc
|
|
|
+ else
|
|
|
+ check_impl_uses:=state in [ms_compiling_waitimpl..ms_compiled,ms_processed];
|
|
|
+
|
|
|
+ // if the crc(s) of used unit are known
|
|
|
+ check_crc:=state in [ms_load,ms_compiled,ms_processed];
|
|
|
+
|
|
|
+ pu:=tused_unit(used_units.first);
|
|
|
+ while assigned(pu) do
|
|
|
+ begin
|
|
|
+ if pu.in_interface or check_impl_uses then
|
|
|
+ begin
|
|
|
+ if not pu.u.interface_compiled
|
|
|
+ or pu.u.do_reload
|
|
|
+ or (check_crc
|
|
|
+ and not (pu.u.state in [ms_load,ms_compiled_waitcrc,ms_compiled,ms_processed])) then
|
|
|
+ begin
|
|
|
+ // bug in ctask.cancontinue
|
|
|
+ writeln('tppumodule.continueloadppu reloading ',modulename^,', but ',pu.u.modulename^,' not ready (',pu.u.statestr,').');
|
|
|
+ Internalerror(2026020918);
|
|
|
+ end;
|
|
|
+
|
|
|
+ if (pu.u.interface_crc<>pu.interface_checksum) or
|
|
|
+ (pu.u.indirect_crc<>pu.indirect_checksum)
|
|
|
+ or (check_crc and
|
|
|
+ (not (mf_release in moduleflags)) and
|
|
|
+ (pu.u.crc<>pu.checksum)
|
|
|
+ ) then
|
|
|
+ begin
|
|
|
+ Message2(unit_u_recompile_crc_change,realmodulename^,pu.u.ppufilename,@queuecomment);
|
|
|
+ {$ifdef DEBUG_UNIT_CRC_CHANGES}
|
|
|
+ if (pu.u.interface_crc<>pu.interface_checksum) then
|
|
|
+ Comment(V_Normal,' intfcrc change: '+hexstr(pu.u.interface_crc,8)+' for '+pu.u.ppufilename+' <> '+hexstr(pu.interface_checksum,8)+' in unit '+realmodulename^)
|
|
|
+ else if (pu.u.indirect_crc<>pu.indirect_checksum) then
|
|
|
+ Comment(V_Normal,' indcrc change: '+hexstr(pu.u.indirect_crc,8)+' for '+pu.u.ppufilename+' <> '+hexstr(pu.indirect_checksum,8)+' in unit '+realmodulename^)
|
|
|
+ else
|
|
|
+ Comment(V_Normal,' implcrc change: '+hexstr(pu.u.crc,8)+' for '+pu.u.ppufilename+' <> '+hexstr(pu.checksum,8)+' in unit '+realmodulename^);
|
|
|
+ {$endif DEBUG_UNIT_CRC_CHANGES}
|
|
|
+ recompile_reason:=rr_crcchanged;
|
|
|
+ {$IFDEF DEBUG_PPU_CYCLES}
|
|
|
+ writeln('PPUALGO tppumodule.reload ',modulename^,' ',BoolToStr(in_interface,'interface','implementation'),' uses "',pu.u.modulename^,'" old=',statestr,' new=',ms_compile);
|
|
|
+ {$ENDIF}
|
|
|
+ state:=ms_compile;
|
|
|
+ exit;
|
|
|
+ end;
|
|
|
+
|
|
|
+ end;
|
|
|
+ pu:=tused_unit(pu.next);
|
|
|
+ end;
|
|
|
+ end;
|
|
|
+
|
|
|
+ do_load:=true;
|
|
|
+ check_reload(loadedfrommodule,do_load);
|
|
|
+ end;
|
|
|
+
|
|
|
+ {$endif}
|
|
|
|
|
|
procedure tppumodule.discardppu;
|
|
|
begin
|
|
|
@@ -2550,8 +3055,8 @@ var
|
|
|
HaveCycle:=FindCycle(CallerModule,hp,Cycle);
|
|
|
if HaveCycle then
|
|
|
begin
|
|
|
- {$IFDEF DEBUGCYCLE}
|
|
|
- Writeln('Done cycle check');
|
|
|
+ {$IFDEF DEBUGCYCLE}
|
|
|
+ Writeln('Done cycle check');
|
|
|
CyclePath:='';
|
|
|
hp2:=TModule(Cycle[Cycle.Count-1]);
|
|
|
for i:=0 to Cycle.Count-1 do begin
|