* use an enum instead of integer constants to represent inline numbers

* compinnr.inc include file converted to a unit
* inline number field size stored in ppu increased from byte to longint
* inlines in the parse tree (when written with the -vp option) now printed with
  their enum name, instead of number

git-svn-id: trunk@36174 -
This commit is contained in:
nickysn 2017-05-10 14:41:43 +00:00
parent ac3b9ac979
commit efc5e339d0
40 changed files with 260 additions and 252 deletions

2
.gitattributes vendored
View File

@ -151,7 +151,7 @@ compiler/cgutils.pas svneol=native#text/plain
compiler/cmsgs.pas svneol=native#text/plain
compiler/comphook.pas svneol=native#text/plain
compiler/compiler.pas svneol=native#text/plain
compiler/compinnr.inc svneol=native#text/plain
compiler/compinnr.pas svneol=native#text/plain
compiler/comprsrc.pas svneol=native#text/plain
compiler/constexp.pas svneol=native#text/x-pascal
compiler/cpid.pas svneol=native#text/plain

View File

@ -51,7 +51,7 @@ interface
implementation
uses
globtype,
globtype,compinnr,
cutils,verbose,globals,constexp,
aasmbase,aasmcpu,aasmtai,aasmdata,
defutil,

View File

@ -1,152 +0,0 @@
{
This file is part of the Free Pascal run time library and compiler.
Copyright (c) 1998-2002 by the Free Pascal development team
Internal Function/Constant Evaluator numbers
See the file COPYING.FPC, included in this distribution,
for details about the copyright.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
**********************************************************************}
const
{ Internal functions }
in_lo_word = 1;
in_hi_word = 2;
in_lo_long = 3;
in_hi_long = 4;
in_ord_x = 5;
in_length_x = 6;
in_chr_byte = 7;
in_write_x = 14;
in_writeln_x = 15;
in_read_x = 16;
in_readln_x = 17;
in_concat_x = 18;
in_assigned_x = 19;
in_str_x_string = 20;
in_ofs_x = 21;
in_sizeof_x = 22;
in_typeof_x = 23;
in_val_x = 24;
in_reset_x = 25;
in_rewrite_x = 26;
in_low_x = 27;
in_high_x = 28;
in_seg_x = 29;
in_pred_x = 30;
in_succ_x = 31;
in_reset_typedfile = 32;
in_rewrite_typedfile = 33;
in_settextbuf_file_x = 34;
in_inc_x = 35;
in_dec_x = 36;
in_include_x_y = 37;
in_exclude_x_y = 38;
in_break = 39;
in_continue = 40;
in_assert_x_y = 41;
in_addr_x = 42;
in_typeinfo_x = 43;
in_setlength_x = 44;
in_finalize_x = 45;
in_new_x = 46;
in_dispose_x = 47;
in_exit = 48;
in_copy_x = 49;
in_initialize_x = 50;
in_leave = 51; {macpas}
in_cycle = 52; {macpas}
in_slice_x = 53;
in_unaligned_x = 54;
in_get_frame = 56;
in_get_caller_addr = 57;
in_get_caller_frame = 58;
in_pack_x_y_z = 59;
in_unpack_x_y_z = 60;
in_bitsizeof_x = 61;
in_writestr_x = 62;
in_readstr_x = 63;
in_abs_long = 64;
in_ror_x = 65;
in_ror_x_y = 66;
in_rol_x = 67;
in_rol_x_y = 68;
in_objc_selector_x = 69;
in_objc_protocol_x = 70;
in_objc_encode_x = 71;
in_sar_x_y = 72;
in_sar_x = 73;
in_bsf_x = 74;
in_bsr_x = 75;
in_default_x = 76;
in_box_x = 77; { managed platforms: wrap in class instance }
in_unbox_x_y = 78; { manage platforms: extract from class instance }
in_popcnt_x = 79;
in_aligned_x = 80;
in_setstring_x_y_z = 81;
in_insert_x_y_z = 82;
in_delete_x_y_z = 83;
in_reset_typedfile_name = 84;
in_rewrite_typedfile_name = 85;
in_and_assign_x_y = 86;
in_or_assign_x_y = 87;
in_xor_assign_x_y = 88;
in_sar_assign_x_y = 89;
in_shl_assign_x_y = 90;
in_shr_assign_x_y = 91;
in_rol_assign_x_y = 92;
in_ror_assign_x_y = 93;
in_neg_assign_x = 94;
in_not_assign_x = 95;
{ Internal constant functions }
in_const_sqr = 100;
in_const_abs = 101;
in_const_odd = 102;
in_const_ptr = 103;
in_const_swap_word = 104;
in_const_swap_long = 105;
in_lo_qword = 106;
in_hi_qword = 107;
in_const_swap_qword = 108;
in_prefetch_var = 109;
{ FPU functions }
in_trunc_real = 120;
in_round_real = 121;
in_frac_real = 122;
in_int_real = 123;
in_exp_real = 124;
in_cos_real = 125;
in_pi_real = 126;
in_abs_real = 127;
in_sqr_real = 128;
in_sqrt_real = 129;
in_arctan_real = 130;
in_ln_real = 131;
in_sin_real = 132;
in_fma_single = 133;
in_fma_double = 134;
in_fma_extended = 135;
in_fma_float128 = 136;
{ MMX functions }
{ these contants are used by the mmx unit }
{ MMX }
in_mmx_pcmpeqb = 200;
in_mmx_pcmpeqw = 201;
in_mmx_pcmpeqd = 202;
in_mmx_pcmpgtb = 203;
in_mmx_pcmpgtw = 204;
in_mmx_pcmpgtd = 205;
{ 3DNow }
{ SSE }

