* better error recovering in typed constants

* some problems with arrays of const fixed, some problems
    due my previous
     - the location type of array constructor is now LOC_MEM
     - the pushing of high fixed
     - parameter copying fixed
     - zero temp. allocation removed
  * small problem in the assembler writers fixed:
    ref to nil wasn't written correctly
This commit is contained in:
florian 1999-05-23 18:41:55 +00:00
parent f664777328
commit 6b33f4d87d
17 changed files with 7284 additions and 7073 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -589,7 +589,7 @@ const msgtxt : array[0..000095,1..240] of char=(
'3*2Anasmcoff_coff file using Nasm'#000+
'3*2Anasmelf_elf32 (Linux) file using Nasm'#000+
'3*2Anasmobj_ob','j file using Nasm'#000+
'3*2Amasm_obj file using Masm (Mircosoft)'#000+
'3*2Amasm_obj file using Masm (Microsoft)'#000+
'3*2Atasm_obj file using Tasm (Borland)'#000+
'3*1R<x>_assembler reading style:'#000+
'3*2Ratt_read AT&T style assembler'#000+

View File

@ -714,6 +714,14 @@ unit ptconst;
consume(RKLAMMER);
end;
end;
errordef:
begin
{ try to consume something useful }
if token=LKLAMMER then
consume_all_until(RKLAMMER)
else
consume_all_until(SEMICOLON);
end;
else Message(parser_e_type_const_not_possible);
end;
end;
@ -721,7 +729,18 @@ unit ptconst;
end.
{
$Log$
Revision 1.44 1999-05-21 13:55:11 peter
Revision 1.45 1999-05-23 18:42:13 florian
* better error recovering in typed constants
* some problems with arrays of const fixed, some problems
due my previous
- the location type of array constructor is now LOC_MEM
- the pushing of high fixed
- parameter copying fixed
- zero temp. allocation removed
* small problem in the assembler writers fixed:
ref to nil wasn't written correctly
Revision 1.44 1999/05/21 13:55:11 peter
* NEWLAB for label as symbol
Revision 1.43 1999/05/12 00:19:54 peter

View File

@ -3499,9 +3499,26 @@ Const local_symtable_index : longint = $8001;
end;
{$endif GDB}
function terrordef.gettypename:string;
begin
gettypename:='<erroneous type>';
end;
{
$Log$
Revision 1.121 1999-05-21 13:55:19 peter
Revision 1.122 1999-05-23 18:42:14 florian
* better error recovering in typed constants
* some problems with arrays of const fixed, some problems
due my previous
- the location type of array constructor is now LOC_MEM
- the pushing of high fixed
- parameter copying fixed
- zero temp. allocation removed
* small problem in the assembler writers fixed:
ref to nil wasn't written correctly
Revision 1.121 1999/05/21 13:55:19 peter
* NEWLAB for label as symbol
Revision 1.120 1999/05/20 22:22:43 pierre

View File

@ -142,6 +142,7 @@
{$ifdef GDB}
function stabstring : pchar;virtual;
{$endif GDB}
function gettypename:string;virtual;
end;
{ tpointerdef and tclassrefdef should get a common
@ -516,7 +517,18 @@
{
$Log$
Revision 1.28 1999-05-19 16:48:28 florian
Revision 1.29 1999-05-23 18:42:15 florian
* better error recovering in typed constants
* some problems with arrays of const fixed, some problems
due my previous
- the location type of array constructor is now LOC_MEM
- the pushing of high fixed
- parameter copying fixed
- zero temp. allocation removed
* small problem in the assembler writers fixed:
ref to nil wasn't written correctly
Revision 1.28 1999/05/19 16:48:28 florian
* tdef.typename: returns a now a proper type name for the most types
Revision 1.27 1999/05/13 21:59:42 peter

View File

@ -284,7 +284,7 @@ unit symtable;
s32bitdef : porddef; { Pointer to 32-Bit signed }
cu64bitdef : porddef; { pointer to 64 bit unsigned def }
cs64bitdef : porddef; { pointer to 64 bit signed def, }
cs64bitintdef : porddef; { pointer to 64 bit signed def, }
{ calculated by the int unit on i386 }
s32floatdef : pfloatdef; { pointer for realconstn }
@ -2345,7 +2345,18 @@ const localsymtablestack : psymtable = nil;
end.
{
$Log$
Revision 1.15 1999-05-17 23:51:41 peter
Revision 1.16 1999-05-23 18:42:16 florian
* better error recovering in typed constants
* some problems with arrays of const fixed, some problems
due my previous
- the location type of array constructor is now LOC_MEM
- the pushing of high fixed
- parameter copying fixed
- zero temp. allocation removed
* small problem in the assembler writers fixed:
ref to nil wasn't written correctly
Revision 1.15 1999/05/17 23:51:41 peter
* with temp vars now use a reference with a persistant temp instead
of setting datasize

View File

@ -481,12 +481,12 @@ implementation
begin
if (porddef(ld)^.typ<>s64bitint) then
begin
p^.left:=gentypeconvnode(p^.left,cs64bitdef);
p^.left:=gentypeconvnode(p^.left,cs64bitintdef);
firstpass(p^.left);
end;
if (porddef(rd)^.typ<>s64bitint) then
begin
p^.right:=gentypeconvnode(p^.right,cs64bitdef);
p^.right:=gentypeconvnode(p^.right,cs64bitintdef);
firstpass(p^.right);
end;
calcregisters(p,2,0,0);
@ -1097,7 +1097,18 @@ implementation
end.
{
$Log$
Revision 1.31 1999-05-19 20:40:14 florian
Revision 1.32 1999-05-23 18:42:18 florian
* better error recovering in typed constants
* some problems with arrays of const fixed, some problems
due my previous
- the location type of array constructor is now LOC_MEM
- the pushing of high fixed
- parameter copying fixed
- zero temp. allocation removed
* small problem in the assembler writers fixed:
ref to nil wasn't written correctly
Revision 1.31 1999/05/19 20:40:14 florian
* fixed a couple of array related bugs:
- var a : array[0..1] of char; p : pchar; p:=a+123; works now
- open arrays with an odd size doesn't work: movsb wasn't generated

View File

@ -69,7 +69,8 @@ implementation
case p^.left^.resulttype^.deftype of
arraydef :
begin
if is_open_array(p^.left^.resulttype) then
if is_open_array(p^.left^.resulttype) or
is_array_of_const(p^.left^.resulttype) then
begin
st:=p^.left^.symtable;
getsymonlyin(st,'high'+pvarsym(p^.left^.symtableentry)^.name);
@ -1166,7 +1167,18 @@ implementation
end.
{
$Log$
Revision 1.46 1999-05-20 14:58:27 peter
Revision 1.47 1999-05-23 18:42:19 florian
* better error recovering in typed constants
* some problems with arrays of const fixed, some problems
due my previous
- the location type of array constructor is now LOC_MEM
- the pushing of high fixed
- parameter copying fixed
- zero temp. allocation removed
* small problem in the assembler writers fixed:
ref to nil wasn't written correctly
Revision 1.46 1999/05/20 14:58:27 peter
* fixed arrayconstruct->set conversion which didn't work for enum sets
Revision 1.45 1999/05/19 10:31:54 florian

View File

@ -1011,7 +1011,8 @@ implementation
end
else
begin
if is_open_array(p^.left^.resulttype) then
if is_open_array(p^.left^.resulttype) or
is_array_of_const(p^.left^.resulttype) then
begin
getsymonlyin(p^.left^.symtable,'high'+pvarsym(p^.left^.symtableentry)^.name);
hp:=genloadnode(pvarsym(srsym),p^.left^.symtable);
@ -1104,7 +1105,18 @@ implementation
end.
{
$Log$
Revision 1.33 1999-05-06 09:05:35 peter
Revision 1.34 1999-05-23 18:42:20 florian
* better error recovering in typed constants
* some problems with arrays of const fixed, some problems
due my previous
- the location type of array constructor is now LOC_MEM
- the pushing of high fixed
- parameter copying fixed
- zero temp. allocation removed
* small problem in the assembler writers fixed:
ref to nil wasn't written correctly
Revision 1.33 1999/05/06 09:05:35 peter
* generic write_float and str_float
* fixed constant float conversions

View File

@ -439,7 +439,7 @@ implementation
parraydef(p^.resulttype)^.definition:=pd;
parraydef(p^.resulttype)^.IsConstructor:=true;
parraydef(p^.resulttype)^.IsVariant:=varia;
p^.location.loc:=LOC_REFERENCE;
p^.location.loc:=LOC_MEM;
end;
@ -457,7 +457,18 @@ implementation
end.
{
$Log$
Revision 1.31 1999-05-19 15:26:41 florian
Revision 1.32 1999-05-23 18:42:22 florian
* better error recovering in typed constants
* some problems with arrays of const fixed, some problems
due my previous
- the location type of array constructor is now LOC_MEM
- the pushing of high fixed
- parameter copying fixed
- zero temp. allocation removed
* small problem in the assembler writers fixed:
ref to nil wasn't written correctly
Revision 1.31 1999/05/19 15:26:41 florian
* if a non local variables isn't initialized the compiler doesn't write
any longer "local var. seems not to be ..."

View File

@ -446,7 +446,8 @@ implementation
function push_high_param(def : pdef) : boolean;
begin
push_high_param:=is_open_array(def) or is_open_string(def);
push_high_param:=is_open_array(def) or is_open_string(def) or
is_array_of_const(def);
end;
@ -884,7 +885,18 @@ implementation
end.
{
$Log$
Revision 1.64 1999-05-19 20:55:08 florian
Revision 1.65 1999-05-23 18:42:23 florian
* better error recovering in typed constants
* some problems with arrays of const fixed, some problems
due my previous
- the location type of array constructor is now LOC_MEM
- the pushing of high fixed
- parameter copying fixed
- zero temp. allocation removed
* small problem in the assembler writers fixed:
ref to nil wasn't written correctly
Revision 1.64 1999/05/19 20:55:08 florian
* fix of my previous commit
Revision 1.63 1999/05/19 20:40:15 florian

View File

@ -13,7 +13,6 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
**********************************************************************}
program msg2inc;
program nasmconv;
var
@ -295,10 +294,21 @@ begin
end.
{
$Log$
Revision 1.1 1999-05-12 16:17:10 peter
Revision 1.2 1999-05-23 18:42:24 florian
* better error recovering in typed constants
* some problems with arrays of const fixed, some problems
due my previous
- the location type of array constructor is now LOC_MEM
- the pushing of high fixed
- parameter copying fixed
- zero temp. allocation removed
* small problem in the assembler writers fixed:
ref to nil wasn't written correctly
Revision 1.1 1999/05/12 16:17:10 peter
* init
Revision 1.1 1999/05/12 16:08:27 peter
+ moved compiler utils
}
}