* store procdef messageinf in the ppu

git-svn-id: trunk@4386 -
This commit is contained in:
peter 2006-08-07 19:39:32 +00:00
parent d6fe62f0d1
commit eb829ea21b
6 changed files with 27 additions and 18 deletions

View File

@ -197,13 +197,13 @@ implementation
end
else
begin
i:=strcomp(p^.data.messageinf.str,at^.data.messageinf.str);
i:=CompareStr(p^.data.messageinf.str^,at^.data.messageinf.str^);
if i<0 then
insertstr(p,at^.l,count)
else if i>0 then
insertstr(p,at^.r,count)
else
Message1(parser_e_duplicate_message_label,strpas(p^.data.messageinf.str));
Message1(parser_e_duplicate_message_label,p^.data.messageinf.str^);
end;
end;
@ -263,10 +263,11 @@ implementation
writenames(p^.l);
current_asmdata.asmlists[al_globals].concat(cai_align.create(const_align(sizeof(aint))));
current_asmdata.asmlists[al_globals].concat(Tai_label.Create(p^.nl));
len:=strlen(p^.data.messageinf.str);
len:=length(p^.data.messageinf.str^);
current_asmdata.asmlists[al_globals].concat(tai_const.create_8bit(len));
getmem(ca,len+1);
move(p^.data.messageinf.str^,ca^,len+1);
move(p^.data.messageinf.str[1],ca^,len);
ca[len]:=#0;
current_asmdata.asmlists[al_globals].concat(Tai_string.Create_pchar(ca,len));
if assigned(p^.r) then
writenames(p^.r);

View File

@ -1300,7 +1300,7 @@ begin
if pt.nodetype=stringconstn then
begin
include(pd.procoptions,po_msgstr);
tprocdef(pd).messageinf.str:=strnew(tstringconstnode(pt).value_str);
tprocdef(pd).messageinf.str:=stringdup(tstringconstnode(pt).value_str);
end
else
if is_constintnode(pt) then

View File

@ -2105,7 +2105,7 @@ implementation
searchsym_in_class_by_msgint(classh,pd.messageinf.i,srsym,srsymtable)
else
if (po_msgstr in pd.procoptions) then
searchsym_in_class_by_msgstr(classh,pd.messageinf.str,srsym,srsymtable)
searchsym_in_class_by_msgstr(classh,pd.messageinf.str^,srsym,srsymtable)
else
searchsym_in_class(classh,current_procinfo.procdef._class,hs,srsym,srsymtable);
end

View File

@ -43,7 +43,7 @@ type
{$endif Test_Double_checksum}
const
CurrentPPUVersion=58;
CurrentPPUVersion=59;
{ buffer sizes }
maxentrysize = 1024;

View File

@ -442,7 +442,7 @@ interface
tmessageinf = record
case integer of
0 : (str : pchar);
0 : (str : pstring);
1 : (i : longint);
end;
@ -3200,6 +3200,10 @@ implementation
else
import_name:=nil;
import_nr:=ppufile.getword;
if (po_msgint in procoptions) then
messageinf.i:=ppufile.getlongint;
if (po_msgstr in procoptions) then
messageinf.str:=stringdup(ppufile.getstring);
{ inline stuff }
if (po_has_inlininginfo in procoptions) then
begin
@ -3279,7 +3283,7 @@ implementation
stringdispose(import_dll);
stringdispose(import_name);
if (po_msgstr in procoptions) then
strdispose(messageinf.str);
stringdispose(messageinf.str);
if assigned(_mangledname) then
begin
{$ifdef MEMDEBUG}
@ -3331,6 +3335,10 @@ implementation
if po_has_importname in procoptions then
ppufile.putstring(import_name^);
ppufile.putword(import_nr);
if (po_msgint in procoptions) then
ppufile.putlongint(messageinf.i);
if (po_msgstr in procoptions) then
ppufile.putstring(messageinf.str^);
{ inline stuff }
oldintfcrc:=ppufile.do_crc;
ppufile.do_crc:=false;

View File

@ -1812,7 +1812,7 @@ implementation
be compatible with delphi, see tw6203 (PFV) }
if (def.deftype=procdef) and
(po_msgstr in tprocdef(def).procoptions) and
(tprocdef(def).messageinf.str=s) then
(tprocdef(def).messageinf.str^=s) then
begin
srsym:=tprocdef(def).procsym;
srsymtable:=classh.symtable;