164
compiler/compinnr.pas Normal file
View File

@ -0,0 +1,164 @@
{
This file is part of the Free Pascal run time library and compiler.
Copyright (c) 1998-2002 by the Free Pascal development team
Internal Function/Constant Evaluator numbers
See the file COPYING.FPC, included in this distribution,
for details about the copyright.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
**********************************************************************}
unit compinnr;
{$i fpcdefs.inc}
{$packenum 4}
interface
type
tinlinenumber=(
in_none = -1,
{ Internal functions }
in_lo_word = 1,
in_hi_word = 2,
in_lo_long = 3,
in_hi_long = 4,
in_ord_x = 5,
in_length_x = 6,
in_chr_byte = 7,
in_write_x = 14,
in_writeln_x = 15,
in_read_x = 16,
in_readln_x = 17,
in_concat_x = 18,
in_assigned_x = 19,
in_str_x_string = 20,
in_ofs_x = 21,
in_sizeof_x = 22,
in_typeof_x = 23,
in_val_x = 24,
in_reset_x = 25,
in_rewrite_x = 26,
in_low_x = 27,
in_high_x = 28,
in_seg_x = 29,
in_pred_x = 30,
in_succ_x = 31,
in_reset_typedfile = 32,
in_rewrite_typedfile = 33,
in_settextbuf_file_x = 34,
in_inc_x = 35,
in_dec_x = 36,
in_include_x_y = 37,
in_exclude_x_y = 38,
in_break = 39,
in_continue = 40,
in_assert_x_y = 41,
in_addr_x = 42,
in_typeinfo_x = 43,
in_setlength_x = 44,
in_finalize_x = 45,
in_new_x = 46,
in_dispose_x = 47,
in_exit = 48,
in_copy_x = 49,
in_initialize_x = 50,
in_leave = 51, {macpas}
in_cycle = 52, {macpas}
in_slice_x = 53,
in_unaligned_x = 54,
in_get_frame = 56,
in_get_caller_addr = 57,
in_get_caller_frame = 58,
in_pack_x_y_z = 59,
in_unpack_x_y_z = 60,
in_bitsizeof_x = 61,
in_writestr_x = 62,
in_readstr_x = 63,
in_abs_long = 64,
in_ror_x = 65,
in_ror_x_y = 66,
in_rol_x = 67,
in_rol_x_y = 68,
in_objc_selector_x = 69,
in_objc_protocol_x = 70,
in_objc_encode_x = 71,
in_sar_x_y = 72,
in_sar_x = 73,
in_bsf_x = 74,
in_bsr_x = 75,
in_default_x = 76,
in_box_x = 77, { managed platforms: wrap in class instance }
in_unbox_x_y = 78, { manage platforms: extract from class instance }
in_popcnt_x = 79,
in_aligned_x = 80,
in_setstring_x_y_z = 81,
in_insert_x_y_z = 82,
in_delete_x_y_z = 83,
in_reset_typedfile_name = 84,
in_rewrite_typedfile_name = 85,
in_and_assign_x_y = 86,
in_or_assign_x_y = 87,
in_xor_assign_x_y = 88,
in_sar_assign_x_y = 89,
in_shl_assign_x_y = 90,
in_shr_assign_x_y = 91,
in_rol_assign_x_y = 92,
in_ror_assign_x_y = 93,
in_neg_assign_x = 94,
in_not_assign_x = 95,
{ Internal constant functions }
in_const_sqr = 100,
in_const_abs = 101,
in_const_odd = 102,
in_const_ptr = 103,
in_const_swap_word = 104,
in_const_swap_long = 105,
in_lo_qword = 106,
in_hi_qword = 107,
in_const_swap_qword = 108,
in_prefetch_var = 109,
{ FPU functions }
in_trunc_real = 120,
in_round_real = 121,
in_frac_real = 122,
in_int_real = 123,
in_exp_real = 124,
in_cos_real = 125,
in_pi_real = 126,
in_abs_real = 127,
in_sqr_real = 128,
in_sqrt_real = 129,
in_arctan_real = 130,
in_ln_real = 131,
in_sin_real = 132,
in_fma_single = 133,
in_fma_double = 134,
in_fma_extended = 135,
in_fma_float128 = 136,
{ MMX functions }
{ these contants are used by the mmx unit }
{ MMX }
in_mmx_pcmpeqb = 200,
in_mmx_pcmpeqw = 201,
in_mmx_pcmpeqd = 202,
in_mmx_pcmpgtb = 203,
in_mmx_pcmpgtw = 204,
in_mmx_pcmpgtd = 205
{ 3DNow }
{ SSE }
);
implementation
end.

