* alignment is now saved in the symtable

* C alignment added for records
  * PPU version increased to solve .12 <-> .13 probs
This commit is contained in:
peter 1999-07-23 16:05:18 +00:00
parent ca1ccd9221
commit 07bb58295b
12 changed files with 203 additions and 70 deletions

View File

@ -1097,7 +1097,7 @@ implementation
if porddef(ppointerdef(p^.left^.left^.resulttype)^.definition)=voiddef then if porddef(ppointerdef(p^.left^.left^.resulttype)^.definition)=voiddef then
addvalue:=1 addvalue:=1
else else
addvalue:=ppointerdef(p^.left^.left^.resulttype)^.definition^.savesize; addvalue:=ppointerdef(p^.left^.left^.resulttype)^.definition^.size;
end; end;
else else
internalerror(10081); internalerror(10081);
@ -1313,7 +1313,12 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.62 1999-07-05 20:13:10 peter Revision 1.63 1999-07-23 16:05:18 peter
* alignment is now saved in the symtable
* C alignment added for records
* PPU version increased to solve .12 <-> .13 probs
Revision 1.62 1999/07/05 20:13:10 peter
* removed temp defines * removed temp defines
Revision 1.61 1999/07/03 14:14:27 florian Revision 1.61 1999/07/03 14:14:27 florian

View File

@ -129,8 +129,8 @@ unit globals;
initmoduleswitches : tmoduleswitches; initmoduleswitches : tmoduleswitches;
initlocalswitches : tlocalswitches; initlocalswitches : tlocalswitches;
initmodeswitches : tmodeswitches; initmodeswitches : tmodeswitches;
initpackenum, initpackenum : longint;
initpackrecords : longint; initpackrecords : tpackrecords;
initoutputformat : tasm; initoutputformat : tasm;
initoptprocessor : tprocessors; initoptprocessor : tprocessors;
initasmmode : tasmmode; initasmmode : tasmmode;
@ -139,8 +139,8 @@ unit globals;
aktmoduleswitches : tmoduleswitches; aktmoduleswitches : tmoduleswitches;
aktlocalswitches : tlocalswitches; aktlocalswitches : tlocalswitches;
aktmodeswitches : tmodeswitches; aktmodeswitches : tmodeswitches;
aktpackenum, aktpackenum : longint;
aktpackrecords : longint; aktpackrecords : tpackrecords;
aktoutputformat : tasm; aktoutputformat : tasm;
aktoptprocessor : tprocessors; aktoptprocessor : tprocessors;
aktasmmode : tasmmode; aktasmmode : tasmmode;
@ -1172,7 +1172,7 @@ unit globals;
initglobalswitches:=[cs_check_unit_name,cs_link_static]; initglobalswitches:=[cs_check_unit_name,cs_link_static];
initmodeswitches:=fpcmodeswitches; initmodeswitches:=fpcmodeswitches;
initpackenum:=4; initpackenum:=4;
initpackrecords:=2; initpackrecords:=packrecord_2;
initoutputformat:=target_asm.id; initoutputformat:=target_asm.id;
initasmmode:=asmmode_i386_att; initasmmode:=asmmode_i386_att;
initdefines.init; initdefines.init;
@ -1184,7 +1184,7 @@ unit globals;
initglobalswitches:=[cs_check_unit_name,cs_link_static]; initglobalswitches:=[cs_check_unit_name,cs_link_static];
initmodeswitches:=fpcmodeswitches; initmodeswitches:=fpcmodeswitches;
initpackenum:=4; initpackenum:=4;
initpackrecords:=2; initpackrecords:=packrecord_2;
initoutputformat:=as_m68k_as; initoutputformat:=as_m68k_as;
initasmmode:=asmmode_m68k_mot; initasmmode:=asmmode_m68k_mot;
initdefines.init; initdefines.init;
@ -1210,7 +1210,12 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.13 1999-07-18 10:19:52 florian Revision 1.14 1999-07-23 16:05:19 peter
* alignment is now saved in the symtable
* C alignment added for records
* PPU version increased to solve .12 <-> .13 probs
Revision 1.13 1999/07/18 10:19:52 florian
* made it compilable with Dlephi 4 again * made it compilable with Dlephi 4 again
+ fixed problem with large stack allocations on win32 + fixed problem with large stack allocations on win32

