Browse Source

* some bug fixes (e.g. must_be_valid and procinfo.funcret_is_valid)
* most things for stored properties fixed

florian 26 years ago
parent
commit
a9d8bfa1f7

+ 6 - 10
compiler/ag386att.pas

@@ -207,15 +207,7 @@ unit ag386att;
     begin
       case o.typ of
         top_reg :
-          begin
-{$ifdef debug}
-             if not(o.reg) in tregister then
-               getopstr:=''
-             else
-{$endif}
-
-             getopstr:=att_reg2str[o.reg];
-          end;
+          getopstr:=att_reg2str[o.reg];
         top_ref :
           getopstr:=getreferencestring(o.ref^);
         top_const :
@@ -869,7 +861,11 @@ unit ag386att;
 end.
 {
   $Log$
-  Revision 1.13  1999-09-02 17:07:38  florian
+  Revision 1.14  1999-09-10 18:48:00  florian
+    * some bug fixes (e.g. must_be_valid and procinfo.funcret_is_valid)
+    * most things for stored properties fixed
+
+  Revision 1.13  1999/09/02 17:07:38  florian
     * problems with -Or fixed: tdef.isfpuregable was wrong!
 
   Revision 1.12  1999/08/25 16:03:46  peter

+ 12 - 3
compiler/cpubase.pas

@@ -769,7 +769,13 @@ const
   frame_pointer = R_EBP;
   self_pointer  = R_ESI;
   accumulator   = R_EAX;
-  scratch_register = R_EDI;
+
+  { the register where the vmt offset is passed to the destructor }
+  vmt_offset_reg = R_EDI;
+
+  scratch_regs : array[1..1] of tregister = (R_EDI);
+
+  max_scratch_regs = 1;
 
 {$ifndef noopt}
 { low and high of the available maximum width integer general purpose }
@@ -1040,7 +1046,6 @@ begin
   new_reference:=r;
 end;
 
-
 {*****************************************************************************
                               Instruction table
 *****************************************************************************}
@@ -1086,7 +1091,11 @@ end;
 end.
 {
   $Log$
-  Revision 1.11  1999-09-08 16:04:05  peter
+  Revision 1.12  1999-09-10 18:48:01  florian
+    * some bug fixes (e.g. must_be_valid and procinfo.funcret_is_valid)
+    * most things for stored properties fixed
+
+  Revision 1.11  1999/09/08 16:04:05  peter
     * better support for object fields and more error checks for
       field accesses which create buggy code
 

+ 7 - 0
compiler/errore.msg

@@ -777,6 +777,13 @@ parser_e_resourcestring_only_sg=E_Resourcestrings can be only static or global
 parser_e_exit_with_argument_not__possible=E_Exit with argument can't be used here
 % an exit statement with an argument for the return value can't be used here, this
 % can happen e.g. in \var{try..except} or \var{try..finally} blocks
+parser_e_stored_property_must_be_boolean=E_The type of the storage symbol must be boolean
+% If you specify a storage symbol in a property declaration, it must be of
+% the type boolean
+parser_e_ill_property_storage_sym=E_This symbol isn't allowed as storage symbol
+% You can't use this type of symbol as storage specifier in property
+% declaration. You can use only methods with the result type boolean,
+% boolean class fields or boolean constants 
 % \end{description}
 #
 # Type Checking

+ 10 - 1
compiler/globals.pas

@@ -317,6 +317,11 @@ unit globals;
 
     function assigned(p : pointer) : boolean;
 
+      type
+         ptrrec = record
+            ofs,seg : word;
+         end;
+
 {$ifndef FPC}
     {$ifndef DPMI}
       var
@@ -1253,7 +1258,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.24  1999-09-08 16:05:31  peter
+  Revision 1.25  1999-09-10 18:48:02  florian
+    * some bug fixes (e.g. must_be_valid and procinfo.funcret_is_valid)
+    * most things for stored properties fixed
+
+  Revision 1.24  1999/09/08 16:05:31  peter
     * pointer add/sub is now as expected and the same results as inc/dec
 
   Revision 1.23  1999/09/07 15:11:00  pierre

+ 2 - 0
compiler/msgidx.inc

@@ -208,6 +208,8 @@ type tmsgconst=(
   parser_e_cant_use_inittable_here,
   parser_e_resourcestring_only_sg,
   parser_e_exit_with_argument_not__possible,
+  parser_e_stored_property_must_be_boolean,
+  parser_e_ill_property_storage_sym,
   type_e_mismatch,
   type_e_incompatible_types,
   type_e_not_equal_types,

+ 144 - 142
compiler/msgtxt.inc

@@ -1,7 +1,7 @@
 {$ifdef Delphi}
-const msgtxt : array[0..000100] of string[240]=(
+const msgtxt : array[0..000101] of string[240]=(
 {$else Delphi}
-const msgtxt : array[0..000100,1..240] of char=(
+const msgtxt : array[0..000101,1..240] of char=(
 {$endif Delphi}
   'T_Compiler: $1'#000+
   'D_Compiler OS: $1'#000+
@@ -222,443 +222,445 @@ const msgtxt : array[0..000100,1..240] of char=(
   ' used in variant records'#000+
   'E_Resourcestrings can be only static or global'#000+
   'E_Exit with argument can'#039't be used here'#000+
+  'E_The type of the storage symbol must be boolean'#000+
+  'E_This symbol isn'#039't allowed as storage symbol'#000+
   'E_Type mismatch'#000+
-  'E_Incompatible types: got "$1" expected "$2"'#000+
+  'E_Incompatible ','types: got "$1" expected "$2"'#000+
   'E_Type mismatch between $1 and $2'#000+
   'E_Type identifier expected'#000+
-  'E_Va','riable identifier expected'#000+
+  'E_Variable identifier expected'#000+
   'E_Integer expression expected, but got "$1"'#000+
   'E_Boolean expression expected, but got "$1"'#000+
-  'E_Ordinal expression expected'#000+
+  'E_Ordinal expression expected'#000,
   'E_pointer type expected, but got "$1"'#000+
   'E_class type expected, but got "$1"'#000+
-  'E_Variable or type in','dentifier expected'#000+
+  'E_Variable or type indentifier expected'#000+
   'E_Can'#039't evaluate constant expression'#000+
   'E_Set elements are not compatible'#000+
   'E_Operation not implemented for sets'#000+
-  'W_Automatic type conversion from floating type to COMP which is an int'+
-  'eger type'#000+
-  'H_use DIV instead to get an integ','er result'#000+
+  'W_Automatic type c','onversion from floating type to COMP which is an i'+
+  'nteger type'#000+
+  'H_use DIV instead to get an integer result'#000+
   'E_string types doesn'#039't match, because of $V+ mode'#000+
   'E_succ or pred on enums with assignments not possible'#000+
-  'E_Can'#039't read or write variables of this type'#000+
+  'E_Can'#039't read or write variables',' of this type'#000+
   'E_Type conflict between set elements'#000+
-  'W_lo/hi(dword/qword) returns the upper/lower',' word/dword'#000+
+  'W_lo/hi(dword/qword) returns the upper/lower word/dword'#000+
   'E_Integer or real expression expected'#000+
   'E_Wrong type in array constructor'#000+
   'E_Incompatible type for arg no. $1: Got $2, expected $3'#000+
-  'E_Method (variable) and Procedure (variable) are not compatible'#000+
-  'E_Illegal constant passed to interna','l math function'#000+
+  'E_Met','hod (variable) and Procedure (variable) are not compatible'#000+
+  'E_Illegal constant passed to internal math function'#000+
   'E_Can'#039't get the address of constants'#000+
   'E_Argument must be l-value'#000+
   'E_Can'#039't assign local procedure/function to procedure variable'#000+
-  'E_Identifier not found $1'#000+
+  'E_I','dentifier not found $1'#000+
   'F_Internal Error in SymTableStack()'#000+
   'E_Duplicate identifier $1'#000+
-  'H_Identifi','er already defined in $1 at line $2'#000+
+  'H_Identifier already defined in $1 at line $2'#000+
   'E_Unknown identifier $1'#000+
   'E_Forward declaration not solved $1'#000+
   'F_Identifier type already defined as type'#000+
-  'E_Error in type definition'#000+
+  'E_Error',' in type definition'#000+
   'E_Type identifier not defined'#000+
   'E_Forward type not resolved $1'#000+
-  'E_Only static ','variables can be used in static methods or outside met'+
-  'hods'#000+
+  'E_Only static variables can be used in static methods or outside metho'+
+  'ds'#000+
   'E_Invalid call to tvarsym.mangledname()'#000+
   'F_record or class type expected'#000+
-  'E_Instances of classes or objects with an abstract method are not allo'+
-  'wed'#000+
+  'E_Instances of',' classes or objects with an abstract method are not al'+
+  'lowed'#000+
   'W_Label not defined $1'#000+
-  'E_Illegal la','bel declaration'#000+
+  'E_Illegal label declaration'#000+
   'E_GOTO and LABEL are not supported (use switch -Sg)'#000+
   'E_Label not found'#000+
   'E_identifier isn'#039't a label'#000+
   'E_label already defined'#000+
-  'E_illegal type declaration of set elements'#000+
+  'E_illega','l type declaration of set elements'#000+
   'E_Forward class definition not resolved $1'#000+
-  'H_Parameter not u','sed $1'#000+
+  'H_Parameter not used $1'#000+
   'N_Local variable not used $1'#000+
   'E_Set type expected'#000+
   'W_Function result does not seem to be set'#000+
   'E_Unknown record field identifier $1'#000+
-  'W_Local variable $1 does not seem to be initialized'#000+
+  'W_Local va','riable $1 does not seem to be initialized'#000+
   'W_Variable $1 does not seem to be initialized'#000+
-  'E_ident','ifier idents no member $1'#000+
+  'E_identifier idents no member $1'#000+
   'B_Found declaration: $1'#000+
   'E_Data segment too large (max. 2GB)'#000+
   'E_BREAK not allowed'#000+
   'E_CONTINUE not allowed'#000+
-  'E_Expression too complicated - FPU stack overflow'#000+
+  'E_Expression too',' complicated - FPU stack overflow'#000+
   'E_Illegal expression'#000+
   'E_Invalid integer expression'#000+
-  'E_Illegal q','ualifier'#000+
+  'E_Illegal qualifier'#000+
   'E_High range limit < low range limit'#000+
   'E_Illegal counter variable'#000+
   'E_Can'#039't determine which overloaded function to call'#000+
-  'E_Parameter list size exceeds 65535 bytes'#000+
+  'E_Parameter list siz','e exceeds 65535 bytes'#000+
   'E_Illegal type conversion'#000+
-  'D_Conversion between ordinals and pointers is n','ot portable across pl'+
-  'atforms'#000+
+  'D_Conversion between ordinals and pointers is not portable across plat'+
+  'forms'#000+
   'E_File types must be var parameters'#000+
   'E_The use of a far pointer isn'#039't allowed there'#000+
-  'E_illegal call by reference parameters'#000+
+  'E_illegal call by reference param','eters'#000+
   'E_EXPORT declared functions can'#039't be called'#000+
-  'W_Possible illegal call of constructor or des','tructor (doesn'#039't ma'+
-  'tch to this context)'#000+
+  'W_Possible illegal call of constructor or destructor (doesn'#039't matc'+
+  'h to this context)'#000+
   'N_Inefficient code'#000+
   'W_unreachable code'#000+
   'E_procedure call with stackframe ESP/SP'#000+
-  'E_Abstract methods can'#039't be called directly'#000+
+  'E_Abstract methods can'#039't be',' called directly'#000+
   'F_Internal Error in getfloatreg(), allocation failure'#000+
   'F_Unknown float type'#000+
-  'F_S','econdVecn() base defined twice'#000+
+  'F_SecondVecn() base defined twice'#000+
   'F_Extended cg68k not supported'#000+
   'F_32-bit unsigned not supported in MC68000 mode'#000+
-  'F_Internal Error in secondinline()'#000+
+  'F_Internal Error in secondinline()'#000,
   'D_Register $1 weight $2 $3'#000+
   'E_Stack limit excedeed in local routine'#000+
   'D_Stack frame is omitted'#000+
-  'E_O','bject or class methods can'#039't be inline.'#000+
+  'E_Object or class methods can'#039't be inline.'#000+
   'E_Procvar calls can'#039't be inline.'#000+
   'E_No code for inline procedure stored'#000+
-  'E_Element zero of an ansi/wide- or longstring can'#039't be accessed, u'+
-  'se (set)length instead'#000+
-  'E_Include and exclude not implemented in',' this case'#000+
+  'E_Element zero of an ansi/wide- or',' longstring can'#039't be accessed,'+
+  ' use (set)length instead'#000+
+  'E_Include and exclude not implemented in this case'#000+
   'E_Constructors or destructors can not be called inside a '#039'with'#039+
   ' clause'#000+
   'E_Cannot call message handler method directly'#000+
-  'D_Starting $1 styled assembler parsing'#000+
+  'D_Starting $1 sty','led assembler parsing'#000+
   'D_Finished $1 styled assembler parsing'#000+
   'E_Non-label pattern contains @'#000+
-  'W_O','verride operator not supported'#000+
+  'W_Override operator not supported'#000+
   'E_Error building record offset'#000+
   'E_OFFSET used without identifier'#000+
   'E_TYPE used without identifier'#000+
-  'E_Cannot use local variable or parameters here'#000+
+  'E_Cannot use local ','variable or parameters here'#000+
   'E_need to use OFFSET here'#000+
-  'E_Cannot use multiple relocatable symbols',#000+
+  'E_Cannot use multiple relocatable symbols'#000+
   'E_Relocatable symbol can only be added'#000+
   'E_Invalid constant expression'#000+
   'E_Relocatable symbol is not allowed'#000+
   'E_Invalid reference syntax'#000+
-  'E_Local symbols not allowed as references'#000+
+  'E_Local symb','ols not allowed as references'#000+
   'E_Invalid base and index register usage'#000+
-  'E_Wrong scale factor spec','ified'#000+
+  'E_Wrong scale factor specified'#000+
   'E_Multiple index register usage'#000+
   'E_Invalid operand type'#000+
   'E_Invalid string as opcode operand: $1'#000+
   'W_@CODE and @DATA not supported'#000+
-  'E_Null label references are not allowed'#000+
+  'E_Null label ','references are not allowed'#000+
   'F_Divide by zero in asm evaluator'#000+
   'F_Evaluator stack overflow'#000+
-  'F_Evalu','ator stack underflow'#000+
+  'F_Evaluator stack underflow'#000+
   'F_Invalid numeric format in asm evaluator'#000+
   'F_Invalid Operator in asm evaluator'#000+
   'E_escape sequence ignored: $1'#000+
-  'E_Invalid symbol reference'#000+
+  'E_Invalid symbol',' reference'#000+
   'W_Fwait can cause emulation problems with emu387'#000+
-  'W_Calling an overload function in a','ssembler'#000+
+  'W_Calling an overload function in assembler'#000+
   'E_Unsupported symbol type for operand'#000+
   'E_Constant value out of bounds'#000+
   'E_Error converting decimal $1'#000+
   'E_Error converting octal $1'#000+
-  'E_Error converting binary $1'#000+
+  'E_Error c','onverting binary $1'#000+
   'E_Error converting hexadecimal $1'#000+
   'H_$1 translated to $2'#000+
-  'W_$1 is associated ','to an overloaded function'#000+
+  'W_$1 is associated to an overloaded function'#000+
   'E_Cannot use SELF outside a method'#000+
   'E_Cannot use OLDEBP outside a nested procedure'#000+
-  'W_Functions with void return value can'#039't return any value in asm c'+
-  'ode'#000+
+  'W_Functions with void return value ca','n'#039't return any value in asm'+
+  ' code'#000+
   'E_SEG not supported'#000+
-  'E_Size suffix and destination or source si','ze do not match'#000+
+  'E_Size suffix and destination or source size do not match'#000+
   'W_Size suffix and destination or source size do not match'#000+
   'E_Assembler syntax error'#000+
   'E_Invalid combination of opcode and operands'#000+
-  'E_Assemler syntax error in operand'#000+
+  'E','_Assemler syntax error in operand'#000+
   'E_Assemler syntax error in constant'#000+
-  'E_Invalid String expressi','on'#000+
+  'E_Invalid String expression'#000+
   '32bit constant created for address'#000+
   'E_Invalid or missing opcode'#000+
   'E_Invalid combination of prefix and opcode: $1'#000+
-  'E_Invalid combination of override and opcode: $1'#000+
+  'E_Invalid combination of overrid','e and opcode: $1'#000+
   'E_Too many operands on line'#000+
   'W_NEAR ignored'#000+
   'W_FAR ignored'#000+
-  'E_Duplicate local sym','bol $1'#000+
+  'E_Duplicate local symbol $1'#000+
   'E_Undefined local symbol $1'#000+
   'E_Unknown label identifier $1'#000+
   'E_Invalid floating point register name'#000+
   'E_NOR not supported'#000+
-  'W_Modulo not supported'#000+
+  'W_Modulo not supporte','d'#000+
   'E_Invalid floating point constant $1'#000+
   'E_Invalid floating point expression'#000+
-  'E_Wrong symbol type'#000,
+  'E_Wrong symbol type'#000+
   'E_Cannot index a local var or parameter with a register'#000+
   'E_Invalid segment override expression'#000+
   'W_Identifier $1 supposed external'#000+
-  'E_Strings not allowed as constants'#000+
+  'E_Strings not all','owed as constants'#000+
   'No type of variable specified'#000+
   'E_assembler code not returned to text section'#000+
-  'E','_Not a directive or local symbol $1'#000+
+  'E_Not a directive or local symbol $1'#000+
   'E_Using a defined name as a local label'#000+
   'E_Dollar token is used without an identifier'#000+
-  'W_32bit constant created for address'#000+
+  'W_32bit constant created',' for address'#000+
   'N_.align is target specific, use .balign or .p2align'#000+
-  'E_Can'#039't access fields directl','y for parameters'#000+
+  'E_Can'#039't access fields directly for parameters'#000+
   'E_Can'#039't access fields of objects/classes directly'#000+
   'F_Too many assembler files'#000+
   'F_Selected assembler output not supported'#000+
-  'F_Comp not supported'#000+
+  'F_Comp no','t supported'#000+
   'F_Direct not support for binary writers'#000+
-  'E_Allocating of data is only allowed in bss',' section'#000+
+  'E_Allocating of data is only allowed in bss section'#000+
   'F_No binary writer selected'#000+
   'E_Asm: Opcode $1 not in table'#000+
   'E_Asm: $1 invalid combination of opcode and operands'#000+
-  'E_Asm: 16 Bit references not supported'#000+
+  'E_Asm: 16 Bit references ','not supported'#000+
   'E_Asm: Invalid effective address'#000+
   'E_Asm: Immediate or reference expected'#000+
-  'E_Asm: $1',' value exceeds bounds $2'#000+
+  'E_Asm: $1 value exceeds bounds $2'#000+
   'E_Asm: Short jump is out of range $1'#000+
   'W_Source operating system redefined'#000+
   'I_Assembling (pipe) $1'#000+
-  'E_Can'#039't create assember file $1'#000+
+  'E_Can'#039't create assember ','file $1'#000+
   'W_Assembler $1 not found, switching to external assembling'#000+
   'T_Using assembler: $1'#000+
-  'W_Erro','r while assembling exitcode $1'#000+
+  'W_Error while assembling exitcode $1'#000+
   'W_Can'#039't call the assembler, error $1 switching to external assembl'+
   'ing'#000+
   'I_Assembling $1'#000+
   'I_Assembling smartlink $1'#000+
-  'W_Linker $1 not found, switching to external linking'#000+
+  'W_','Linker $1 not found, switching to external linking'#000+
   'T_Using linker: $1'#000+
-  'W_Object $1 not found, Li','nking may fail !'#000+
+  'W_Object $1 not found, Linking may fail !'#000+
   'W_Library $1 not found, Linking may fail !'#000+
   'W_Error while linking'#000+
   'W_Can'#039't call the linker, switching to external linking'#000+
-  'I_Linking $1'#000+
+  'I_Linkin','g $1'#000+
   'W_binder not found, switching to external binding'#000+
-  'W_ar not found, switching to external ar',#000+
+  'W_ar not found, switching to external ar'#000+
   'E_Dynamic Libraries not supported'#000+
   'I_Closing script $1'#000+
   'W_resource compiler not found, switching to external mode'#000+
   'I_Compiling resource $1'#000+
-  'F_Can'#039't post process executable $1'#000+
+  'F_Can'#039't ','post process executable $1'#000+
   'F_Can'#039't open executable $1'#000+
   'X_Size of Code: $1 bytes'#000+
-  'X_Size of initia','lized data: $1 bytes'#000+
+  'X_Size of initialized data: $1 bytes'#000+
   'X_Size of uninitialized data: $1 bytes'#000+
   'X_Stack space reserved: $1 bytes'#000+
   'X_Stack space commited: $1 bytes'#000+
   'T_Unitsearch: $1'#000+
-  'T_PPU Loading $1'#000+
+  'T_','PPU Loading $1'#000+
   'U_PPU Name: $1'#000+
   'U_PPU Flags: $1'#000+
   'U_PPU Crc: $1'#000+
   'U_PPU Time: $1'#000+
-  'U_PPU File too short',#000+
+  'U_PPU File too short'#000+
   'U_PPU Invalid Header (no PPU at the begin)'#000+
   'U_PPU Invalid Version $1'#000+
   'U_PPU is compiled for an other processor'#000+
-  'U_PPU is compiled for an other target'#000+
+  'U_PPU is compiled for an other targ','et'#000+
   'U_PPU Source: $1'#000+
   'U_Writing $1'#000+
   'F_Can'#039't Write PPU-File'#000+
   'F_reading PPU-File'#000+
-  'F_unexpected end of ','PPU-File'#000+
+  'F_unexpected end of PPU-File'#000+
   'F_Invalid PPU-File entry: $1'#000+
   'F_PPU Dbx count problem'#000+
   'E_Illegal unit name: $1'#000+
   'F_Too much units'#000+
-  'F_Circular unit reference between $1 and $2'#000+
+  'F_Circular unit reference between $1 and $','2'#000+
   'F_Can'#039't compile unit $1, no sources available'#000+
   'F_Can'#039't find unit $1'#000+
-  'W_Compiling the system uni','t requires the -Us switch'#000+
+  'W_Compiling the system unit requires the -Us switch'#000+
   'F_There were $1 errors compiling module, stopping'#000+
   'U_Load from $1 ($2) unit $3'#000+
-  'U_Recompiling $1, checksum changed for $2'#000+
+  'U_Recompiling $1, checksum changed for $2',#000+
   'U_Recompiling $1, source found only'#000+
   'U_Recompiling unit, static lib is older than ppufile'#000+
-  'U_Rec','ompiling unit, shared lib is older than ppufile'#000+
+  'U_Recompiling unit, shared lib is older than ppufile'#000+
   'U_Recompiling unit, obj and asm are older than ppufile'#000+
-  'U_Recompiling unit, obj is older than asm'#000+
+  'U_Recompiling unit, obj is older than asm'#000,
   'U_Parsing interface of $1'#000+
   'U_Parsing implementation of $1'#000+
   'U_Second load for unit $1'#000+
-  'U_PPU Check ','file $1 time $2'#000+
+  'U_PPU Check file $1 time $2'#000+
   '$1 [options] <inputfile> [options]'#000+
   'W_Only one source file supported'#000+
   'W_DEF file can be created only for OS/2'#000+
-  'E_nested response files are not supported'#000+
+  'E_nested response fil','es are not supported'#000+
   'F_No source file name in command line'#000+
   'E_Illegal parameter: $1'#000+
-  'H_-? writes ','help pages'#000+
+  'H_-? writes help pages'#000+
   'F_Too many config files nested'#000+
   'F_Unable to open file $1'#000+
   'N_Reading further options from $1'#000+
   'W_Target is already set to: $1'#000+
-  'W_Shared libs not supported on DOS platform, reverting to static'#000+
+  'W_Shared libs',' not supported on DOS platform, reverting to static'#000+
   'F_too many IF(N)DEFs'#000+
   'F_too many ENDIFs'#000+
-  'F_op','en conditional at the end of the file'#000+
+  'F_open conditional at the end of the file'#000+
   'W_Debug information generation is not supported by this executable'#000+
   'H_Try recompiling with -dGDB'#000+
-  'E_You are using the obsolete switch $1'#000+
+  'E_You are u','sing the obsolete switch $1'#000+
   'E_You are using the obsolete switch $1, please use $2'#000+
-  'N_Switching a','ssembler to default source writing assembler'#000+
+  'N_Switching assembler to default source writing assembler'#000+
   'Free Pascal Compiler version $FPCVER [$FPCDATE] for $FPCTARGET'#000+
-  'Copyright (c) 1993-98 by Florian Klaempfl'#000+
+  'Copyright (c) 1993-98 by Florian Klae','mpfl'#000+
   'Free Pascal Compiler version $FPCVER'#000+
   #000+
   'Compiler Date  : $FPCDATE'#000+
-  'Compiler Target: $FPCTARGE','T'#000+
+  'Compiler Target: $FPCTARGET'#000+
   #000+
   'This program comes under the GNU General Public Licence'#000+
   'For more information read COPYING.FPC'#000+
   #000+
   'Report bugs,suggestions etc to:'#000+
-  '                 [email protected]'#000+
-  '**0*_put + after a boolean switch option to enable it, - to',' disable '+
-  'it'#000+
+  '               ','  [email protected]'#000+
+  '**0*_put + after a boolean switch option to enable it, - to disable it'+
+  #000+
   '**1a_the compiler doesn'#039't delete the generated assembler file'#000+
   '**2al_list sourcecode lines in assembler file'#000+
-  '**2ar_list register allocation/release info in assembler file'#000+
-  '**2at_list temp allocation/release info in assembler file'#000,
+  '**2ar_list register alloc','ation/release info in assembler file'#000+
+  '**2at_list temp allocation/release info in assembler file'#000+
   '**1b_generate browser info'#000+
   '**2bl_generate local symbol info'#000+
   '**1B_build all modules'#000+
   '**1C<x>_code generation options:'#000+
-  '3*2CD_create dynamic library'#000+
+  '3*2CD_create dynamic library'#000,
   '**2Ch<n>_<n> bytes heap (between 1023 and 67107840)'#000+
   '**2Ci_IO-checking'#000+
-  '**2Cn_omit linking stage'#000,
+  '**2Cn_omit linking stage'#000+
   '**2Co_check overflow of integer operations'#000+
   '**2Cr_range checking'#000+
   '**2Cs<n>_set stack size to <n>'#000+
   '**2Ct_stack checking'#000+
   '3*2CS_create static library'#000+
-  '3*2Cx_use smartlinking'#000+
+  '3','*2Cx_use smartlinking'#000+
   '**1d<x>_defines the symbol <x>'#000+
   '*O1D_generate a DEF file'#000+
-  '*O2Dd<x>_set desc','ription to <x>'#000+
+  '*O2Dd<x>_set description to <x>'#000+
   '*O2Dw_PM application'#000+
   '**1e<x>_set path to executable'#000+
   '**1E_same as -Cn'#000+
   '**1F<x>_set file names and paths:'#000+
-  '**2FD<x>_sets the directory where to search for compiler utilities'#000+
+  '**2FD<x>_sets the directory',' where to search for compiler utilities'#000+
   '**2Fe<x>_redirect error output to <x>'#000+
-  '**2FE<x>_set exe/','unit output path to <x>'#000+
+  '**2FE<x>_set exe/unit output path to <x>'#000+
   '**2Fi<x>_adds <x> to include path'#000+
   '**2Fl<x>_adds <x> to library path'#000+
   '*L2FL<x>_uses <x> as dynamic linker'#000+
-  '**2Fo<x>_adds <x> to object path'#000+
+  '**2Fo<x>_adds <x>',' to object path'#000+
   '**2Fr<x>_load error message file <x>'#000+
   '**2Fu<x>_adds <x> to unit path'#000+
-  '**2FU<x>_se','t unit output path to <x>, overrides -FE'#000+
+  '**2FU<x>_set unit output path to <x>, overrides -FE'#000+
   '*g1g<x>_generate debugger information:'#000+
   '*g2gg_use gsym'#000+
   '*g2gd_use dbx'#000+
   '*g2gh_use heap trace unit'#000+
-  '*g2gc_generate checks for pointers'#000+
+  '*g2gc_gene','rate checks for pointers'#000+
   '**1i_information'#000+
   '**2iD_return compiler date'#000+
-  '**2iV_return compiler vers','ion'#000+
+  '**2iV_return compiler version'#000+
   '**2iSO_return compiler OS'#000+
   '**2iSP_return compiler processor'#000+
   '**2iTO_return target OS'#000+
   '**2iTP_return target processor'#000+
-  '**1I<x>_adds <x> to include path'#000+
+  '**1I<x>_adds <x> to include',' path'#000+
   '**1k<x>_Pass <x> to the linker'#000+
   '**1l_write logo'#000+
   '**1n_don'#039't read the default config file'#000+
-  '**','1o<x>_change the name of the executable produced to <x>'#000+
+  '**1o<x>_change the name of the executable produced to <x>'#000+
   '**1pg_generate profile code for gprof'#000+
-  '*L1P_use pipes instead of creating temporary assembler files'#000+
+  '*L1P_use pipes instead of creating temporary assemb','ler files'#000+
   '**1S<x>_syntax options:'#000+
   '**2S2_switch some Delphi 2 extensions on'#000+
-  '**2Sc_supports opera','tors like C (*=,+=,/= and -=)'#000+
+  '**2Sc_supports operators like C (*=,+=,/= and -=)'#000+
   '**2Sd_tries to be Delphi compatible'#000+
   '**2Se<x>_compiler stops after the <x> errors (default is 1)'#000+
-  '**2Sg_allow LABEL and GOTO'#000+
+  '**2Sg_allow LABEL a','nd GOTO'#000+
   '**2Sh_Use ansistrings'#000+
   '**2Si_support C++ styled INLINE'#000+
-  '**2Sm_support macros like C (glob','al)'#000+
+  '**2Sm_support macros like C (global)'#000+
   '**2So_tries to be TP/BP 7.0 compatible'#000+
   '**2Sp_tries to be gpc compatible'#000+
   '**2Ss_constructor name must be init (destructor must be done)'#000+
-  '**2St_allow static keyword in objects'#000+
+  '**2St_a','llow static keyword in objects'#000+
   '**1s_don'#039't call assembler and linker (only with -a)'#000+
-  '**1u<x>_unde','fines the symbol <x>'#000+
+  '**1u<x>_undefines the symbol <x>'#000+
   '**1U_unit options:'#000+
   '**2Un_don'#039't check the unit name'#000+
   '**2Us_compile a system unit'#000+
-  '**1v<x>_Be verbose. <x> is a combination of the following letters:'#000+
+  '**1v<x>_Be verbose. <x> is a combination of t','he following letters:'#000+
   '**2*_e : Show errors (default)       d : Show debug info'#000+
-  '**2*_w : Show wa','rnings               u : Show unit info'#000+
+  '**2*_w : Show warnings               u : Show unit info'#000+
   '**2*_n : Show notes                  t : Show tried/used files'#000+
-  '**2*_h : Show hints                  m : Show defined macros'#000+
+  '**2*_h : Show hints                  m : S','how defined macros'#000+
   '**2*_i : Show general info           p : Show compiled procedures'#000+
-  '**2*_l : S','how linenumbers            c : Show conditionals'#000+
+  '**2*_l : Show linenumbers            c : Show conditionals'#000+
   '**2*_a : Show everything             0 : Show nothing (except errors)'#000+
-  '**2*_b : Show all procedure          r : Rhide/GCC compatibility mode'#000+
-  '**2*_    declarations if an error    x : Executable',' info (Win32 only'+
-  ')'#000+
+  '**2*_b : Show all procedur','e          r : Rhide/GCC compatibility mod'+
+  'e'#000+
+  '**2*_    declarations if an error    x : Executable info (Win32 only)'#000+
   '**2*_    occurs'#000+
   '**1X_executable options:'#000+
   '*L2Xc_link with the c library'#000+
-  '**2XD_link with dynamic libraries (defines FPC_LINK_DYNAMIC)'#000+
+  '**2XD_link with dynamic libraries (defines FPC_LINK_DYN','AMIC)'#000+
   '**2Xs_strip all symbols from executable'#000+
-  '**2XS_link with static libraries (defines FPC_LIN','K_STATIC)'#000+
+  '**2XS_link with static libraries (defines FPC_LINK_STATIC)'#000+
   '**0*_Processor specific options:'#000+
   '3*1A<x>_output format:'#000+
   '3*2Aas_assemble using GNU AS'#000+
-  '3*2Aasaout_assemble using GNU AS for aout (Go32v1)'#000+
+  '3*2Aasaout_assemble using GNU AS for aout (Go32v1)',#000+
   '3*2Anasmcoff_coff (Go32v2) file using Nasm'#000+
   '3*2Anasmelf_elf32 (Linux) file using Nasm'#000+
-  '3*2Anasmo','bj_obj file using Nasm'#000+
+  '3*2Anasmobj_obj file using Nasm'#000+
   '3*2Amasm_obj file using Masm (Microsoft)'#000+
   '3*2Atasm_obj file using Tasm (Borland)'#000+
-  '3*2Acoff_coff (Go32v2) using internal writer'#000+
+  '3*2Acoff_coff (Go32v2) using internal writ','er'#000+
   '3*2Apecoff_pecoff (Win32) using internal writer'#000+
   '3*1R<x>_assembler reading style:'#000+
-  '3*2Ratt_rea','d AT&T style assembler'#000+
+  '3*2Ratt_read AT&T style assembler'#000+
   '3*2Rintel_read Intel style assembler'#000+
   '3*2Rdirect_copy assembler text directly to assembler file'#000+
   '3*1O<x>_optimizations:'#000+
-  '3*2Og_generate smaller code'#000+
+  '3*2O','g_generate smaller code'#000+
   '3*2OG_generate faster code (default)'#000+
-  '3*2Or_keep certain variables in re','gisters (still BUGGY!!!)'#000+
+  '3*2Or_keep certain variables in registers (still BUGGY!!!)'#000+
   '3*2Ou_enable uncertain optimizations (see docs)'#000+
   '3*2O1_level 1 optimizations (quick optimizations)'#000+
-  '3*2O2_level 2 optimizations (-O1 + slower optimizations)'#000+
+  '3*2O2_level 2 optimiza','tions (-O1 + slower optimizations)'#000+
   '3*2O3_level 3 optimizations (same as -O2u)'#000+
-  '3*2Op<x>_target p','rocessor:'#000+
+  '3*2Op<x>_target processor:'#000+
   '3*3Op1_set target processor to 386/486'#000+
   '3*3Op2_set target processor to Pentium/PentiumMMX (tm)'#000+
-  '3*3Op3_set target processor to PPro/PII/c6x86/K6 (tm)'#000+
+  '3*3Op3_set target processor to PPro/PII/c','6x86/K6 (tm)'#000+
   '3*1T<x>_Target operating system:'#000+
   '3*2TGO32V1_version 1 of DJ Delorie DOS extender'#000+
-  '3','*2TGO32V2_version 2 of DJ Delorie DOS extender'#000+
+  '3*2TGO32V2_version 2 of DJ Delorie DOS extender'#000+
   '3*2TLINUX_Linux'#000+
   '3*2TOS2_OS/2 2.x'#000+
   '3*2TWin32_Windows 32 Bit'#000+
   '6*1A<x>_output format'#000+
-  '6*2Aas_Unix o-file using GNU AS'#000+
+  '6*2Aas_Unix o-file',' using GNU AS'#000+
   '6*2Agas_GNU Motorola assembler'#000+
   '6*2Amit_MIT Syntax (old GAS)'#000+
-  '6*2Amot_Standard Moto','rola assembler'#000+
+  '6*2Amot_Standard Motorola assembler'#000+
   '6*1O_optimizations:'#000+
   '6*2Oa_turn on the optimizer'#000+
   '6*2Og_generate smaller code'#000+
   '6*2OG_generate faster code (default)'#000+
-  '6*2Ox_optimize maximum (still BUGGY!!!)'#000+
+  '6*2Ox_optimize ma','ximum (still BUGGY!!!)'#000+
   '6*2O2_set target processor to a MC68020+'#000+
-  '6*1R<x>_assembler reading style',':'#000+
+  '6*1R<x>_assembler reading style:'#000+
   '6*2RMOT_read motorola style assembler'#000+
   '6*1T<x>_Target operating system:'#000+
   '6*2TAMIGA_Commodore Amiga'#000+
   '6*2TATARI_Atari ST/STe/TT'#000+
-  '6*2TMACOS_Macintosh m68k'#000+
+  '6*2TMACOS_Macintosh ','m68k'#000+
   '6*2TLINUX_Linux-68k'#000+
   '**1*_'#000+
   '**1?_shows this help'#000+

+ 33 - 1
compiler/new/README

@@ -27,4 +27,36 @@ Intel specific
 --------------
 unusedregssse
 availabletempregssse
-countusableregssse
+countusableregssse
+
+Jonas Maebe schrieb:
+> 
+> Hello,
+> 
+> Is there any difference between the localsize parameter of
+> g_stackframe_entry and the parasize parameter of g_return_from_proc, or
+> are they both the same value?
+
+They are different, I think the value of g_return_from_proc doesn't matter
+for the PowerPC. It's the size of parameters passed on the stack
+and only important for the i386/m68k probably.
+
+> 
+> And for the PowerPC, what will they contain? Just the size of the local
+> variables and parameters, or also the maximum needed size for parameters
+> of any procedure called by the current one (the caller must reserve space
+> for the callee's parameters on it's own stack because you can't push
+> values on the stack in the middle of a procedure (no frame pointer))
+> 
+> Jonas
+
+the parameter passed to g_stackframe_entry contains the size of the all local space which is
+needed
+except
+that one for saving registers: the set procinfo.registerstosave (not yet implemented,
+I'll commit it soon) will contain
+all registers which must be saved by the entry and restored by the exit code of a procedure
+and you have to add extra space to do that.
+
+
+

+ 9 - 1
compiler/new/cgbase.pas

@@ -79,6 +79,10 @@ unit cgbase;
           { parameter offset }
           call_offset : longint;
 
+          { every register which must be saved by the entry code }
+          { (and restored by the exit code) must be in that set  }
+          registerstosave : tregisterset;
+
           { some collected informations about the procedure }
           { see pi_xxxx above                               }
           flags : longint;
@@ -421,7 +425,11 @@ unit cgbase;
 end.
 {
   $Log$
-  Revision 1.8  1999-08-06 13:26:49  florian
+  Revision 1.9  1999-09-10 18:48:11  florian
+    * some bug fixes (e.g. must_be_valid and procinfo.funcret_is_valid)
+    * most things for stored properties fixed
+
+  Revision 1.8  1999/08/06 13:26:49  florian
     * more changes ...
 
   Revision 1.7  1999/08/05 14:58:10  florian

+ 9 - 7
compiler/new/i386/cgcpu.pas

@@ -25,9 +25,7 @@ unit cgcpu;
   interface
 
     uses
-       cgobj,aasm
-{$i cpuunit.inc}
-       ;
+       cgobj,aasm,cpuinfo,cpubase;
 
     type
        pcg386 = ^tcg386;
@@ -44,14 +42,14 @@ unit cgcpu;
 
           procedure g_stackframe_entry(list : paasmoutput;localsize : longint);virtual;
           procedure g_restore_frame_pointer(list : paasmoutput);virtual;
-          procedure tcg386.g_ret_from_proc(list : paasmoutput;para size : aword);
+          procedure g_ret_from_proc(list : paasmoutput;parasize : aword);
           constructor init;
        end;
 
   implementation
 
     uses
-       globtype,globals;
+       globtype,globals,cpuasm,symconst,symtable,cgbase,verbose;
 
     constructor tcg386.init;
 
@@ -124,7 +122,7 @@ unit cgcpu;
           list^.concat(new(paicpu,op_none(A_LEAVE,S_NO)));
        end;
 
-     procedure tcg386.g_ret_from_proc(list : paasmoutput;para size : aword);
+     procedure tcg386.g_ret_from_proc(list : paasmoutput;parasize : aword);
 
        begin
           { parameters are limited to 65535 bytes because }
@@ -142,7 +140,11 @@ unit cgcpu;
 end.
 {
   $Log$
-  Revision 1.5  1999-08-25 12:00:21  jonas
+  Revision 1.6  1999-09-10 18:48:11  florian
+    * some bug fixes (e.g. must_be_valid and procinfo.funcret_is_valid)
+    * most things for stored properties fixed
+
+  Revision 1.5  1999/08/25 12:00:21  jonas
     * changed pai386, paippc and paiapha (same for tai*) to paicpu (taicpu)
 
   Revision 1.4  1999/08/06 14:15:56  florian

+ 7 - 7
compiler/new/i386/tgcpu.pas

@@ -25,12 +25,8 @@ unit tgcpu;
   interface
 
     uses
-       cobjects,globals,tree,hcodegen,verbose,files,aasm
-       ,i386base,i386asm,tgobj
-{$ifdef dummy}
-       end
-{$endif}
-       ;
+       cobjects,globals,tree,hcodegen,verbose,files,
+       aasm,cpubase,cpuasm,tgobj;
 
     const
        countusablereg : byte = 4;
@@ -72,7 +68,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.3  1999-08-03 17:09:50  florian
+  Revision 1.4  1999-09-10 18:48:11  florian
+    * some bug fixes (e.g. must_be_valid and procinfo.funcret_is_valid)
+    * most things for stored properties fixed
+
+  Revision 1.3  1999/08/03 17:09:50  florian
     * the alpha compiler can be compiled now
 
   Revision 1.2  1999/08/02 23:13:24  florian

+ 8 - 4
compiler/new/tainst.pas

@@ -44,8 +44,8 @@ tainstruction = object(tai)
   ops       : longint;
   oper      : array[0..max_operands-1] of toper;
 {$ifdef i386}
-  segprefix: tregister;
-{$endif i386}
+  segprefix : tregister;
+{$endif}           
   Constructor init(op : tasmop);
   Destructor Done;virtual;
   function getcopy:plinkedlist_item;virtual;
@@ -246,7 +246,11 @@ end.
 
 {
   $Log$
-  Revision 1.4  1999-09-03 13:10:11  jonas
+  Revision 1.5  1999-09-10 18:48:11  florian
+    * some bug fixes (e.g. must_be_valid and procinfo.funcret_is_valid)
+    * most things for stored properties fixed
+
+  Revision 1.4  1999/09/03 13:10:11  jonas
     * condition is now zeroed using fillchar\n    because on powerpc it's a record now
 
   Revision 1.3  1999/08/26 14:52:59  jonas
@@ -259,4 +263,4 @@ end.
   Revision 1.1  1999/08/06 16:04:05  michael
   + introduced tainstruction
 
-}
+}

+ 6 - 6
compiler/new/tgobj.pas

@@ -26,15 +26,11 @@ unit tgobj;
   interface
 
     uses
-{$ifdef i386}
-      i386base,i386asm,
-{$else i386}
       cpubase,
       cpuinfo,
       cpuasm,
       tainst,
-{$endif i386}
-       cobjects,globals,tree,hcodegen,verbose,files,aasm;
+      cobjects,globals,tree,hcodegen,verbose,files,aasm;
 
     type
        tregisterset = set of tregister;
@@ -696,7 +692,11 @@ unit tgobj;
 end.
 {
   $Log$
-  Revision 1.5  1999-08-06 16:04:06  michael
+  Revision 1.6  1999-09-10 18:48:11  florian
+    * some bug fixes (e.g. must_be_valid and procinfo.funcret_is_valid)
+    * most things for stored properties fixed
+
+  Revision 1.5  1999/08/06 16:04:06  michael
   + introduced tainstruction
 
   Revision 1.4  1999/08/03 00:33:23  michael

+ 100 - 4
compiler/pdecl.pas

@@ -879,6 +879,20 @@ unit pdecl;
              get_procdef:=p;
           end;
 
+          procedure deletepropsymlist(p : ppropsymlist);
+
+            var
+               hp : ppropsymlist;
+
+            begin
+               while assigned(p) do
+                 begin
+                    hp:=p;
+                    p:=p^.next;
+                    dispose(hp);
+                 end;
+            end;
+
           procedure addpropsymlist(var root:ppropsymlist;s:psym);
           var
             last,hp : ppropsymlist;
@@ -1076,6 +1090,9 @@ unit pdecl;
 
                 if (idtoken=_READ) then
                   begin
+                     if assigned(p^.readaccesssym) then
+                       deletepropsymlist(p^.readaccesssym);
+                     p^.readaccesssym:=nil;
                      consume(_READ);
                      sym:=search_class_member(aktclass,pattern);
                      if not(assigned(sym)) then
@@ -1133,6 +1150,9 @@ unit pdecl;
                   end;
                 if (idtoken=_WRITE) then
                   begin
+                     if assigned(p^.writeaccesssym) then
+                       deletepropsymlist(p^.writeaccesssym);
+                     p^.writeaccesssym:=nil;
                      consume(_WRITE);
                      sym:=search_class_member(aktclass,pattern);
                      if not(assigned(sym)) then
@@ -1189,9 +1209,81 @@ unit pdecl;
                 if (idtoken=_STORED) then
                   begin
                      consume(_STORED);
-                     Message(parser_w_stored_not_implemented);
-                     comp_expr(true);
-                     { !!!!!!!! }
+                     if assigned(p^.storedsym) then
+                       deletepropsymlist(p^.storedsym);
+                     p^.storedsym:=nil;
+                     case token of
+                        _ID:
+                           if idtoken=_DEFAULT then
+                             begin
+                                include(p^.propoptions,ppo_defaultproperty);
+                                p^.storeddef:=booldef;
+                             end
+                           else
+                             begin
+                                sym:=search_class_member(aktclass,pattern);
+                                if not(assigned(sym)) then
+                                  begin
+                                    Message1(sym_e_unknown_id,pattern);
+                                    consume(_ID);
+                                  end
+                                else
+                                  begin
+                                     consume(_ID);
+                                     while (token=_POINT) and
+                                           ((sym^.typ=varsym) and
+                                            (pvarsym(sym)^.definition^.deftype=recorddef)) do
+                                      begin
+                                        addpropsymlist(p^.storedsym,sym);
+                                        consume(_POINT);
+                                        getsymonlyin(precorddef(pvarsym(sym)^.definition)^.symtable,pattern);
+                                        if not assigned(srsym) then
+                                          Message1(sym_e_illegal_field,pattern);
+                                        sym:=srsym;
+                                        consume(_ID);
+                                      end;
+                                  end;
+
+                                if assigned(sym) then
+                                  begin
+                                     if ((sym^.typ=varsym) and
+                                        assigned(propertyparas)) or
+                                        not(sym^.typ in [varsym,procsym]) then
+                                       Message(parser_e_ill_property_storage_sym);
+                                     { search the matching definition }
+                                     if sym^.typ=procsym then
+                                       begin
+                                          { insert data entry to check access method }
+                                          datacoll^.next:=propertyparas;
+                                          propertyparas:=datacoll;
+                                          pp:=get_procdef;
+                                          { ... and remove it }
+                                          propertyparas:=propertyparas^.next;
+                                          datacoll^.next:=nil;
+                                          if not(assigned(pp)) then
+                                            Message(parser_e_ill_property_storage_sym);
+                                          p^.storeddef:=pp;
+                                       end
+                                     else if sym^.typ=varsym then
+                                       begin
+                                          if not(is_equal(pvarsym(sym)^.definition,
+                                            booldef)) then
+                                            Message(parser_e_stored_property_must_be_boolean);
+                                       end;
+                                     addpropsymlist(p^.storedsym,sym);
+                                  end;
+                             end;
+                        _FALSE:
+                          begin
+                             exclude(p^.propoptions,ppo_defaultproperty);
+                             p^.storeddef:=nil;
+                          end;
+                        _TRUE:
+                          begin
+                             include(p^.propoptions,ppo_defaultproperty);
+                             p^.storeddef:=booldef;
+                          end;
+                     end;
                   end;
                 if (idtoken=_DEFAULT) then
                   begin
@@ -2432,7 +2524,11 @@ unit pdecl;
 end.
 {
   $Log$
-  Revision 1.148  1999-09-08 21:06:06  michael
+  Revision 1.149  1999-09-10 18:48:07  florian
+    * some bug fixes (e.g. must_be_valid and procinfo.funcret_is_valid)
+    * most things for stored properties fixed
+
+  Revision 1.148  1999/09/08 21:06:06  michael
   * Stored specifier for properties is now correctly parsed
 
   Revision 1.147  1999/09/02 09:23:51  peter

+ 10 - 2
compiler/pexpr.pas

@@ -526,6 +526,7 @@ unit pexpr;
       var
          prev_in_args : boolean;
          prevafterassn : boolean;
+         Store_valid : boolean;
       begin
          prev_in_args:=in_args;
          prevafterassn:=afterassignment;
@@ -544,8 +545,11 @@ unit pexpr;
               else p1^.left:=nil;
 
               { do firstpass because we need the  }
-              { result type                    }
+              { result type                       }
+              Store_valid:=Must_be_valid;
+              Must_be_valid:=false;
               do_firstpass(p1);
+              Must_be_valid:=Store_valid;
            end
          else
            begin
@@ -2089,7 +2093,11 @@ _LECKKLAMMER : begin
 end.
 {
   $Log$
-  Revision 1.138  1999-09-07 08:01:20  peter
+  Revision 1.139  1999-09-10 18:48:07  florian
+    * some bug fixes (e.g. must_be_valid and procinfo.funcret_is_valid)
+    * most things for stored properties fixed
+
+  Revision 1.138  1999/09/07 08:01:20  peter
     * @(<x>) support
 
   Revision 1.137  1999/09/01 22:08:58  peter

+ 6 - 2
compiler/pp.pas

@@ -176,7 +176,6 @@ uses
         {$O gdb}
   {$endif gdb}
   {$ifdef i386}
-        {$O opts386}
         {$O cpubase}
         {$O cgai386}
         {$O tgeni386}
@@ -191,6 +190,7 @@ uses
         {$O cg386set}
         {$ifndef NOOPT}
           {$O aopt386}
+          {$O opts386}
         {$endif}
         {$IfNDef Nora386dir}
           {$O ra386dir}
@@ -280,7 +280,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.47  1999-09-02 18:47:45  daniel
+  Revision 1.48  1999-09-10 18:48:08  florian
+    * some bug fixes (e.g. must_be_valid and procinfo.funcret_is_valid)
+    * most things for stored properties fixed
+
+  Revision 1.47  1999/09/02 18:47:45  daniel
     * Could not compile with TP, some arrays moved to heap
     * NOAG386BIN default for TP
     * AG386* files were not compatible with TP, fixed.

+ 7 - 2
compiler/ppu.pas

@@ -348,7 +348,8 @@ end;
 destructor tppufile.done;
 begin
   close;
-  freemem(buf,ppubufsize);
+  if assigned(buf) then
+    freemem(buf,ppubufsize);
 end;
 
 
@@ -986,7 +987,11 @@ end;
 end.
 {
   $Log$
-  Revision 1.42  1999-08-31 15:47:56  pierre
+  Revision 1.43  1999-09-10 18:48:09  florian
+    * some bug fixes (e.g. must_be_valid and procinfo.funcret_is_valid)
+    * most things for stored properties fixed
+
+  Revision 1.42  1999/08/31 15:47:56  pierre
    + startup conditionnals stored in PPU file for debug info
 
   Revision 1.41  1999/08/30 16:21:40  pierre

+ 8 - 2
compiler/pstatmnt.pas

@@ -691,9 +691,11 @@ unit pstatmnt;
               if in_except_block then
                 Message(parser_e_exit_with_argument_not__possible);
               if procinfo.retdef=pdef(voiddef) then
-                Message(parser_e_void_function)
+                Message(parser_e_void_function);
+              {
               else
                 procinfo.funcret_is_valid:=true;
+              }
            end
          else
            p:=nil;
@@ -1315,7 +1317,11 @@ unit pstatmnt;
 end.
 {
   $Log$
-  Revision 1.100  1999-09-07 14:12:36  jonas
+  Revision 1.101  1999-09-10 18:48:09  florian
+    * some bug fixes (e.g. must_be_valid and procinfo.funcret_is_valid)
+    * most things for stored properties fixed
+
+  Revision 1.100  1999/09/07 14:12:36  jonas
     * framepointer cannot be changed to esp for methods
 
   Revision 1.99  1999/08/26 21:10:08  peter

+ 6 - 2
compiler/psub.pas

@@ -60,8 +60,8 @@ uses
   ,gdb
 {$endif GDB}
 {$ifdef i386}
-  ,tgeni386
 {$ifndef newcg}
+  ,tgeni386
   ,cgai386
 {$endif newcg}
   {$ifndef NoOpt}
@@ -2053,7 +2053,11 @@ end.
 
 {
   $Log$
-  Revision 1.19  1999-09-07 14:59:40  pierre
+  Revision 1.20  1999-09-10 18:48:09  florian
+    * some bug fixes (e.g. must_be_valid and procinfo.funcret_is_valid)
+    * most things for stored properties fixed
+
+  Revision 1.19  1999/09/07 14:59:40  pierre
    * bugfix for 237 and 244
 
   Revision 1.18  1999/09/02 18:47:45  daniel

+ 18 - 4
compiler/symdef.inc

@@ -3540,8 +3540,12 @@ Const local_symtable_index : longint = $8001;
          proctypesinfo : byte;
 
       procedure writeproc(sym : ppropsymlist;def : pdef;shiftvalue : byte);
+
         var
            typvalue : byte;
+           hp : ppropsymlist;
+           address : longint;
+
         begin
            if not(assigned(sym) and assigned(sym^.sym))  then
              begin
@@ -3550,8 +3554,14 @@ Const local_symtable_index : longint = $8001;
              end
            else if sym^.sym^.typ=varsym then
              begin
-                rttilist^.concat(new(pai_const,init_32bit(
-                  pvarsym(sym^.sym)^.address)));
+                address:=0;
+                hp:=sym;
+                while assigned(hp) do
+                  begin
+                     inc(address,pvarsym(hp^.sym)^.address);
+                     hp:=hp^.next;
+                  end;
+                rttilist^.concat(new(pai_const,init_32bit(address)));
                 typvalue:=0;
              end
            else
@@ -3588,7 +3598,7 @@ Const local_symtable_index : longint = $8001;
               { isn't it stored ? }
               if not(ppo_stored in ppropertysym(sym)^.propoptions) then
                 begin
-                   rttilist^.concat(new(pai_const,init_32bit(1)));
+                   rttilist^.concat(new(pai_const,init_32bit(0)));
                    proctypesinfo:=proctypesinfo or (3 shl 4);
                 end
               else
@@ -3737,7 +3747,11 @@ Const local_symtable_index : longint = $8001;
 
 {
   $Log$
-  Revision 1.160  1999-09-02 17:07:40  florian
+  Revision 1.161  1999-09-10 18:48:09  florian
+    * some bug fixes (e.g. must_be_valid and procinfo.funcret_is_valid)
+    * most things for stored properties fixed
+
+  Revision 1.160  1999/09/02 17:07:40  florian
     * problems with -Or fixed: tdef.isfpuregable was wrong!
 
   Revision 1.159  1999/08/27 10:52:19  pierre

+ 19 - 1
compiler/symtable.pas

@@ -1532,6 +1532,20 @@ implementation
                  (hsym^.owner^.defowner^.owner^.symtabletype<>unitsymtable)) then
                 DuplicateSym(hsym);
            end;
+         { check for duplicate id in para symtable of methods }
+         if (symtabletype=parasymtable) and
+           assigned(next) and
+          { funcretsym is allowed !! }
+           (sym^.typ <> funcretsym) and
+           (next^.symtabletype=objectsymtable) then
+           begin
+              hsym:=search_class_member(pobjectdef(next^.defowner),sym^.name);
+              { but private ids can be reused }
+              if assigned(hsym) and
+                (not(sp_private in hsym^.symoptions) or
+                 (hsym^.owner^.defowner^.owner^.symtabletype<>unitsymtable)) then
+                DuplicateSym(hsym);
+           end;
          { check for duplicate field id in inherited classes }
          if (sym^.typ=varsym) and
             (symtabletype=objectsymtable) and
@@ -2392,7 +2406,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.45  1999-09-08 08:05:44  peter
+  Revision 1.46  1999-09-10 18:48:10  florian
+    * some bug fixes (e.g. must_be_valid and procinfo.funcret_is_valid)
+    * most things for stored properties fixed
+
+  Revision 1.45  1999/09/08 08:05:44  peter
     * fixed bug 248
 
   Revision 1.44  1999/08/31 15:46:21  pierre

+ 13 - 5
compiler/tccal.pas

@@ -526,11 +526,14 @@ implementation
                 begin
                    old_count_ref:=count_ref;
                    count_ref:=false;
+                   { must be valid is already false!
                    store_valid:=must_be_valid;
-                   must_be_valid:=false;
+                   must_be_valid:=false; }
                    firstcallparan(p^.left,nil);
                    count_ref:=old_count_ref;
+                   {
                    must_be_valid:=store_valid;
+                   }
                    if codegenerror then
                      goto errorexit;
                 end;
@@ -1121,7 +1124,7 @@ implementation
                      end
                 end;
            end;
-
+         must_be_valid:=store_valid;
          { a fpu can be used in any procedure !! }
          p^.registersfpu:=p^.procdefinition^.fpu_used;
          { if this is a call to a method calc the registers }
@@ -1149,9 +1152,11 @@ implementation
                      if (p^.procdefinition^.proctypeoption=potype_constructor) or
                         ((p^.methodpointer^.treetype=loadn) and
                         (not(oo_has_virtual in pobjectdef(p^.methodpointer^.resulttype)^.objectoptions))) then
-                       must_be_valid:=false
+                       must_be_valid:=false;
+                     {
                      else
                        must_be_valid:=true;
+                     }
                      firstpass(p^.methodpointer);
                      p^.registersfpu:=max(p^.methodpointer^.registersfpu,p^.registersfpu);
                      p^.registers32:=max(p^.methodpointer^.registers32,p^.registers32);
@@ -1194,7 +1199,6 @@ implementation
            p^.procdefinition^.proccalloptions:=p^.procdefinition^.proccalloptions+[pocall_inline];
 {$endif}
          aktcallprocsym:=oldcallprocsym;
-         must_be_valid:=store_valid;
       end;
 
 
@@ -1213,7 +1217,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.62  1999-08-23 23:42:52  pierre
+  Revision 1.63  1999-09-10 18:48:11  florian
+    * some bug fixes (e.g. must_be_valid and procinfo.funcret_is_valid)
+    * most things for stored properties fixed
+
+  Revision 1.62  1999/08/23 23:42:52  pierre
    * hnewn reg allocation corrected
 
   Revision 1.61  1999/08/17 13:26:08  peter

+ 10 - 1
compiler/tcld.pas

@@ -219,6 +219,9 @@ implementation
          { must be made unique }
          set_unique(p^.left);
 
+         { set we the function result? }
+         set_funcret_is_valid(p^.left);
+
          firstpass(p^.left);
          if codegenerror then
            exit;
@@ -341,8 +344,10 @@ implementation
             (@procinfo=pprocinfo(p^.funcretprocinfo)) and
             not procinfo.funcret_is_valid then
            CGMessage(sym_w_function_result_not_set);
+         {
          if count_ref then
            pprocinfo(p^.funcretprocinfo)^.funcret_is_valid:=true;
+         }
       end;
 
 
@@ -491,7 +496,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.41  1999-08-16 23:23:41  peter
+  Revision 1.42  1999-09-10 18:48:11  florian
+    * some bug fixes (e.g. must_be_valid and procinfo.funcret_is_valid)
+    * most things for stored properties fixed
+
+  Revision 1.41  1999/08/16 23:23:41  peter
     * arrayconstructor -> openarray type conversions for element types
 
   Revision 1.40  1999/08/13 21:33:17  peter

+ 24 - 7
compiler/tree.pas

@@ -20,7 +20,6 @@
 
  ****************************************************************************
 }
-
 {$ifdef tp}
   {$E+,N+}
 {$endif}
@@ -298,6 +297,9 @@ unit tree;
     { takes care of type casts etc.                 }
     procedure set_unique(p : ptree);
 
+    { sets funcret_is_valid to true, if p contains a funcref node }
+    procedure set_funcret_is_valid(p : ptree);
+
     { gibt den ordinalen Werten der Node zurueck oder falls sie }
     { keinen ordinalen Wert hat, wird ein Fehler erzeugt        }
     function get_ordinal_value(p : ptree) : longint;
@@ -332,7 +334,7 @@ unit tree;
 
     uses
        systems,
-       globals,verbose,files,types;
+       globals,verbose,files,types,hcodegen;
 
 
     function getnode : ptree;
@@ -1604,12 +1606,26 @@ unit tree;
               case p^.treetype of
                  vecn:
                     p^.callunique:=true;
-                 typeconvn:
+                 typeconvn,subscriptn,derefn:
                     set_unique(p^.left);
               end;
            end;
       end;
 
+    procedure set_funcret_is_valid(p : ptree);
+
+      begin
+         if assigned(p) then
+           begin
+              case p^.treetype of
+                 funcretn:
+                    procinfo.funcret_is_valid:=true;
+                 vecn,typeconvn,subscriptn,derefn:
+                    set_funcret_is_valid(p^.left);
+              end;
+           end;
+      end;
+
     procedure clear_location(var loc : tlocation);
 
       begin
@@ -1746,13 +1762,14 @@ unit tree;
          case_get_min:=hp^._low;
       end;
 
-
-
-
 end.
 {
   $Log$
-  Revision 1.94  1999-09-07 07:52:20  peter
+  Revision 1.95  1999-09-10 18:48:11  florian
+    * some bug fixes (e.g. must_be_valid and procinfo.funcret_is_valid)
+    * most things for stored properties fixed
+
+  Revision 1.94  1999/09/07 07:52:20  peter
     * > < >= <= support for boolean
     * boolean constants are now calculated like integer constants