View File

@ -27,7 +27,7 @@ interface
uses
cclasses,cmsgs,tokens,
node,globtype,
node,globtype,compinnr,
symconst,symtype,symdef,symsym,symbase,
pgentype;
@ -35,7 +35,7 @@ interface
Ttok2nodeRec=record
tok : ttoken;
nod : tnodetype;
inr : integer; // inline number
inr : tinlinenumber;
op_overloading_supported : boolean;
end;
@ -105,37 +105,36 @@ interface
ra_addr_taken);
tregableinfoflags = set of tregableinfoflag;
{$i compinnr.inc}
const
tok2nodes=27;
tok2node:array[1..tok2nodes] of ttok2noderec=(
(tok:_PLUS ;nod:addn;inr:-1;op_overloading_supported:true), { binary overloading supported }
(tok:_MINUS ;nod:subn;inr:-1;op_overloading_supported:true), { binary and unary overloading supported }
(tok:_STAR ;nod:muln;inr:-1;op_overloading_supported:true), { binary overloading supported }
(tok:_SLASH ;nod:slashn;inr:-1;op_overloading_supported:true), { binary overloading supported }
(tok:_EQ ;nod:equaln;inr:-1;op_overloading_supported:true), { binary overloading supported }
(tok:_GT ;nod:gtn;inr:-1;op_overloading_supported:true), { binary overloading supported }
(tok:_LT ;nod:ltn;inr:-1;op_overloading_supported:true), { binary overloading supported }
(tok:_GTE ;nod:gten;inr:-1;op_overloading_supported:true), { binary overloading supported }
(tok:_LTE ;nod:lten;inr:-1;op_overloading_supported:true), { binary overloading supported }
(tok:_SYMDIF ;nod:symdifn;inr:-1;op_overloading_supported:true), { binary overloading supported }
(tok:_STARSTAR ;nod:starstarn;inr:-1;op_overloading_supported:true), { binary overloading supported }
(tok:_OP_AS ;nod:asn;inr:-1;op_overloading_supported:false), { binary overloading NOT supported }
(tok:_OP_IN ;nod:inn;inr:-1;op_overloading_supported:true), { binary overloading supported }
(tok:_OP_IS ;nod:isn;inr:-1;op_overloading_supported:false), { binary overloading NOT supported }
(tok:_OP_OR ;nod:orn;inr:-1;op_overloading_supported:true), { binary overloading supported }
(tok:_OP_AND ;nod:andn;inr:-1;op_overloading_supported:true), { binary overloading supported }
(tok:_OP_DIV ;nod:divn;inr:-1;op_overloading_supported:true), { binary overloading supported }
(tok:_OP_NOT ;nod:notn;inr:-1;op_overloading_supported:true), { unary overloading supported }
(tok:_OP_MOD ;nod:modn;inr:-1;op_overloading_supported:true), { binary overloading supported }
(tok:_OP_SHL ;nod:shln;inr:-1;op_overloading_supported:true), { binary overloading supported }
(tok:_OP_SHR ;nod:shrn;inr:-1;op_overloading_supported:true), { binary overloading supported }
(tok:_OP_XOR ;nod:xorn;inr:-1;op_overloading_supported:true), { binary overloading supported }
(tok:_ASSIGNMENT ;nod:assignn;inr:-1;op_overloading_supported:true), { unary overloading supported }
(tok:_OP_EXPLICIT;nod:assignn;inr:-1;op_overloading_supported:true), { unary overloading supported }
(tok:_NE ;nod:unequaln;inr:-1;op_overloading_supported:true), { binary overloading supported }
(tok:_OP_INC ;nod:inlinen;inr:in_inc_x;op_overloading_supported:true),{ unary overloading supported }
(tok:_OP_DEC ;nod:inlinen;inr:in_dec_x;op_overloading_supported:true) { unary overloading supported }
(tok:_PLUS ;nod:addn;inr:in_none;op_overloading_supported:true), { binary overloading supported }
(tok:_MINUS ;nod:subn;inr:in_none;op_overloading_supported:true), { binary and unary overloading supported }
(tok:_STAR ;nod:muln;inr:in_none;op_overloading_supported:true), { binary overloading supported }
(tok:_SLASH ;nod:slashn;inr:in_none;op_overloading_supported:true), { binary overloading supported }
(tok:_EQ ;nod:equaln;inr:in_none;op_overloading_supported:true), { binary overloading supported }
(tok:_GT ;nod:gtn;inr:in_none;op_overloading_supported:true), { binary overloading supported }
(tok:_LT ;nod:ltn;inr:in_none;op_overloading_supported:true), { binary overloading supported }
(tok:_GTE ;nod:gten;inr:in_none;op_overloading_supported:true), { binary overloading supported }
(tok:_LTE ;nod:lten;inr:in_none;op_overloading_supported:true), { binary overloading supported }
(tok:_SYMDIF ;nod:symdifn;inr:in_none;op_overloading_supported:true), { binary overloading supported }
(tok:_STARSTAR ;nod:starstarn;inr:in_none;op_overloading_supported:true), { binary overloading supported }
(tok:_OP_AS ;nod:asn;inr:in_none;op_overloading_supported:false), { binary overloading NOT supported }
(tok:_OP_IN ;nod:inn;inr:in_none;op_overloading_supported:true), { binary overloading supported }
(tok:_OP_IS ;nod:isn;inr:in_none;op_overloading_supported:false), { binary overloading NOT supported }
(tok:_OP_OR ;nod:orn;inr:in_none;op_overloading_supported:true), { binary overloading supported }
(tok:_OP_AND ;nod:andn;inr:in_none;op_overloading_supported:true), { binary overloading supported }
(tok:_OP_DIV ;nod:divn;inr:in_none;op_overloading_supported:true), { binary overloading supported }
(tok:_OP_NOT ;nod:notn;inr:in_none;op_overloading_supported:true), { unary overloading supported }
(tok:_OP_MOD ;nod:modn;inr:in_none;op_overloading_supported:true), { binary overloading supported }
(tok:_OP_SHL ;nod:shln;inr:in_none;op_overloading_supported:true), { binary overloading supported }
(tok:_OP_SHR ;nod:shrn;inr:in_none;op_overloading_supported:true), { binary overloading supported }
(tok:_OP_XOR ;nod:xorn;inr:in_none;op_overloading_supported:true), { binary overloading supported }
(tok:_ASSIGNMENT ;nod:assignn;inr:in_none;op_overloading_supported:true), { unary overloading supported }
(tok:_OP_EXPLICIT;nod:assignn;inr:in_none;op_overloading_supported:true), { unary overloading supported }
(tok:_NE ;nod:unequaln;inr:in_none;op_overloading_supported:true), { binary overloading supported }
(tok:_OP_INC ;nod:inlinen;inr:in_inc_x;op_overloading_supported:true), { unary overloading supported }
(tok:_OP_DEC ;nod:inlinen;inr:in_dec_x;op_overloading_supported:true) { unary overloading supported }
);
tok2ops=4;
@ -543,7 +542,7 @@ implementation
end;
function isunaryoperatoroverloadable(treetyp:tnodetype;inlinenumber:integer;ld:tdef) : boolean;
function isunaryoperatoroverloadable(treetyp:tnodetype;inlinenumber:tinlinenumber;ld:tdef) : boolean;
begin
result:=false;
case treetyp of
@ -704,8 +703,8 @@ implementation
operpd : tprocdef;
ppn : tcallparanode;
candidates : tcallcandidates;
cand_cnt,
inlinenumber: integer;
cand_cnt : integer;
inlinenumber: tinlinenumber;
begin
result:=false;
operpd:=nil;
@ -717,7 +716,7 @@ implementation
if t.nodetype=inlinen then
inlinenumber:=tinlinenode(t).inlinenumber
else
inlinenumber:=-1;
inlinenumber:=in_none;
if not isunaryoperatoroverloadable(t.nodetype,inlinenumber,ld) then
exit;