View File

@ -123,6 +123,19 @@ interface
bt_general,bt_type,bt_const bt_general,bt_type,bt_const
); );
{ packrecords types }
tpackrecords = (packrecord_none,
packrecord_1,packrecord_2,packrecord_4,
packrecord_8,packrecord_16,packrecord_32,
packrecord_C
);
const
packrecordalignment : array[tpackrecords] of byte=(0,
1,2,4,8,16,32,1
);
type
stringid = string[maxidlen]; stringid = string[maxidlen];
tnormalset = set of byte; { 256 elements set } tnormalset = set of byte; { 256 elements set }
@ -149,7 +162,12 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.12 1999-07-10 10:26:19 peter Revision 1.13 1999-07-23 16:05:21 peter
* alignment is now saved in the symtable
* C alignment added for records
* PPU version increased to solve .12 <-> .13 probs
Revision 1.12 1999/07/10 10:26:19 peter
* merged * merged
Revision 1.11 1999/07/03 00:29:49 peter Revision 1.11 1999/07/03 00:29:49 peter

View File

@ -181,7 +181,7 @@ unit parser;
oldaktlocalswitches : tlocalswitches; oldaktlocalswitches : tlocalswitches;
oldaktmoduleswitches : tmoduleswitches; oldaktmoduleswitches : tmoduleswitches;
oldaktfilepos : tfileposinfo; oldaktfilepos : tfileposinfo;
oldaktpackrecords : word; oldaktpackrecords : tpackrecords;
oldaktoutputformat : tasm; oldaktoutputformat : tasm;
oldaktoptprocessor : tprocessors; oldaktoptprocessor : tprocessors;
oldaktasmmode : tasmmode; oldaktasmmode : tasmmode;
@ -466,7 +466,12 @@ unit parser;
end. end.
{ {
$Log$ $Log$
Revision 1.76 1999-07-22 09:37:49 florian Revision 1.77 1999-07-23 16:05:22 peter
* alignment is now saved in the symtable
* C alignment added for records
* PPU version increased to solve .12 <-> .13 probs
Revision 1.76 1999/07/22 09:37:49 florian
+ resourcestring implemented + resourcestring implemented
+ start of longstring support + start of longstring support

View File

@ -1439,7 +1439,7 @@ unit pdecl;
intmessagetable:=genintmsgtab(aktclass) intmessagetable:=genintmsgtab(aktclass)
else else
datasegment^.concat(new(pai_const,init_32bit(0))); datasegment^.concat(new(pai_const,init_32bit(0)));
{ table for string messages } { table for string messages }
if (aktclass^.options and oo_hasmsgstr)<>0 then if (aktclass^.options and oo_hasmsgstr)<>0 then
@ -1533,24 +1533,24 @@ unit pdecl;
storetypeforwardsallowed : boolean; storetypeforwardsallowed : boolean;
begin begin
{ create recdef }
symtable:=new(psymtable,init(recordsymtable)); symtable:=new(psymtable,init(recordsymtable));
record_dec:=new(precdef,init(symtable));
{ update symtable stack }
symtable^.next:=symtablestack; symtable^.next:=symtablestack;
symtablestack:=symtable; symtablestack:=symtable;
{ parse record }
consume(_RECORD); consume(_RECORD);
storetypeforwardsallowed:=typecanbeforward; storetypeforwardsallowed:=typecanbeforward;
if m_tp in aktmodeswitches then if m_tp in aktmodeswitches then
typecanbeforward:=false; typecanbeforward:=false;
read_var_decs(true,false,false); read_var_decs(true,false,false);
{ may be scale record size to a size of n*4 ? }
if ((symtablestack^.datasize mod aktpackrecords)<>0) then
inc(symtablestack^.datasize,aktpackrecords-(symtablestack^.datasize mod aktpackrecords));
consume(_END); consume(_END);
typecanbeforward:=storetypeforwardsallowed; typecanbeforward:=storetypeforwardsallowed;
{ may be scale record size to a size of n*4 ? }
symtablestack^.datasize:=align(symtablestack^.datasize,symtablestack^.dataalignment);
{ restore symtable stack }
symtablestack:=symtable^.next; symtablestack:=symtable^.next;
record_dec:=new(precdef,init(symtable));
end; end;
@ -1644,7 +1644,8 @@ unit pdecl;
aufsym : penumsym; aufsym : penumsym;
ap : parraydef; ap : parraydef;
s : stringid; s : stringid;
l,v,oldaktpackrecords : longint; l,v : longint;
oldaktpackrecords : tpackrecords;
hs : string; hs : string;
procedure expr_type; procedure expr_type;
@ -1894,7 +1895,7 @@ unit pdecl;
else else
begin begin
oldaktpackrecords:=aktpackrecords; oldaktpackrecords:=aktpackrecords;
aktpackrecords:=1; aktpackrecords:=packrecord_1;
if token in [_CLASS,_OBJECT] then if token in [_CLASS,_OBJECT] then
p:=object_dec(name,nil) p:=object_dec(name,nil)
else else
@ -2187,7 +2188,12 @@ unit pdecl;
end. end.
{ {
$Log$ $Log$
Revision 1.134 1999-07-22 09:37:50 florian Revision 1.135 1999-07-23 16:05:23 peter
* alignment is now saved in the symtable
* C alignment added for records
* PPU version increased to solve .12 <-> .13 probs
Revision 1.134 1999/07/22 09:37:50 florian
+ resourcestring implemented + resourcestring implemented
+ start of longstring support + start of longstring support

View File

@ -37,7 +37,7 @@ type
{$endif Test_Double_checksum} {$endif Test_Double_checksum}
const const
CurrentPPUVersion=16; CurrentPPUVersion=17;
{ buffer sizes } { buffer sizes }
maxentrysize = 1024; maxentrysize = 1024;
@ -386,7 +386,7 @@ begin
Id[3]:='U'; Id[3]:='U';
Ver[1]:='0'; Ver[1]:='0';
Ver[2]:='1'; Ver[2]:='1';
Ver[3]:='6'; Ver[3]:='7';
end; end;
end; end;
@ -871,7 +871,12 @@ end;
end. end.
{ {
$Log$ $Log$
Revision 1.35 1999-07-05 16:21:30 peter Revision 1.36 1999-07-23 16:05:25 peter
* alignment is now saved in the symtable
* C alignment added for records
* PPU version increased to solve .12 <-> .13 probs
Revision 1.35 1999/07/05 16:21:30 peter
* fixed linking for units without linking necessary * fixed linking for units without linking necessary
Revision 1.34 1999/07/03 00:29:57 peter Revision 1.34 1999/07/03 00:29:57 peter

View File

@ -345,12 +345,12 @@ unit ptconst;
else else
begin begin
{$ifdef i386} {$ifdef i386}
for l:=0 to def^.savesize-1 do for l:=0 to def^.size-1 do
curconstsegment^.concat(new(pai_const,init_8bit(p^.value_set^[l]))); curconstsegment^.concat(new(pai_const,init_8bit(p^.value_set^[l])));
{$endif} {$endif}
{$ifdef m68k} {$ifdef m68k}
j:=0; j:=0;
for l:=0 to ((def^.savesize-1) div 4) do for l:=0 to ((def^.size-1) div 4) do
{ HORRIBLE HACK because of endian } { HORRIBLE HACK because of endian }
{ now use intel endian for constant sets } { now use intel endian for constant sets }
begin begin
@ -725,7 +725,12 @@ unit ptconst;
end. end.
{ {
$Log$ $Log$
Revision 1.47 1999-07-03 14:14:28 florian Revision 1.48 1999-07-23 16:05:26 peter
* alignment is now saved in the symtable
* C alignment added for records
* PPU version increased to solve .12 <-> .13 probs
Revision 1.47 1999/07/03 14:14:28 florian
+ start of val(int64/qword) + start of val(int64/qword)
* longbool, wordbool constants weren't written, fixed * longbool, wordbool constants weren't written, fixed

View File

@ -749,20 +749,23 @@ const
if not(c in ['0'..'9']) then if not(c in ['0'..'9']) then
begin begin
hs:=current_scanner^.readid; hs:=current_scanner^.readid;
if (hs='NORMAL') or (hs='DEFAULT') then if (hs='C') then
aktpackrecords:=2 aktpackrecords:=packrecord_C
else
if (hs='NORMAL') or (hs='DEFAULT') then
aktpackrecords:=packrecord_2
else else
Message(scan_w_only_pack_records); Message(scan_w_only_pack_records);
end end
else else
begin begin
case current_scanner^.readval of case current_scanner^.readval of
1 : aktpackrecords:=1; 1 : aktpackrecords:=packrecord_1;
2 : aktpackrecords:=2; 2 : aktpackrecords:=packrecord_2;
4 : aktpackrecords:=4; 4 : aktpackrecords:=packrecord_4;
8 : aktpackrecords:=8; 8 : aktpackrecords:=packrecord_8;
16 : aktpackrecords:=16; 16 : aktpackrecords:=packrecord_16;
32 : aktpackrecords:=32; 32 : aktpackrecords:=packrecord_32;
else else
Message(scan_w_only_pack_records); Message(scan_w_only_pack_records);
end; end;
@ -1085,7 +1088,12 @@ const
{ {
$Log$ $Log$
Revision 1.55 1999-07-16 10:04:36 peter Revision 1.56 1999-07-23 16:05:27 peter
* alignment is now saved in the symtable
* C alignment added for records
* PPU version increased to solve .12 <-> .13 probs
Revision 1.55 1999/07/16 10:04:36 peter
* merged * merged
Revision 1.54 1999/07/03 00:29:58 peter Revision 1.54 1999/07/03 00:29:58 peter

View File

@ -241,6 +241,13 @@
end; end;
function tdef.alignment : longint;
begin
{ normal alignment by default }
alignment:=0;
end;
{$ifdef GDB} {$ifdef GDB}
procedure tdef.set_globalnb; procedure tdef.set_globalnb;
begin begin
@ -1779,6 +1786,13 @@
end; end;
function tarraydef.alignment : longint;
begin
{ alignment is the size of the elements }
alignment:=definition^.size;
end;
function tarraydef.needs_inittable : boolean; function tarraydef.needs_inittable : boolean;
begin begin
needs_inittable:=definition^.needs_inittable; needs_inittable:=definition^.needs_inittable;
@ -1831,6 +1845,7 @@
symtable:=p; symtable:=p;
savesize:=symtable^.datasize; savesize:=symtable^.datasize;
symtable^.defowner := @self; symtable^.defowner := @self;
symtable^.dataalignment:=packrecordalignment[aktpackrecords];
end; end;
@ -1851,10 +1866,12 @@
destructor trecdef.done; destructor trecdef.done;
begin begin
if assigned(symtable) then dispose(symtable,done); if assigned(symtable) then
dispose(symtable,done);
inherited done; inherited done;
end; end;
var var
binittable : boolean; binittable : boolean;
@ -1909,6 +1926,16 @@
read_member:=oldread_member; read_member:=oldread_member;
end; end;
function trecdef.size:longint;
begin
size:=symtable^.datasize;
end;
function trecdef.alignment:longint;
begin
alignment:=symtable^.dataalignment;
end;
{$ifdef GDB} {$ifdef GDB}
Const StabRecString : pchar = Nil; Const StabRecString : pchar = Nil;
@ -2862,16 +2889,11 @@ Const local_symtable_index : longint = $8001;
publicsyms:=new(psymtable,init(objectsymtable)); publicsyms:=new(psymtable,init(objectsymtable));
publicsyms^.name := stringdup(n); publicsyms^.name := stringdup(n);
{ create space for vmt !! } { create space for vmt !! }
{$ifdef OLDVMTSTYLE}
publicsyms^.datasize:=target_os.size_of_pointer;
options:=oo_hasvmt;
vmt_offset:=0;
{$else }
options:=0; options:=0;
vmt_offset:=0; vmt_offset:=0;
publicsyms^.datasize:=0; publicsyms^.datasize:=0;
{$endif }
publicsyms^.defowner:=@self; publicsyms^.defowner:=@self;
publicsyms^.dataalignment:=packrecordalignment[aktpackrecords];
set_parent(c); set_parent(c);
objname:=stringdup(n); objname:=stringdup(n);
end; end;
@ -2944,15 +2966,16 @@ Const local_symtable_index : longint = $8001;
else else
begin begin
{ first round up to multiple of 4 } { first round up to multiple of 4 }
if (aktpackrecords=2) then if (publicsyms^.dataalignment=2) then
begin begin
if (publicsyms^.datasize and 1)<>0 then if (publicsyms^.datasize and 1)<>0 then
inc(publicsyms^.datasize); inc(publicsyms^.datasize);
end; end
if (aktpackrecords>=4) then else
if (publicsyms^.dataalignment>=4) then
begin begin
if (publicsyms^.datasize mod 4) <> 0 then if (publicsyms^.datasize mod 4) <> 0 then
publicsyms^.datasize:=publicsyms^.datasize+4-(publicsyms^.datasize mod 4); publicsyms^.datasize:=publicsyms^.datasize+4-(publicsyms^.datasize mod 4);
end; end;
vmt_offset:=publicsyms^.datasize; vmt_offset:=publicsyms^.datasize;
publicsyms^.datasize:=publicsyms^.datasize+target_os.size_of_pointer; publicsyms^.datasize:=publicsyms^.datasize+target_os.size_of_pointer;
@ -3002,14 +3025,19 @@ Const local_symtable_index : longint = $8001;
end; end;
function tobjectdef.size : longint; function tobjectdef.size : longint;
begin begin
if (options and oo_is_class)<>0 then if (options and oo_is_class)<>0 then
size:=target_os.size_of_pointer size:=target_os.size_of_pointer
else else
size:=publicsyms^.datasize; size:=publicsyms^.datasize;
end; end;
function tobjectdef.alignment:longint;
begin
alignment:=publicsyms^.dataalignment;
end;
procedure tobjectdef.deref; procedure tobjectdef.deref;
@ -3467,7 +3495,12 @@ Const local_symtable_index : longint = $8001;
{ {
$Log$ $Log$
Revision 1.132 1999-07-18 14:47:32 florian Revision 1.133 1999-07-23 16:05:28 peter
* alignment is now saved in the symtable
* C alignment added for records
* PPU version increased to solve .12 <-> .13 probs
Revision 1.132 1999/07/18 14:47:32 florian
* bug 487 fixed, (inc(<property>) isn't allowed) * bug 487 fixed, (inc(<property>) isn't allowed)
* more fixes to compile with Delphi * more fixes to compile with Delphi

View File

@ -32,9 +32,8 @@
pdef = ^tdef; pdef = ^tdef;
tdef = object(tsymtableentry) tdef = object(tsymtableentry)
deftype : tdeftype; deftype : tdeftype;
savesize : longint; sym : ptypesym; { which type the definition was generated this def }
sym : ptypesym; { which type the definition was generated this def }
has_inittable : boolean; has_inittable : boolean;
{ adress of init informations } { adress of init informations }
@ -59,6 +58,7 @@
function typename:string; function typename:string;
procedure write;virtual; procedure write;virtual;
function size:longint;virtual; function size:longint;virtual;
function alignment:longint;virtual;
{$ifdef GDB} {$ifdef GDB}
function NumberString:string; function NumberString:string;
procedure set_globalnb; procedure set_globalnb;
@ -91,6 +91,8 @@
function is_publishable : boolean;virtual; function is_publishable : boolean;virtual;
function is_in_current : boolean; function is_in_current : boolean;
function gettypename:string;virtual; function gettypename:string;virtual;
private
savesize : longint;
end; end;
targconvtyp = (act_convertable,act_equal,act_exact); targconvtyp = (act_convertable,act_equal,act_exact);
@ -173,8 +175,6 @@
tobjectdef = object(tdef) tobjectdef = object(tdef)
childof : pobjectdef; childof : pobjectdef;
objname : pstring; objname : pstring;
{ privatesyms : psymtable;
protectedsyms : psymtable; }
publicsyms : psymtable; publicsyms : psymtable;
options : longint; options : longint;
{ to be able to have a variable vmt position } { to be able to have a variable vmt position }
@ -185,6 +185,7 @@
procedure check_forwards; procedure check_forwards;
function isrelated(d : pobjectdef) : boolean; function isrelated(d : pobjectdef) : boolean;
function size : longint;virtual; function size : longint;virtual;
function alignment:longint;virtual;
constructor load; constructor load;
procedure write;virtual; procedure write;virtual;
function vmt_mangledname : string; function vmt_mangledname : string;
@ -246,6 +247,7 @@
{$endif GDB} {$endif GDB}
procedure deref;virtual; procedure deref;virtual;
function size : longint;virtual; function size : longint;virtual;
function alignment : longint;virtual;
{ generates the ranges needed by the asm instruction BOUND (i386) { generates the ranges needed by the asm instruction BOUND (i386)
or CMP2 (Motorola) } or CMP2 (Motorola) }
procedure genrangecheck; procedure genrangecheck;
@ -264,6 +266,8 @@
constructor load; constructor load;
destructor done;virtual; destructor done;virtual;
procedure write;virtual; procedure write;virtual;
function size:longint;virtual;
function alignment : longint;virtual;
{$ifdef GDB} {$ifdef GDB}
function stabstring : pchar;virtual; function stabstring : pchar;virtual;
procedure concatstabto(asmlist : paasmoutput);virtual; procedure concatstabto(asmlist : paasmoutput);virtual;
@ -521,7 +525,12 @@
{ {
$Log$ $Log$
Revision 1.33 1999-06-22 16:24:45 pierre Revision 1.34 1999-07-23 16:05:30 peter
* alignment is now saved in the symtable
* C alignment added for records
* PPU version increased to solve .12 <-> .13 probs
Revision 1.33 1999/06/22 16:24:45 pierre
* local browser stuff corrected * local browser stuff corrected
Revision 1.32 1999/06/02 10:11:51 florian Revision 1.32 1999/06/02 10:11:51 florian

View File

@ -1035,6 +1035,7 @@
procedure tvarsym.insert_in_data; procedure tvarsym.insert_in_data;
var var
varalign,
l,ali,modulo : longint; l,ali,modulo : longint;
storefilepos : tfileposinfo; storefilepos : tfileposinfo;
begin begin
@ -1147,42 +1148,61 @@
begin begin
{ this symbol can't be loaded to a register } { this symbol can't be loaded to a register }
var_options:=var_options and not vo_regable; var_options:=var_options and not vo_regable;
{ get the alignment size }
if (aktpackrecords=packrecord_C) and
(owner^.dataalignment<4) then
begin
varalign:=definition^.alignment;
if varalign>0 then
begin
if varalign>owner^.dataalignment then
owner^.dataalignment:=varalign;
end
else
begin
if l>=4 then
owner^.dataalignment:=4
else
if l>=2 then
owner^.dataalignment:=2;
end;
end;
{ align record and object fields } { align record and object fields }
if (l=1) or (aktpackrecords=1) then if (l=1) or (owner^.dataalignment=1) then
begin begin
address:=owner^.datasize; address:=owner^.datasize;
inc(owner^.datasize,l) inc(owner^.datasize,l)
end end
else else
if (l=2) or (aktpackrecords=2) then if (l=2) or (owner^.dataalignment=2) then
begin begin
owner^.datasize:=(owner^.datasize+1) and (not 1); owner^.datasize:=(owner^.datasize+1) and (not 1);
address:=owner^.datasize; address:=owner^.datasize;
inc(owner^.datasize,l) inc(owner^.datasize,l)
end end
else else
if (l<=4) or (aktpackrecords=4) then if (l<=4) or (owner^.dataalignment=4) then
begin begin
owner^.datasize:=(owner^.datasize+3) and (not 3); owner^.datasize:=(owner^.datasize+3) and (not 3);
address:=owner^.datasize; address:=owner^.datasize;
inc(owner^.datasize,l); inc(owner^.datasize,l);
end end
else else
if (l<=8) or (aktpackrecords=8) then if (l<=8) or (owner^.dataalignment=8) then
begin begin
owner^.datasize:=(owner^.datasize+7) and (not 7); owner^.datasize:=(owner^.datasize+7) and (not 7);
address:=owner^.datasize; address:=owner^.datasize;
inc(owner^.datasize,l); inc(owner^.datasize,l);
end end
else else
if (l<=16) or (aktpackrecords=16) then if (l<=16) or (owner^.dataalignment=16) then
begin begin
owner^.datasize:=(owner^.datasize+15) and (not 15); owner^.datasize:=(owner^.datasize+15) and (not 15);
address:=owner^.datasize; address:=owner^.datasize;
inc(owner^.datasize,l); inc(owner^.datasize,l);
end end
else else
if (l<=32) or (aktpackrecords=32) then if (l<=32) or (owner^.dataalignment=32) then
begin begin
owner^.datasize:=(owner^.datasize+31) and (not 31); owner^.datasize:=(owner^.datasize+31) and (not 31);
address:=owner^.datasize; address:=owner^.datasize;
@ -1982,7 +2002,12 @@
{ {
$Log$ $Log$
Revision 1.99 1999-07-23 11:33:23 peter Revision 1.100 1999-07-23 16:05:32 peter
* alignment is now saved in the symtable
* C alignment added for records
* PPU version increased to solve .12 <-> .13 probs
Revision 1.99 1999/07/23 11:33:23 peter
* removed oldppu from propertysym * removed oldppu from propertysym
Revision 1.98 1999/07/22 09:37:55 florian Revision 1.98 1999/07/22 09:37:55 florian

View File

@ -147,6 +147,7 @@ unit symtable;
unitid : integer; { each symtable gets a number } unitid : integer; { each symtable gets a number }
name : pstring; name : pstring;
datasize : longint; datasize : longint;
dataalignment : longint;
symindex, symindex,
defindex : pindexarray; defindex : pindexarray;
symsearch : pdictionary; symsearch : pdictionary;
@ -1028,6 +1029,7 @@ implementation
name:=nil; name:=nil;
address_fixup:=0; address_fixup:=0;
datasize:=0; datasize:=0;
dataalignment:=1;
new(symindex,init(indexgrowsize)); new(symindex,init(indexgrowsize));
new(defindex,init(indexgrowsize)); new(defindex,init(indexgrowsize));
if symtabletype<>withsymtable then if symtabletype<>withsymtable then
@ -1150,8 +1152,9 @@ implementation
Message(unit_f_ppu_read_error); Message(unit_f_ppu_read_error);
{ skip amount of symbols, not used currently } { skip amount of symbols, not used currently }
current_ppu^.getlongint; current_ppu^.getlongint;
{ load datasize of this symboltable } { load datasize,dataalignment of this symboltable }
datasize:=current_ppu^.getlongint; datasize:=current_ppu^.getlongint;
dataalignment:=current_ppu^.getlongint;
{ now read the symbols } { now read the symbols }
repeat repeat
b:=current_ppu^.readentry; b:=current_ppu^.readentry;
@ -1208,6 +1211,7 @@ implementation
datasize to the ibsymdef entry } datasize to the ibsymdef entry }
current_ppu^.putlongint(symindex^.count); current_ppu^.putlongint(symindex^.count);
current_ppu^.putlongint(datasize); current_ppu^.putlongint(datasize);
current_ppu^.putlongint(dataalignment);
current_ppu^.writeentry(ibstartsyms); current_ppu^.writeentry(ibstartsyms);
{ foreach is used to write all symbols } { foreach is used to write all symbols }
pd:=psym(symindex^.first); pd:=psym(symindex^.first);
@ -2334,7 +2338,12 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.28 1999-07-23 12:02:20 peter Revision 1.29 1999-07-23 16:05:33 peter
* alignment is now saved in the symtable
* C alignment added for records
* PPU version increased to solve .12 <-> .13 probs
Revision 1.28 1999/07/23 12:02:20 peter
* fixed crash in previous commit * fixed crash in previous commit
Revision 1.27 1999/07/23 11:37:50 peter Revision 1.27 1999/07/23 11:37:50 peter