* 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);
@ -1143,7 +1144,7 @@ implementation
if assigned(implprocdef) then
_class.implementedinterfaces.addimplproc(intfindex,implprocdef)
else
if _class.implementedinterfaces.interfaces(intfindex).iitype = etStandard then
if _class.implementedinterfaces.interfaces(intfindex).iitype = etStandard then
Message1(sym_e_no_matching_implementation_found,tprocdef(def).fullprocname(false));
end;
def:=tdef(def.indexnext);
@ -1241,10 +1242,10 @@ implementation
else
procname:=procdefcoll^.data.mangledname;
List.concat(Tai_const.createname(procname,0));
{$ifdef vtentry}
{$ifdef vtentry}
hs:='VTENTRY'+'_'+_class.vmt_mangledname+'$$'+tostr(_class.vmtmethodoffset(i) div sizeof(aint));
current_asmdata.asmlists[al_globals].concat(tai_symbol.CreateName(hs,AT_DATA,0));
{$endif vtentry}
{$endif vtentry}
break;
end;
procdefcoll:=procdefcoll^.next;
@ -1369,7 +1370,7 @@ implementation
current_asmdata.asmlists[al_globals].concat(Tai_const.create(aitconst_ptr,0));
{ write the size of the VMT }
current_asmdata.asmlists[al_globals].concat(Tai_symbol_end.Createname(_class.vmt_mangledname));
{$ifdef vtentry}
{$ifdef vtentry}
{ write vtinherit symbol to notify the linker of the class inheritance tree }
hs:='VTINHERIT'+'_'+_class.vmt_mangledname+'$$';
if assigned(_class.childof) then
@ -1377,7 +1378,7 @@ implementation
else
hs:=hs+_class.vmt_mangledname;
current_asmdata.asmlists[al_globals].concat(tai_symbol.CreateName(hs,AT_DATA,0));
{$endif vtentry}
{$endif vtentry}
end;

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
@ -1379,7 +1379,7 @@ begin
begin
tprocdef(pd).libsym:=sym;
vs:=tparavarsym.create('$syscalllib',paranr_syscall_basesysv,vs_value,tabstractvarsym(sym).vartype,[vo_is_syscall_lib,vo_is_hidden_para]);
pd.parast.insert(vs);
pd.parast.insert(vs);
end
else
Message(parser_e_32bitint_or_pointer_variable_expected);
@ -1387,8 +1387,8 @@ begin
(paramanager as tppcparamanager).create_funcretloc_info(pd,calleeside);
(paramanager as tppcparamanager).create_funcretloc_info(pd,callerside);
tprocdef(pd).extnumber:=get_intconst;
tprocdef(pd).extnumber:=get_intconst;
end else
if target_info.system = system_powerpc_morphos 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;