View File

@ -38,7 +38,7 @@ interface
implementation
uses
globtype,globals,
globtype,globals,compinnr,
defutil,
aasmbase,aasmdata,
cgbase,pass_2,

View File

@ -47,7 +47,7 @@ implementation
ninl,
systems,
globtype,globals,
cutils,verbose,
cutils,verbose,compinnr,
constexp,
symconst,
defutil,

View File

@ -43,7 +43,7 @@ interface
implementation
uses
verbose,
verbose,compinnr,
ncon,ncnv,ninl,nld,
defcmp,defutil,
aasmtai,

View File

@ -53,7 +53,7 @@ interface
uses
systems,
cutils,verbose,constexp,globtype,
cutils,verbose,constexp,globtype,compinnr,
symconst,symtable,symdef,symcpu,
paramgr,procinfo,pass_1,
aasmbase,aasmtai,aasmdata,aasmcpu,defutil,

View File

@ -62,7 +62,7 @@ interface
implementation
uses
verbose,globals,globtype,constexp,cutils,
verbose,globals,globtype,constexp,cutils,compinnr,
symconst,symtable,symsym,symcpu,defutil,
cgutils,tgobj,procinfo,htypechk,
cpubase,aasmbase,aasmdata,aasmcpu,

View File

@ -97,7 +97,7 @@ interface
implementation
uses
verbose,globals,globtype,constexp,cutils,
verbose,globals,globtype,constexp,cutils,compinnr,
symbase,symconst,symdef,symsym,symcpu,symtable,aasmbase,aasmdata,
defutil,defcmp,jvmdef,
cgbase,cgutils,pass_1,pass_2,

