* changed all length(p^.value_str^) into str_length(p)

to get it work with and without ansistrings
  * changed sourcefiles field of tmodule to a pointer
This commit is contained in:
pierre 1998-09-28 16:57:09 +00:00
parent 70920974de
commit a12d8c9417
15 changed files with 124 additions and 36 deletions

View File

@ -248,7 +248,7 @@ unit ag68kgas;
{ file changed ? (must be before line info) } { file changed ? (must be before line info) }
if lastfileindex<>fileinfo.fileindex then if lastfileindex<>fileinfo.fileindex then
begin begin
infile:=current_module^.sourcefiles.get_file(fileinfo.fileindex); infile:=current_module^.sourcefiles^.get_file(fileinfo.fileindex);
if includecount=0 then if includecount=0 then
curr_n:=n_sourcefile curr_n:=n_sourcefile
else else
@ -663,7 +663,12 @@ ait_stab_function_name : funcname:=pai_stab_function_name(hp)^.str;
end. end.
{ {
$Log$ $Log$
Revision 1.11 1998-09-16 01:07:13 carl Revision 1.12 1998-09-28 16:57:09 pierre
* changed all length(p^.value_str^) into str_length(p)
to get it work with and without ansistrings
* changed sourcefiles field of tmodule to a pointer
Revision 1.11 1998/09/16 01:07:13 carl
* alignment fix for bytes * alignment fix for bytes
Revision 1.10 1998/09/01 09:07:08 peter Revision 1.10 1998/09/01 09:07:08 peter

View File

@ -290,7 +290,7 @@ unit ag68kmit;
{ file changed ? (must be before line info) } { file changed ? (must be before line info) }
if lastfileindex<>hp^.fileinfo.fileindex then if lastfileindex<>hp^.fileinfo.fileindex then
begin begin
infile:=current_module^.sourcefiles.get_file(hp^.fileinfo.fileindex); infile:=current_module^.sourcefiles^.get_file(hp^.fileinfo.fileindex);
if includecount=0 then if includecount=0 then
curr_n:=n_sourcefile curr_n:=n_sourcefile
else else
@ -641,7 +641,12 @@ ait_stab_function_name : funcname:=pai_stab_function_name(hp)^.str;
end. end.
{ {
$Log$ $Log$
Revision 1.9 1998-09-16 01:07:43 carl Revision 1.10 1998-09-28 16:57:11 pierre
* changed all length(p^.value_str^) into str_length(p)
to get it work with and without ansistrings
* changed sourcefiles field of tmodule to a pointer
Revision 1.9 1998/09/16 01:07:43 carl
* bugfix of byte alignment * bugfix of byte alignment
Revision 1.8 1998/08/10 14:49:37 peter Revision 1.8 1998/08/10 14:49:37 peter

View File

@ -240,7 +240,7 @@ implementation
while assigned(hp) do while assigned(hp) do
begin begin
addlog('Unit '+hp^.modulename^+' has index '+tostr(hp^.unit_index)); addlog('Unit '+hp^.modulename^+' has index '+tostr(hp^.unit_index));
ff:=hp^.sourcefiles.files; ff:=hp^.sourcefiles^.files;
while assigned(ff) do while assigned(ff) do
begin begin
addlog('File '+ff^.name^+' index '+tostr(ff^.ref_index)); addlog('File '+ff^.name^+' index '+tostr(ff^.ref_index));
@ -459,7 +459,7 @@ implementation
get_source_file:=nil; get_source_file:=nil;
if not assigned(hp) then if not assigned(hp) then
exit; exit;
f:=pinputfile(hp^.sourcefiles.files); f:=pinputfile(hp^.sourcefiles^.files);
while assigned(f) do while assigned(f) do
begin begin
if f^.ref_index=fileindex then if f^.ref_index=fileindex then
@ -476,7 +476,12 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.9 1998-09-23 15:38:59 pierre Revision 1.10 1998-09-28 16:57:12 pierre
* changed all length(p^.value_str^) into str_length(p)
to get it work with and without ansistrings
* changed sourcefiles field of tmodule to a pointer
Revision 1.9 1998/09/23 15:38:59 pierre
* browser bugfixes * browser bugfixes
was adding a reference when looking for the symbol was adding a reference when looking for the symbol
if -bSYM_NAME was used if -bSYM_NAME was used

View File

@ -231,8 +231,8 @@ implementation
cmpop:=true; cmpop:=true;
{ generate better code for s='' and s<>'' } { generate better code for s='' and s<>'' }
if (p^.treetype in [equaln,unequaln]) and if (p^.treetype in [equaln,unequaln]) and
(((p^.left^.treetype=stringconstn) and (p^.left^.value_str^='')) or (((p^.left^.treetype=stringconstn) and (str_length(p^.left)=0)) or
((p^.right^.treetype=stringconstn) and (p^.right^.value_str^=''))) then ((p^.right^.treetype=stringconstn) and (str_length(p^.right)=0))) then
begin begin
secondpass(p^.left); secondpass(p^.left);
{ are too few registers free? } { are too few registers free? }
@ -1278,7 +1278,12 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.13 1998-09-17 09:42:09 peter Revision 1.14 1998-09-28 16:57:13 pierre
* changed all length(p^.value_str^) into str_length(p)
to get it work with and without ansistrings
* changed sourcefiles field of tmodule to a pointer
Revision 1.13 1998/09/17 09:42:09 peter
+ pass_2 for cg386 + pass_2 for cg386
* Message() -> CGMessage() for pass_1/pass_2 * Message() -> CGMessage() for pass_1/pass_2

View File

@ -78,7 +78,7 @@ implementation
end; end;
stringdef : begin stringdef : begin
if p^.left^.treetype=stringconstn then if p^.left^.treetype=stringconstn then
len:=length(p^.left^.value_str^) len:=str_length(p^.left)
else else
begin begin
href:=p^.left^.location.reference; href:=p^.left^.location.reference;
@ -1437,7 +1437,12 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.30 1998-09-26 15:03:02 florian Revision 1.31 1998-09-28 16:57:15 pierre
* changed all length(p^.value_str^) into str_length(p)
to get it work with and without ansistrings
* changed sourcefiles field of tmodule to a pointer
Revision 1.30 1998/09/26 15:03:02 florian
* small problems with DOM and excpetions fixed (code generation * small problems with DOM and excpetions fixed (code generation
of raise was wrong and self was sometimes destroyed :() of raise was wrong and self was sometimes destroyed :()

View File

@ -300,9 +300,9 @@ implementation
if (p^.treetype in [equaln,unequaln]) and if (p^.treetype in [equaln,unequaln]) and
( (
((p^.left^.treetype=stringconstn) and ((p^.left^.treetype=stringconstn) and
(p^.left^.value_str^='')) or (str_length(p^.left)=0)) or
((p^.right^.treetype=stringconstn) and ((p^.right^.treetype=stringconstn) and
(p^.right^.value_str^='')) (str_length(p^.right)=0))
) then ) then
begin begin
{ only one node can be stringconstn } { only one node can be stringconstn }
@ -1263,7 +1263,12 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.5 1998-09-17 09:42:21 peter Revision 1.6 1998-09-28 16:57:16 pierre
* changed all length(p^.value_str^) into str_length(p)
to get it work with and without ansistrings
* changed sourcefiles field of tmodule to a pointer
Revision 1.5 1998/09/17 09:42:21 peter
+ pass_2 for cg386 + pass_2 for cg386
* Message() -> CGMessage() for pass_1/pass_2 * Message() -> CGMessage() for pass_1/pass_2

View File

@ -138,7 +138,7 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
{ if it is a char, then simply } { if it is a char, then simply }
{ load 0 length string } { load 0 length string }
if (p^.right^.treetype=stringconstn) and if (p^.right^.treetype=stringconstn) and
(p^.right^.value_str^='') then (str_length(p^.right)=0) then
exprasmlist^.concat(new(pai68k,op_const_ref( exprasmlist^.concat(new(pai68k,op_const_ref(
A_MOVE,S_B,0,newreference(p^.left^.location.reference)))) A_MOVE,S_B,0,newreference(p^.left^.location.reference))))
else else
@ -1345,7 +1345,12 @@ end;
end. end.
{ {
$Log$ $Log$
Revision 1.17 1998-09-17 09:42:30 peter Revision 1.18 1998-09-28 16:57:17 pierre
* changed all length(p^.value_str^) into str_length(p)
to get it work with and without ansistrings
* changed sourcefiles field of tmodule to a pointer
Revision 1.17 1998/09/17 09:42:30 peter
+ pass_2 for cg386 + pass_2 for cg386
* Message() -> CGMessage() for pass_1/pass_2 * Message() -> CGMessage() for pass_1/pass_2

View File

@ -129,7 +129,7 @@ unit files;
uses_imports : boolean; { Set if the module imports from DLL's.} uses_imports : boolean; { Set if the module imports from DLL's.}
imports : plinkedlist; imports : plinkedlist;
sourcefiles : tfilemanager; sourcefiles : pfilemanager;
linksharedlibs, linksharedlibs,
linkstaticlibs, linkstaticlibs,
linkofiles : tstringcontainer; linkofiles : tstringcontainer;
@ -803,7 +803,7 @@ unit files;
path:=nil; path:=nil;
setfilename(p+n,true); setfilename(p+n,true);
used_units.init; used_units.init;
sourcefiles.init; new(sourcefiles,init);
linkofiles.init; linkofiles.init;
linkstaticlibs.init; linkstaticlibs.init;
linksharedlibs.init; linksharedlibs.init;
@ -849,7 +849,8 @@ unit files;
if assigned(imports) then if assigned(imports) then
dispose(imports,done); dispose(imports,done);
used_units.done; used_units.done;
sourcefiles.done; if assigned(sourcefiles) then
dispose(sourcefiles,done);
linkofiles.done; linkofiles.done;
linkstaticlibs.done; linkstaticlibs.done;
linksharedlibs.done; linksharedlibs.done;
@ -906,7 +907,12 @@ unit files;
end. end.
{ {
$Log$ $Log$
Revision 1.48 1998-09-24 23:46:34 peter Revision 1.49 1998-09-28 16:57:20 pierre
* changed all length(p^.value_str^) into str_length(p)
to get it work with and without ansistrings
* changed sourcefiles field of tmodule to a pointer
Revision 1.48 1998/09/24 23:46:34 peter
+ outputdir support + outputdir support
Revision 1.47 1998/09/22 17:13:43 pierre Revision 1.47 1998/09/22 17:13:43 pierre

View File

@ -205,8 +205,8 @@ unit parser;
{ reset the unit or create a new program } { reset the unit or create a new program }
if assigned(current_module) then if assigned(current_module) then
begin begin
current_module^.sourcefiles.done; current_module^.sourcefiles^.done;
current_module^.sourcefiles.init; current_module^.sourcefiles^.init;
current_module^.used_units.done; current_module^.used_units.done;
current_module^.used_units.init; current_module^.used_units.init;
current_module^.linkofiles.done; current_module^.linkofiles.done;
@ -374,7 +374,12 @@ unit parser;
end. end.
{ {
$Log$ $Log$
Revision 1.51 1998-09-26 17:45:30 peter Revision 1.52 1998-09-28 16:57:22 pierre
* changed all length(p^.value_str^) into str_length(p)
to get it work with and without ansistrings
* changed sourcefiles field of tmodule to a pointer
Revision 1.51 1998/09/26 17:45:30 peter
+ idtoken and only one token table + idtoken and only one token table
Revision 1.50 1998/09/24 23:49:08 peter Revision 1.50 1998/09/24 23:49:08 peter

View File

@ -243,7 +243,9 @@ begin
oldexit:=exitproc; oldexit:=exitproc;
exitproc:=@myexit; exitproc:=@myexit;
{$ifndef TP} {$ifndef TP}
{$ifndef UseAnsiString}
heapblocks:=true; heapblocks:=true;
{$endif not UseAnsiString}
{$endif} {$endif}
{$ifdef UseOverlay} {$ifdef UseOverlay}
InitOverlay; InitOverlay;
@ -254,7 +256,12 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.30 1998-09-24 23:49:13 peter Revision 1.31 1998-09-28 16:57:23 pierre
* changed all length(p^.value_str^) into str_length(p)
to get it work with and without ansistrings
* changed sourcefiles field of tmodule to a pointer
Revision 1.30 1998/09/24 23:49:13 peter
+ aktmodeswitches + aktmodeswitches
Revision 1.29 1998/09/17 09:42:41 peter Revision 1.29 1998/09/17 09:42:41 peter

View File

@ -557,7 +557,7 @@ const
Message1(scan_u_start_include_file,current_scanner^.inputfile^.path^+current_scanner^.inputfile^.name^); Message1(scan_u_start_include_file,current_scanner^.inputfile^.path^+current_scanner^.inputfile^.name^);
current_scanner^.reload; current_scanner^.reload;
{ register for refs } { register for refs }
current_module^.sourcefiles.register_file(hp); current_module^.sourcefiles^.register_file(hp);
end; end;
end; end;
@ -930,7 +930,12 @@ const
{ {
$Log$ $Log$
Revision 1.33 1998-09-26 17:45:40 peter Revision 1.34 1998-09-28 16:57:24 pierre
* changed all length(p^.value_str^) into str_length(p)
to get it work with and without ansistrings
* changed sourcefiles field of tmodule to a pointer
Revision 1.33 1998/09/26 17:45:40 peter
+ idtoken and only one token table + idtoken and only one token table
Revision 1.32 1998/09/24 23:49:19 peter Revision 1.32 1998/09/24 23:49:19 peter

View File

@ -200,7 +200,7 @@ implementation
constructor tscannerfile.init(const fn:string); constructor tscannerfile.init(const fn:string);
begin begin
inputfile:=new(pinputfile,init(fn)); inputfile:=new(pinputfile,init(fn));
current_module^.sourcefiles.register_file(inputfile); current_module^.sourcefiles^.register_file(inputfile);
{ reset localinput } { reset localinput }
inputbuffer:=nil; inputbuffer:=nil;
inputpointer:=nil; inputpointer:=nil;
@ -1424,7 +1424,12 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.54 1998-09-26 17:45:41 peter Revision 1.55 1998-09-28 16:57:26 pierre
* changed all length(p^.value_str^) into str_length(p)
to get it work with and without ansistrings
* changed sourcefiles field of tmodule to a pointer
Revision 1.54 1998/09/26 17:45:41 peter
+ idtoken and only one token table + idtoken and only one token table
Revision 1.53 1998/09/24 23:49:20 peter Revision 1.53 1998/09/24 23:49:20 peter

View File

@ -135,7 +135,7 @@
hp : pinputfile; hp : pinputfile;
begin begin
{ second write the used source files } { second write the used source files }
hp:=current_module^.sourcefiles.files; hp:=current_module^.sourcefiles^.files;
while assigned(hp) do while assigned(hp) do
begin begin
{ only name and extension } { only name and extension }
@ -382,7 +382,7 @@
{$ifdef UseBrowser} {$ifdef UseBrowser}
new(hp,init(hs)); new(hp,init(hs));
{ the indexing is wrong here PM } { the indexing is wrong here PM }
current_module^.sourcefiles.register_file(hp); current_module^.sourcefiles^.register_file(hp);
{$endif UseBrowser} {$endif UseBrowser}
end; end;
Message1(unit_t_ppu_source,hs+temp); Message1(unit_t_ppu_source,hs+temp);
@ -392,7 +392,7 @@
current_module^.mainsource:=stringdup(hs); current_module^.mainsource:=stringdup(hs);
{ the indexing is corrected here PM } { the indexing is corrected here PM }
current_module^.sourcefiles.inverse_register_indexes; current_module^.sourcefiles^.inverse_register_indexes;
{ check if we want to rebuild every unit, only if the sources are { check if we want to rebuild every unit, only if the sources are
available } available }
if do_build and current_module^.sources_avail then if do_build and current_module^.sources_avail then
@ -443,7 +443,12 @@
{ {
$Log$ $Log$
Revision 1.17 1998-09-22 17:13:53 pierre Revision 1.18 1998-09-28 16:57:27 pierre
* changed all length(p^.value_str^) into str_length(p)
to get it work with and without ansistrings
* changed sourcefiles field of tmodule to a pointer
Revision 1.17 1998/09/22 17:13:53 pierre
+ browsing updated and developed + browsing updated and developed
records and objects fields are also stored records and objects fields are also stored

View File

@ -300,6 +300,7 @@ unit tree;
function is_constboolnode(p : ptree) : boolean; function is_constboolnode(p : ptree) : boolean;
function is_constrealnode(p : ptree) : boolean; function is_constrealnode(p : ptree) : boolean;
function is_constcharnode(p : ptree) : boolean; function is_constcharnode(p : ptree) : boolean;
function str_length(p : ptree) : longint;
{$I innr.inc} {$I innr.inc}
@ -1583,12 +1584,26 @@ unit tree;
(porddef(p^.resulttype)^.typ in [bool8bit,bool16bit,bool32bit])); (porddef(p^.resulttype)^.typ in [bool8bit,bool16bit,bool32bit]));
end; end;
function str_length(p : ptree) : longint;
begin
{$ifdef UseAnsiString}
str_length:=p^.length;
{$else UseAnsiString}
str_length:=length(p^.value_str^);
{$endif UseAnsiString}
end;
end. end.
{ {
$Log$ $Log$
Revision 1.43 1998-09-27 10:16:28 florian Revision 1.44 1998-09-28 16:57:28 pierre
* changed all length(p^.value_str^) into str_length(p)
to get it work with and without ansistrings
* changed sourcefiles field of tmodule to a pointer
Revision 1.43 1998/09/27 10:16:28 florian
* type casts pchar<->ansistring fixed * type casts pchar<->ansistring fixed
* ansistring[..] calls does now an unique call * ansistring[..] calls does now an unique call

View File

@ -247,7 +247,7 @@ begin
((current_module^.unit_index<>lastmoduleidx) or ((current_module^.unit_index<>lastmoduleidx) or
(aktfilepos.fileindex<>lastfileidx)) then (aktfilepos.fileindex<>lastfileidx)) then
begin begin
status.currentsource:=current_module^.sourcefiles.get_file_name(aktfilepos.fileindex); status.currentsource:=current_module^.sourcefiles^.get_file_name(aktfilepos.fileindex);
lastmoduleidx:=current_module^.unit_index; lastmoduleidx:=current_module^.unit_index;
{ update lastfileidx only if name known PM } { update lastfileidx only if name known PM }
if status.currentsource<>'' then if status.currentsource<>'' then
@ -403,7 +403,12 @@ end.
{ {
$Log$ $Log$
Revision 1.20 1998-09-05 22:11:06 florian Revision 1.21 1998-09-28 16:57:30 pierre
* changed all length(p^.value_str^) into str_length(p)
to get it work with and without ansistrings
* changed sourcefiles field of tmodule to a pointer
Revision 1.20 1998/09/05 22:11:06 florian
+ switch -vb + switch -vb
* while/repeat loops accept now also word/longbool conditions * while/repeat loops accept now also word/longbool conditions
* makebooltojump did an invalid ungetregister32, fixed * makebooltojump did an invalid ungetregister32, fixed