* 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) }
if lastfileindex<>fileinfo.fileindex then
begin
infile:=current_module^.sourcefiles.get_file(fileinfo.fileindex);
infile:=current_module^.sourcefiles^.get_file(fileinfo.fileindex);
if includecount=0 then
curr_n:=n_sourcefile
else
@ -663,7 +663,12 @@ ait_stab_function_name : funcname:=pai_stab_function_name(hp)^.str;
end.
{
$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
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) }
if lastfileindex<>hp^.fileinfo.fileindex then
begin
infile:=current_module^.sourcefiles.get_file(hp^.fileinfo.fileindex);
infile:=current_module^.sourcefiles^.get_file(hp^.fileinfo.fileindex);
if includecount=0 then
curr_n:=n_sourcefile
else
@ -641,7 +641,12 @@ ait_stab_function_name : funcname:=pai_stab_function_name(hp)^.str;
end.
{
$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
Revision 1.8 1998/08/10 14:49:37 peter

View File

@ -240,7 +240,7 @@ implementation
while assigned(hp) do
begin
addlog('Unit '+hp^.modulename^+' has index '+tostr(hp^.unit_index));
ff:=hp^.sourcefiles.files;
ff:=hp^.sourcefiles^.files;
while assigned(ff) do
begin
addlog('File '+ff^.name^+' index '+tostr(ff^.ref_index));
@ -459,7 +459,7 @@ implementation
get_source_file:=nil;
if not assigned(hp) then
exit;
f:=pinputfile(hp^.sourcefiles.files);
f:=pinputfile(hp^.sourcefiles^.files);
while assigned(f) do
begin
if f^.ref_index=fileindex then
@ -476,7 +476,12 @@ begin
end.
{
$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
was adding a reference when looking for the symbol
if -bSYM_NAME was used

View File

@ -231,8 +231,8 @@ implementation
cmpop:=true;
{ generate better code for s='' and s<>'' }
if (p^.treetype in [equaln,unequaln]) and
(((p^.left^.treetype=stringconstn) and (p^.left^.value_str^='')) or
((p^.right^.treetype=stringconstn) and (p^.right^.value_str^=''))) then
(((p^.left^.treetype=stringconstn) and (str_length(p^.left)=0)) or
((p^.right^.treetype=stringconstn) and (str_length(p^.right)=0))) then
begin
secondpass(p^.left);
{ are too few registers free? }
@ -1278,7 +1278,12 @@ implementation
end.
{
$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
* Message() -> CGMessage() for pass_1/pass_2

View File

@ -78,7 +78,7 @@ implementation
end;
stringdef : begin
if p^.left^.treetype=stringconstn then
len:=length(p^.left^.value_str^)
len:=str_length(p^.left)
else
begin
href:=p^.left^.location.reference;
@ -1437,7 +1437,12 @@ implementation
end.
{
$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
of raise was wrong and self was sometimes destroyed :()

View File

@ -300,9 +300,9 @@ implementation
if (p^.treetype in [equaln,unequaln]) and
(
((p^.left^.treetype=stringconstn) and
(p^.left^.value_str^='')) or
(str_length(p^.left)=0)) or
((p^.right^.treetype=stringconstn) and
(p^.right^.value_str^=''))
(str_length(p^.right)=0))
) then
begin
{ only one node can be stringconstn }
@ -1263,7 +1263,12 @@ implementation
end.
{
$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
* 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 }
{ load 0 length string }
if (p^.right^.treetype=stringconstn) and
(p^.right^.value_str^='') then
(str_length(p^.right)=0) then
exprasmlist^.concat(new(pai68k,op_const_ref(
A_MOVE,S_B,0,newreference(p^.left^.location.reference))))
else
@ -1345,7 +1345,12 @@ end;
end.
{
$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
* 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.}
imports : plinkedlist;
sourcefiles : tfilemanager;
sourcefiles : pfilemanager;
linksharedlibs,
linkstaticlibs,
linkofiles : tstringcontainer;
@ -803,7 +803,7 @@ unit files;
path:=nil;
setfilename(p+n,true);
used_units.init;
sourcefiles.init;
new(sourcefiles,init);
linkofiles.init;
linkstaticlibs.init;
linksharedlibs.init;
@ -849,7 +849,8 @@ unit files;
if assigned(imports) then
dispose(imports,done);
used_units.done;
sourcefiles.done;
if assigned(sourcefiles) then
dispose(sourcefiles,done);
linkofiles.done;
linkstaticlibs.done;
linksharedlibs.done;
@ -906,7 +907,12 @@ unit files;
end.
{
$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
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 }
if assigned(current_module) then
begin
current_module^.sourcefiles.done;
current_module^.sourcefiles.init;
current_module^.sourcefiles^.done;
current_module^.sourcefiles^.init;
current_module^.used_units.done;
current_module^.used_units.init;
current_module^.linkofiles.done;
@ -374,7 +374,12 @@ unit parser;
end.
{
$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
Revision 1.50 1998/09/24 23:49:08 peter

View File

@ -243,7 +243,9 @@ begin
oldexit:=exitproc;
exitproc:=@myexit;
{$ifndef TP}
{$ifndef UseAnsiString}
heapblocks:=true;
{$endif not UseAnsiString}
{$endif}
{$ifdef UseOverlay}
InitOverlay;
@ -254,7 +256,12 @@ begin
end.
{
$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
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^);
current_scanner^.reload;
{ register for refs }
current_module^.sourcefiles.register_file(hp);
current_module^.sourcefiles^.register_file(hp);
end;
end;
@ -930,7 +930,12 @@ const
{
$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
Revision 1.32 1998/09/24 23:49:19 peter

View File

@ -200,7 +200,7 @@ implementation
constructor tscannerfile.init(const fn:string);
begin
inputfile:=new(pinputfile,init(fn));
current_module^.sourcefiles.register_file(inputfile);
current_module^.sourcefiles^.register_file(inputfile);
{ reset localinput }
inputbuffer:=nil;
inputpointer:=nil;
@ -1424,7 +1424,12 @@ begin
end.
{
$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
Revision 1.53 1998/09/24 23:49:20 peter

View File

@ -135,7 +135,7 @@
hp : pinputfile;
begin
{ second write the used source files }
hp:=current_module^.sourcefiles.files;
hp:=current_module^.sourcefiles^.files;
while assigned(hp) do
begin
{ only name and extension }
@ -382,7 +382,7 @@
{$ifdef UseBrowser}
new(hp,init(hs));
{ the indexing is wrong here PM }
current_module^.sourcefiles.register_file(hp);
current_module^.sourcefiles^.register_file(hp);
{$endif UseBrowser}
end;
Message1(unit_t_ppu_source,hs+temp);
@ -392,7 +392,7 @@
current_module^.mainsource:=stringdup(hs);
{ 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
available }
if do_build and current_module^.sources_avail then
@ -443,7 +443,12 @@
{
$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
records and objects fields are also stored

View File

@ -300,6 +300,7 @@ unit tree;
function is_constboolnode(p : ptree) : boolean;
function is_constrealnode(p : ptree) : boolean;
function is_constcharnode(p : ptree) : boolean;
function str_length(p : ptree) : longint;
{$I innr.inc}
@ -1583,12 +1584,26 @@ unit tree;
(porddef(p^.resulttype)^.typ in [bool8bit,bool16bit,bool32bit]));
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.
{
$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
* ansistring[..] calls does now an unique call

View File

@ -247,7 +247,7 @@ begin
((current_module^.unit_index<>lastmoduleidx) or
(aktfilepos.fileindex<>lastfileidx)) then
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;
{ update lastfileidx only if name known PM }
if status.currentsource<>'' then
@ -403,7 +403,12 @@ end.
{
$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
* while/repeat loops accept now also word/longbool conditions
* makebooltojump did an invalid ungetregister32, fixed