View File

@ -71,7 +71,7 @@ interface
implementation
uses
cutils,globals,verbose,globtype,constexp,fmodule,
cutils,globals,verbose,globtype,constexp,fmodule,compinnr,
aasmbase,aasmtai,aasmdata,aasmcpu,
symtype,symconst,symdef,symsym,symcpu,symtable,jvmdef,
defutil,

View File

@ -61,7 +61,7 @@ type
implementation
uses
verbose,globals,
verbose,globals,compinnr,
nbas,nld,ncal,ncon,ninl,nmem,ncnv,nutils,
symconst,symsym,symdef,symtable,defutil,jvmdef,
paramgr,

View File

@ -51,7 +51,7 @@ implementation
uses
globtype,systems,constexp,
cutils,verbose,globals,
cutils,verbose,globals,compinnr,
symconst,symdef,
aasmbase,aasmcpu,aasmtai,aasmdata,
defutil,

View File

@ -61,7 +61,7 @@ interface
implementation
uses
verbose,cutils,globtype,globals,constexp,fmodule,
verbose,cutils,globtype,globals,constexp,fmodule,compinnr,
aasmdata,aasmtai,cpubase,aasmbase,aasmcpu,
symbase,symcpu,symtable,defutil,jvmdef,
ncnv,ncon,ninl,ncal,nld,nmem,

View File

@ -118,7 +118,7 @@ implementation
{$ELSE}
fksysutl,
{$ENDIF}
globtype,systems,constexp,
globtype,systems,constexp,compinnr,
cutils,verbose,globals,widestr,
symconst,symdef,symsym,symcpu,symtable,defutil,defcmp,
cgbase,
@ -2802,7 +2802,7 @@ implementation
function taddnode.try_fma(ld,rd : tdef) : tnode;
var
inlinennr : Integer;
inlinennr : tinlinenumber;
begin
result:=nil;
if (cs_opt_fastmath in current_settings.optimizerswitches) and

View File

@ -311,7 +311,7 @@ implementation
systems,
verbose,globals,fmodule,
aasmbase,aasmdata,
symconst,defutil,defcmp,
symconst,defutil,defcmp,compinnr,
htypechk,pass_1,
ncnv,nflw,nld,ninl,nadd,ncon,nmem,nset,nobjc,
pgenutil,
@ -3751,8 +3751,8 @@ implementation
begin
{ convert types to those of the prototype, this is required by functions like ror, rol, sar
some use however a dummy type (Typedfile) so this would break them }
if not(tprocdef(procdefinition).extnumber in [in_Reset_TypedFile,in_Rewrite_TypedFile,
in_reset_typedfile_name,in_rewrite_typedfile_name]) then
if not(tinlinenumber(tprocdef(procdefinition).extnumber) in
[in_Reset_TypedFile,in_Rewrite_TypedFile,in_reset_typedfile_name,in_rewrite_typedfile_name]) then
begin
{ bind parasyms to the callparanodes and insert hidden parameters }
bind_parasym;
@ -3765,17 +3765,17 @@ implementation
{ ptr and settextbuf need two args }
if assigned(tcallparanode(left).right) then
begin
hpt:=geninlinenode(tprocdef(procdefinition).extnumber,is_const,left);
hpt:=geninlinenode(tinlinenumber(tprocdef(procdefinition).extnumber),is_const,left);
left:=nil;
end
else
begin
hpt:=geninlinenode(tprocdef(procdefinition).extnumber,is_const,tcallparanode(left).left);
hpt:=geninlinenode(tinlinenumber(tprocdef(procdefinition).extnumber),is_const,tcallparanode(left).left);
tcallparanode(left).left:=nil;
end;
end
else
hpt:=geninlinenode(tprocdef(procdefinition).extnumber,is_const,nil);
hpt:=geninlinenode(tinlinenumber(tprocdef(procdefinition).extnumber),is_const,nil);
result:=hpt;
exit;
end;

View File

@ -70,7 +70,7 @@ implementation
uses
globtype,constexp,
verbose,globals,
verbose,globals,compinnr,
symconst,symtype,symdef,defutil,
aasmbase,aasmdata,
cgbase,pass_2,

View File

@ -299,7 +299,7 @@ interface
implementation
uses
globtype,systems,constexp,
globtype,systems,constexp,compinnr,
cutils,verbose,globals,widestr,
symconst,symdef,symsym,symcpu,symtable,
ncon,ncal,nset,nadd,nmem,nmat,nbas,nutils,ninl,

View File

@ -241,7 +241,7 @@ interface
implementation
uses
globtype,systems,constexp,
globtype,systems,constexp,compinnr,
cutils,verbose,globals,
symconst,symtable,paramgr,defcmp,defutil,htypechk,pass_1,
ncal,nadd,ncon,nmem,nld,ncnv,nbas,nutils,ninl,nset,ngenutil,

View File

@ -132,7 +132,7 @@ interface
implementation
uses
verbose,version,globals,cutils,constexp,
verbose,version,globals,cutils,constexp,compinnr,
systems,procinfo,fmodule,pparautl,
aasmbase,aasmtai,aasmcnst,
symbase,symtable,defutil,

View File

@ -144,7 +144,7 @@ implementation
uses
SysUtils,
systems,tokens,verbose,
systems,tokens,verbose,compinnr,
cutils,globals,widestr,scanner,
symtable,
defutil,defcmp,

View File

@ -26,15 +26,12 @@ unit ninl;
interface
uses
node,htypechk,symtype;
{$i compinnr.inc}
node,htypechk,symtype,compinnr;
type
tinlinenode = class(tunarynode)
inlinenumber : byte;
constructor create(number : byte;is_const:boolean;l : tnode);virtual;
constructor createintern(number : byte;is_const:boolean;l : tnode);virtual;
inlinenumber : tinlinenumber;
constructor create(number : tinlinenumber;is_const:boolean;l : tnode);virtual;
constructor createintern(number : tinlinenumber;is_const:boolean;l : tnode);virtual;
constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
procedure ppuwrite(ppufile:tcompilerppufile);override;
function dogetcopy : tnode;override;
@ -116,7 +113,7 @@ interface
var
cinlinenode : tinlinenodeclass = tinlinenode;
function geninlinenode(number : byte;is_const:boolean;l : tnode) : tinlinenode;
function geninlinenode(number : tinlinenumber;is_const:boolean;l : tnode) : tinlinenode;
implementation
@ -130,7 +127,7 @@ implementation
nobjc,objcdef,
cgbase,procinfo;
function geninlinenode(number : byte;is_const:boolean;l : tnode) : tinlinenode;
function geninlinenode(number : tinlinenumber;is_const:boolean;l : tnode) : tinlinenode;
begin
geninlinenode:=cinlinenode.create(number,is_const,l);
@ -140,7 +137,7 @@ implementation
TINLINENODE
*****************************************************************************}
constructor tinlinenode.create(number : byte;is_const:boolean;l : tnode);
constructor tinlinenode.create(number : tinlinenumber;is_const:boolean;l : tnode);
begin
inherited create(inlinen,l);
@ -150,7 +147,7 @@ implementation
end;
constructor tinlinenode.createintern(number : byte; is_const : boolean;
constructor tinlinenode.createintern(number : tinlinenumber; is_const : boolean;
l : tnode);
begin
create(number,is_const,l);
@ -161,14 +158,14 @@ implementation
constructor tinlinenode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
begin
inherited ppuload(t,ppufile);
inlinenumber:=ppufile.getbyte;
inlinenumber:=tinlinenumber(ppufile.getlongint);
end;
procedure tinlinenode.ppuwrite(ppufile:tcompilerppufile);
begin
inherited ppuwrite(ppufile);
ppufile.putbyte(inlinenumber);
ppufile.putlongint(longint(inlinenumber));
end;

View File

@ -176,7 +176,7 @@ interface
implementation
uses
verbose,globtype,globals,systems,constexp,
verbose,globtype,globals,systems,constexp,compinnr,
symtable,
defutil,defcmp,
cpuinfo,

View File

@ -95,7 +95,7 @@ implementation
uses
systems,
verbose,globals,cutils,
verbose,globals,cutils,compinnr,
globtype,constexp,
symconst,symtype,symdef,
defutil,

View File

@ -87,7 +87,7 @@ var
implementation
uses cutils, systems,
htypechk, defutil, defcmp, globtype, globals, cpubase,
htypechk, defutil, defcmp, globtype, globals, cpubase, compinnr,
ncnv, ncon, ncal, ninl, nld, nmem,
verbose, symconst,symdef, cgbase, procinfo;

View File

@ -154,7 +154,7 @@ interface
implementation
uses
cutils,verbose,globals,
cutils,verbose,globals,compinnr,
symconst,symdef,
defutil,
nbas,ncon,ncnv,nld,nflw,nset,ncal,nadd,nmem,ninl,

View File

@ -55,7 +55,7 @@ unit optconstprop;
implementation
uses
pass_1,procinfo,
pass_1,procinfo,compinnr,
symsym, symconst,
nutils, nbas, ncnv, nld, nflw, ncal, ninl;

View File

@ -48,7 +48,7 @@ unit optcse;
uses
globtype,globals,
cutils,cclasses,
nutils,
nutils,compinnr,
nbas,nld,ninl,ncal,nadd,nmem,
pass_1,
symconst,symdef,symsym,

View File

@ -35,13 +35,13 @@ unit optloadmodifystore;
implementation
uses
globtype,verbose,nutils,
globtype,verbose,nutils,compinnr,
defutil,defcmp,htypechk,pass_1,
nadd,ncal,ncnv,ninl,nld;
function try_opt_assignmentnode(assignmentnode: tassignmentnode): tnode;
var
newinlinenodetype: byte;
newinlinenodetype: tinlinenumber;
begin
result:=nil;
with assignmentnode do

View File

@ -36,7 +36,7 @@ unit optloop;
implementation
uses
cutils,cclasses,
cutils,cclasses,compinnr,
globtype,globals,constexp,
verbose,
symdef,symsym,

View File

@ -54,7 +54,7 @@ implementation
cutils,
{ global }
globals,tokens,verbose,widestr,constexp,
systems,aasmdata,fmodule,
systems,aasmdata,fmodule,compinnr,
{ symtable }
symconst,symbase,symtype,symcpu,symcreat,defutil,
{ pass 1 }

View File

@ -27,7 +27,7 @@ interface
uses
symtype,symdef,symbase,
node,ncal,
node,ncal,compinnr,
tokens,globtype,globals,constexp,
pgentype;
@ -260,7 +260,7 @@ implementation
end;
function statement_syssym(l : byte) : tnode;
function statement_syssym(l : tinlinenumber) : tnode;
var
p1,p2,paras : tnode;
err,

View File

@ -47,7 +47,7 @@ implementation
uses
{ global }
globtype,tokens,verbose,constexp,
systems,
systems,compinnr,
{ symtable }
symbase,symconst,symdef,symsym,symtable,defutil,
{ pass 1 }
@ -632,7 +632,7 @@ implementation
end;
function inline_copy_insert_delete(nr:byte;name:string) : tnode;
function inline_copy_insert_delete(nr:tinlinenumber;name:string) : tnode;
var
paras : tnode;
{ for easy exiting if something goes wrong }

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="9"/>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<Flags>
@ -500,7 +500,7 @@
<IsPartOfProject Value="True"/>
</Unit116>
<Unit117>
<Filename Value="compinnr.inc"/>
<Filename Value="compinnr.pas"/>
<IsPartOfProject Value="True"/>
</Unit117>
<Unit118>

View File

@ -43,7 +43,7 @@ type
{$endif Test_Double_checksum}
const
CurrentPPUVersion = 191;
CurrentPPUVersion = 192;
{ unit flags }
uf_init = $000001; { unit has initialization section }

View File

@ -40,7 +40,7 @@ interface
implementation
uses
globals,globtype,verbose,constexp,cpuinfo,
globals,globtype,verbose,constexp,cpuinfo,compinnr,
systems,
symconst,symtype,symsym,symdef,symcpu,symtable,
aasmtai,aasmcpu,

View File

@ -26,7 +26,7 @@ interface
uses
{ common }
cutils,
cutils,compinnr,
{ target }
globtype,globals,widestr,constexp,
{ symtable }
@ -415,8 +415,8 @@ interface
tenumsymclass = class of tenumsym;
tsyssym = class(Tstoredsym)
number : longint;
constructor create(const n : string;l : longint);virtual;
number : tinlinenumber;
constructor create(const n : string;l : tinlinenumber);virtual;
constructor ppuload(ppufile:tcompilerppufile);
destructor destroy;override;
{ do not override this routine in platform-specific subclasses,
@ -2634,13 +2634,13 @@ implementation
syssym_list : TFPHashObjectList;
constructor tsyssym.create(const n : string;l : longint);
constructor tsyssym.create(const n : string;l : tinlinenumber);
var
s : shortstring;
begin
inherited create(syssym,n,true);
number:=l;
str(l,s);
str(longint(l),s);
if assigned(syssym_list.find(s)) then
internalerror(2016060303);
syssym_list.add(s,self);
@ -2651,9 +2651,9 @@ implementation
s : shortstring;
begin
inherited ppuload(syssym,ppufile);
number:=ppufile.getlongint;
number:=tinlinenumber(ppufile.getlongint);
ppuload_platform(ppufile);
str(number,s);
str(longint(number),s);
if assigned(syssym_list.find(s)) then
internalerror(2016060304);
syssym_list.add(s,self);
@ -2667,7 +2667,7 @@ implementation
procedure tsyssym.ppuwrite(ppufile:tcompilerppufile);
begin
inherited ppuwrite(ppufile);
ppufile.putlongint(number);
ppufile.putlongint(longint(number));
writeentry(ppufile,ibsyssym);
end;

View File

@ -68,7 +68,7 @@ unit nx86add;
uses
globtype,globals,
verbose,cutils,
verbose,cutils,compinnr,
cpuinfo,
aasmbase,aasmdata,aasmcpu,
symconst,symdef,

View File

@ -78,7 +78,7 @@ implementation
uses
systems,
globtype,globals,
verbose,
verbose,compinnr,
defutil,
aasmbase,aasmdata,aasmcpu,
symtype,symdef,symcpu,