From 8bc4e0a32ffec1b8931217bd8bf4a814dd72fc83 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Mon, 18 Jul 2005 15:27:14 +0000 Subject: [PATCH] * inline and compilerproc are now procoptions instead of proccall types (so both can be combined with each other, as well as with other calling conventions) * defined COMPPROCINLINEFIXED so SYSTEMINLINE is again activated git-svn-id: trunk@658 - --- compiler/arm/cpuinfo.pas | 2 - compiler/globals.pas | 2 - compiler/globtype.pas | 6 --- compiler/i386/cpuinfo.pas | 2 - compiler/i386/cpupara.pas | 10 ---- compiler/m68k/cpuinfo.pas | 2 - compiler/mips/cpuinfo.pas | 2 - compiler/ncal.pas | 13 +++-- compiler/ncgbas.pas | 2 +- compiler/ncgutil.pas | 8 ++-- compiler/options.pas | 2 + compiler/pdecsub.pas | 93 ++++++++++++++++++------------------ compiler/pmodules.pas | 2 +- compiler/powerpc/cpuinfo.pas | 2 - compiler/psub.pas | 4 +- compiler/rautils.pas | 2 +- compiler/sparc/cpuinfo.pas | 2 - compiler/sparc/cpupara.pas | 6 +-- compiler/symconst.pas | 10 ++-- compiler/symdef.pas | 4 +- compiler/utils/ppudump.pp | 41 +++++++++++----- 21 files changed, 101 insertions(+), 116 deletions(-) diff --git a/compiler/arm/cpuinfo.pas b/compiler/arm/cpuinfo.pas index 877590b376..c9aba464a9 100644 --- a/compiler/arm/cpuinfo.pas +++ b/compiler/arm/cpuinfo.pas @@ -58,8 +58,6 @@ Const { calling conventions supported by the code generator } supported_calling_conventions : tproccalloptions = [ pocall_internproc, - pocall_compilerproc, - pocall_inline, pocall_stdcall, { same as stdcall only different name mangling } pocall_cdecl, diff --git a/compiler/globals.pas b/compiler/globals.pas index ad6c86a9df..12e5f9a752 100644 --- a/compiler/globals.pas +++ b/compiler/globals.pas @@ -1900,10 +1900,8 @@ end; DefProcCallName : array[tproccalloption] of string[12] = ('', 'CDECL', 'CPPDECL', - '', { compilerproc } 'FAR16', 'OLDFPCCALL', - 'INLINE', '', { internproc } '', { syscall } 'PASCAL', diff --git a/compiler/globtype.pas b/compiler/globtype.pas index 8e47d980ad..c7e7eb3c05 100644 --- a/compiler/globtype.pas +++ b/compiler/globtype.pas @@ -195,14 +195,10 @@ than 255 characters. That's why using Ansi Strings} pocall_cdecl, { C++ calling conventions } pocall_cppdecl, - { Procedure is used for internal compiler calls } - pocall_compilerproc, { Far16 for OS/2 } pocall_far16, { Old style FPC default calling } pocall_oldfpccall, - { Procedure is an assembler macro } - pocall_inline, { Procedure has compiler magic} pocall_internproc, { procedure is a system call, applies e.g. to MorphOS and PalmOS } @@ -259,10 +255,8 @@ than 255 characters. That's why using Ansi Strings} proccalloptionStr : array[tproccalloption] of string[14]=('', 'CDecl', 'CPPDecl', - 'CompilerProc', 'Far16', 'OldFPCCall', - 'Inline', 'InternProc', 'SysCall', 'Pascal', diff --git a/compiler/i386/cpuinfo.pas b/compiler/i386/cpuinfo.pas index 337eadbb3d..bfdb82727a 100644 --- a/compiler/i386/cpuinfo.pas +++ b/compiler/i386/cpuinfo.pas @@ -61,8 +61,6 @@ Const { calling conventions supported by the code generator } supported_calling_conventions : tproccalloptions = [ pocall_internproc, - pocall_compilerproc, - pocall_inline, pocall_register, pocall_safecall, pocall_stdcall, diff --git a/compiler/i386/cpupara.pas b/compiler/i386/cpupara.pas index 14f68f7242..bf062179a2 100644 --- a/compiler/i386/cpupara.pas +++ b/compiler/i386/cpupara.pas @@ -208,14 +208,6 @@ unit cpupara; case calloption of pocall_internproc : result:=[]; - pocall_compilerproc : - begin - if pocall_default=pocall_oldfpccall then - result:=[RS_EAX,RS_EDX,RS_ECX,RS_ESI,RS_EDI,RS_EBX] - else - result:=[RS_EAX,RS_EDX,RS_ECX]; - end; - pocall_inline, pocall_register, pocall_safecall, pocall_stdcall, @@ -567,8 +559,6 @@ unit cpupara; case p.proccalloption of pocall_register : create_register_paraloc_info(p,side,p.paras,parareg,parasize); - pocall_inline, - pocall_compilerproc, pocall_internproc : begin { Use default calling } diff --git a/compiler/m68k/cpuinfo.pas b/compiler/m68k/cpuinfo.pas index 368b107499..178a0fa28e 100644 --- a/compiler/m68k/cpuinfo.pas +++ b/compiler/m68k/cpuinfo.pas @@ -48,8 +48,6 @@ Const { calling conventions supported by the code generator } supported_calling_conventions : tproccalloptions = [ pocall_internproc, - pocall_compilerproc, - pocall_inline, pocall_stdcall, { the difference to stdcall is only the name mangling } pocall_cdecl, diff --git a/compiler/mips/cpuinfo.pas b/compiler/mips/cpuinfo.pas index af4fc7675f..6dc7979f70 100644 --- a/compiler/mips/cpuinfo.pas +++ b/compiler/mips/cpuinfo.pas @@ -51,8 +51,6 @@ Const { calling conventions supported by the code generator } supported_calling_conventions : tproccalloptions = [ pocall_internproc, - pocall_compilerproc, - pocall_inline, pocall_stdcall, { same as stdcall only different name mangling } pocall_cdecl, diff --git a/compiler/ncal.pas b/compiler/ncal.pas index 3abb2efc6a..48cdcc7756 100644 --- a/compiler/ncal.pas +++ b/compiler/ncal.pas @@ -813,7 +813,7 @@ type include(callnodeflags,cnf_restypeset); { both the normal and specified resulttype either have to be returned via a } { parameter or not, but no mixing (JM) } - if paramanager.ret_in_param(restype.def,pocall_compilerproc) xor + if paramanager.ret_in_param(restype.def,symtableprocentry.first_procdef.proccalloption) xor paramanager.ret_in_param(symtableprocentry.first_procdef.rettype.def,symtableprocentry.first_procdef.proccalloption) then internalerror(200108291); end; @@ -857,7 +857,7 @@ type para := tcallparanode(para.right); end; { no hidden resultpara found, error! } - if not(procdefinition.proccalloption = pocall_inline) then + if not(po_inline in procdefinition.procoptions) then internalerror(200306087); end; end; @@ -2246,7 +2246,7 @@ type dosimplify(createblock); firstpass(createblock); - procdefinition.proccalloption:=pocall_inline; + include(procdefinition.procoptions,po_inline); { return inlined block } result := createblock; end; @@ -2259,8 +2259,7 @@ type result:=nil; { Can we inline the procedure? } - if (procdefinition.proccalloption=pocall_inline) and - (po_has_inlininginfo in procdefinition.procoptions) then + if ([po_inline,po_has_inlininginfo] <= procdefinition.procoptions) then begin { Check if we can inline the procedure when it references proc/var that are not in the globally available } @@ -2330,7 +2329,7 @@ type {$ifdef PASS2INLINE} { calc the correture value for the register } { handle predefined procedures } - if (procdefinition.proccalloption=pocall_inline) then + if (po_inline in procdefinition.procoptions) then begin { inherit flags } current_procinfo.flags := current_procinfo.flags + (tprocdef(procdefinition).inlininginfo^.flags*inherited_inlining_flags); @@ -2497,7 +2496,7 @@ type end; {$ifdef PASS2INLINE} if assigned(inlinecode) then - procdefinition.proccalloption:=pocall_inline; + include(procdefinition.procoptions,po_inline); {$endif PASS2INLINE} end; diff --git a/compiler/ncgbas.pas b/compiler/ncgbas.pas index 4bae7c4e4d..750e909a0c 100644 --- a/compiler/ncgbas.pas +++ b/compiler/ncgbas.pas @@ -225,7 +225,7 @@ interface { Allocate registers used in the assembler block } cg.alloccpuregisters(exprasmlist,R_INTREGISTER,used_regs_int); - if (current_procinfo.procdef.proccalloption=pocall_inline) then + if (po_inline in current_procinfo.procdef.procoptions) then begin objectlibrary.CreateUsedAsmSymbolList; hp:=tai(p_asm.first); diff --git a/compiler/ncgutil.pas b/compiler/ncgutil.pas index 6e4a65225d..958a7404d8 100644 --- a/compiler/ncgutil.pas +++ b/compiler/ncgutil.pas @@ -1953,7 +1953,7 @@ implementation if (sym.owner.symtabletype=globalsymtable) or maybe_smartlink_symbol or (assigned(current_procinfo) and - (current_procinfo.procdef.proccalloption=pocall_inline)) or + (po_inline in current_procinfo.procdef.procoptions)) or DLLSource then curconstSegment.concat(Tai_symbol.Createname_global(sym.mangledname,AT_DATA,l)) else @@ -1983,7 +1983,7 @@ implementation maybe_smartlink_symbol or DLLSource or (assigned(current_procinfo) and - (current_procinfo.procdef.proccalloption=pocall_inline)) or + (po_inline in current_procinfo.procdef.procoptions)) or (vo_is_exported in sym.varoptions) or (vo_is_C_var in sym.varoptions) then bssSegment.concat(Tai_datablock.Create_global(sym.mangledname,l)) @@ -2193,7 +2193,7 @@ implementation begin { for localloc <> LOC_REFERENCE, we need regvar support inside inlined procedures } localloc.loc:=LOC_REFERENCE; - localloc.size:=int_cgsize(paramanager.push_size(varspez,vartype.def,pocall_inline)); + localloc.size:=int_cgsize(paramanager.push_size(varspez,vartype.def,pd.proccalloption)); tg.GetLocal(list,tcgsize2size[localloc.size],vartype.def,localloc.reference); calleeparaloc:=paraloc[calleeside].location; callerparaloc:=paraloc[callerside].location; @@ -2256,7 +2256,7 @@ implementation with tabstractnormalvarsym(pd.funcretsym) do begin localloc.loc:=LOC_REFERENCE; - localloc.size:=int_cgsize(paramanager.push_size(varspez,vartype.def,pocall_inline)); + localloc.size:=int_cgsize(paramanager.push_size(varspez,vartype.def,pd.proccalloption)); tg.GetLocal(list,tcgsize2size[localloc.size],vartype.def,localloc.reference); callerparaloc:=pd.funcretloc[callerside]; case pd.funcretloc[calleeside].loc of diff --git a/compiler/options.pas b/compiler/options.pas index be848f1986..4be6303ed6 100644 --- a/compiler/options.pas +++ b/compiler/options.pas @@ -1791,6 +1791,8 @@ begin { Temporary defines, until things settle down } { "main" symbol is generated in the main program, and left out of the system unit } def_system_macro('FPC_DARWIN_PASCALMAIN'); + def_system_macro('COMPPROCINLINEFIXED'); + if pocall_default = pocall_register then def_system_macro('REGCALL'); diff --git a/compiler/pdecsub.pas b/compiler/pdecsub.pas index db8b343db7..ab5193c437 100644 --- a/compiler/pdecsub.pas +++ b/compiler/pdecsub.pas @@ -340,7 +340,7 @@ implementation var pd : tabstractprocdef absolute arg; begin - if (pd.proccalloption<>pocall_inline) or + if not(po_inline in pd.procoptions) or (tsym(p).typ<>paravarsym) then exit; with tparavarsym(p) do @@ -1407,27 +1407,27 @@ const handler : @pd_abstract; pocall : pocall_none; pooption : [po_abstractmethod]; - mutexclpocall : [pocall_internproc,pocall_inline]; + mutexclpocall : [pocall_internproc]; mutexclpotype : []; - mutexclpo : [po_exports,po_interrupt,po_external] + mutexclpo : [po_exports,po_interrupt,po_external,po_inline] ),( idtok:_ALIAS; pd_flags : [pd_implemen,pd_body,pd_notobjintf]; handler : @pd_alias; pocall : pocall_none; pooption : []; - mutexclpocall : [pocall_inline]; + mutexclpocall : []; mutexclpotype : []; - mutexclpo : [po_external] + mutexclpo : [po_external,po_inline] ),( idtok:_ASMNAME; pd_flags : [pd_interface,pd_implemen,pd_notobjintf]; handler : @pd_asmname; pocall : pocall_cdecl; pooption : [po_external]; - mutexclpocall : [pocall_internproc,pocall_inline]; + mutexclpocall : [pocall_internproc]; mutexclpotype : []; - mutexclpo : [po_external] + mutexclpo : [po_external,po_inline] ),( idtok:_ASSEMBLER; pd_flags : [pd_interface,pd_implemen,pd_body,pd_notobjintf]; @@ -1461,36 +1461,36 @@ const handler : @pd_virtual; pocall : pocall_none; pooption : [po_virtualmethod]; - mutexclpocall : [pocall_internproc,pocall_inline]; + mutexclpocall : [pocall_internproc]; mutexclpotype : []; - mutexclpo : [po_exports,po_interrupt,po_external,po_overridingmethod] + mutexclpo : [po_exports,po_interrupt,po_external,po_overridingmethod,po_inline] ),( idtok:_EXPORT; pd_flags : [pd_body,pd_interface,pd_implemen,pd_notobjintf]; handler : @pd_export; pocall : pocall_none; pooption : [po_exports,po_global]; - mutexclpocall : [pocall_internproc,pocall_inline]; + mutexclpocall : [pocall_internproc]; mutexclpotype : [potype_constructor,potype_destructor]; - mutexclpo : [po_external,po_interrupt] + mutexclpo : [po_external,po_interrupt,po_inline] ),( idtok:_EXTERNAL; pd_flags : [pd_implemen,pd_interface,pd_notobject,pd_notobjintf]; handler : @pd_external; pocall : pocall_none; pooption : [po_external]; - mutexclpocall : [pocall_internproc,pocall_inline,pocall_syscall]; + mutexclpocall : [pocall_internproc,pocall_syscall]; mutexclpotype : [potype_constructor,potype_destructor]; - mutexclpo : [po_public,po_exports,po_interrupt,po_assembler] + mutexclpo : [po_public,po_exports,po_interrupt,po_assembler,po_inline] ),( idtok:_FAR; pd_flags : [pd_implemen,pd_body,pd_interface,pd_procvar,pd_notobject,pd_notobjintf]; handler : @pd_far; pocall : pocall_none; pooption : []; - mutexclpocall : [pocall_internproc,pocall_inline]; + mutexclpocall : [pocall_internproc]; mutexclpotype : []; - mutexclpo : [] + mutexclpo : [po_inline] ),( idtok:_FAR16; pd_flags : [pd_interface,pd_implemen,pd_body,pd_procvar,pd_notobject]; @@ -1506,9 +1506,9 @@ const handler : @pd_forward; pocall : pocall_none; pooption : []; - mutexclpocall : [pocall_internproc,pocall_inline]; + mutexclpocall : [pocall_internproc]; mutexclpotype : []; - mutexclpo : [po_external] + mutexclpo : [po_external,po_inline] ),( idtok:_OLDFPCCALL; pd_flags : [pd_interface,pd_implemen,pd_body,pd_procvar]; @@ -1522,8 +1522,8 @@ const idtok:_INLINE; pd_flags : [pd_interface,pd_implemen,pd_body,pd_notobjintf]; handler : @pd_inline; - pocall : pocall_inline; - pooption : []; + pocall : pocall_none; + pooption : [po_inline]; mutexclpocall : []; mutexclpotype : [potype_constructor,potype_destructor]; mutexclpo : [po_exports,po_external,po_interrupt,po_virtualmethod] @@ -1552,9 +1552,9 @@ const pocall : pocall_none; pooption : [po_interrupt]; mutexclpocall : [pocall_internproc,pocall_cdecl,pocall_cppdecl,pocall_stdcall, - pocall_inline,pocall_pascal,pocall_far16,pocall_oldfpccall]; + pocall_pascal,pocall_far16,pocall_oldfpccall]; mutexclpotype : [potype_constructor,potype_destructor,potype_operator]; - mutexclpo : [po_external] + mutexclpo : [po_external,po_inline] ),( idtok:_IOCHECK; pd_flags : [pd_implemen,pd_body,pd_notobjintf]; @@ -1570,9 +1570,9 @@ const handler : @pd_message; pocall : pocall_none; pooption : []; { can be po_msgstr or po_msgint } - mutexclpocall : [pocall_inline,pocall_internproc]; + mutexclpocall : [pocall_internproc]; mutexclpotype : [potype_constructor,potype_destructor,potype_operator]; - mutexclpo : [po_interrupt,po_external] + mutexclpo : [po_interrupt,po_external,po_inline] ),( idtok:_MWPASCAL; pd_flags : [pd_interface,pd_implemen,pd_body,pd_procvar]; @@ -1615,9 +1615,9 @@ const handler : @pd_override; pocall : pocall_none; pooption : [po_overridingmethod,po_virtualmethod]; - mutexclpocall : [pocall_inline,pocall_internproc]; + mutexclpocall : [pocall_internproc]; mutexclpotype : []; - mutexclpo : [po_exports,po_external,po_interrupt,po_virtualmethod] + mutexclpo : [po_exports,po_external,po_interrupt,po_virtualmethod,po_inline] ),( idtok:_PASCAL; pd_flags : [pd_interface,pd_implemen,pd_body,pd_procvar]; @@ -1633,9 +1633,9 @@ const handler : @pd_public; pocall : pocall_none; pooption : [po_public,po_global]; - mutexclpocall : [pocall_internproc,pocall_inline]; + mutexclpocall : [pocall_internproc]; mutexclpotype : []; - mutexclpo : [po_external] + mutexclpo : [po_external,po_inline] ),( idtok:_REGISTER; pd_flags : [pd_interface,pd_implemen,pd_body,pd_procvar]; @@ -1651,9 +1651,9 @@ const handler : @pd_reintroduce; pocall : pocall_none; pooption : [po_reintroduce]; - mutexclpocall : [pocall_inline,pocall_internproc]; + mutexclpocall : [pocall_internproc]; mutexclpotype : []; - mutexclpo : [po_external,po_interrupt,po_exports,po_overridingmethod] + mutexclpo : [po_external,po_interrupt,po_exports,po_overridingmethod,po_inline] ),( idtok:_SAFECALL; pd_flags : [pd_interface,pd_implemen,pd_body,pd_procvar]; @@ -1680,9 +1680,9 @@ const handler : @pd_static; pocall : pocall_none; pooption : [po_staticmethod]; - mutexclpocall : [pocall_inline,pocall_internproc]; + mutexclpocall : [pocall_internproc]; mutexclpotype : [potype_constructor,potype_destructor]; - mutexclpo : [po_external,po_interrupt,po_exports] + mutexclpo : [po_external,po_interrupt,po_exports,po_inline] ),( idtok:_STDCALL; pd_flags : [pd_interface,pd_implemen,pd_body,pd_procvar]; @@ -1707,9 +1707,9 @@ const handler : @pd_virtual; pocall : pocall_none; pooption : [po_virtualmethod]; - mutexclpocall : [pocall_inline,pocall_internproc]; + mutexclpocall : [pocall_internproc]; mutexclpotype : []; - mutexclpo : [po_external,po_interrupt,po_exports,po_overridingmethod] + mutexclpo : [po_external,po_interrupt,po_exports,po_overridingmethod,po_inline] ),( idtok:_CPPDECL; pd_flags : [pd_interface,pd_implemen,pd_body,pd_procvar]; @@ -1726,15 +1726,15 @@ const pocall : pocall_none; pooption : [po_varargs]; mutexclpocall : [pocall_internproc,pocall_stdcall,pocall_register, - pocall_inline,pocall_far16,pocall_oldfpccall,pocall_mwpascal]; + pocall_far16,pocall_oldfpccall,pocall_mwpascal]; mutexclpotype : []; - mutexclpo : [po_assembler,po_interrupt] + mutexclpo : [po_assembler,po_interrupt,po_inline] ),( idtok:_COMPILERPROC; pd_flags : [pd_interface,pd_implemen,pd_body,pd_notobjintf]; handler : nil; - pocall : pocall_compilerproc; - pooption : []; + pocall : pocall_none; + pooption : [po_compilerproc]; mutexclpocall : []; mutexclpotype : [potype_constructor,potype_destructor]; mutexclpo : [po_interrupt] @@ -1977,12 +1977,10 @@ const else { Normal procedures } begin - case pd.proccalloption of - pocall_compilerproc : - begin - pd.setmangledname(lower(pd.procsym.name)); - end; - end; + if (po_compilerproc in pd.procoptions) then + begin + pd.setmangledname(lower(pd.procsym.name)); + end; end; end; @@ -2033,15 +2031,16 @@ const { Temporary stub, must be rewritten to support OS/2 far16 } Message1(parser_w_proc_directive_ignored,'FAR16'); end; - pocall_inline : + end; + + if (po_inline in pd.procoptions) then begin if not(cs_support_inline in aktmoduleswitches) then begin Message(parser_e_proc_inline_not_supported); - pd.proccalloption:=pocall_default; + exclude(pd.procoptions,po_inline); end; end; - end; { For varargs directive also cdecl and external must be defined } if (po_varargs in pd.procoptions) then @@ -2388,7 +2387,7 @@ const hd.import_nr:=pd.import_nr; { for compilerproc defines we need to rename and update the symbolname to lowercase } - if (pd.proccalloption=pocall_compilerproc) then + if (po_compilerproc in pd.procoptions) then begin { rename to lowercase so users can't access it } aprocsym.owner.rename(aprocsym.name,lower(aprocsym.name)); diff --git a/compiler/pmodules.pas b/compiler/pmodules.pas index afd6f173c1..cd696bf1c3 100644 --- a/compiler/pmodules.pas +++ b/compiler/pmodules.pas @@ -768,7 +768,7 @@ implementation pd:=tprocdef(def); if assigned(pd.localst) and (pd.localst.symtabletype<>staticsymtable) and - not((pd.proccalloption=pocall_inline) or + not((po_inline in pd.procoptions) or ((current_module.flags and uf_local_browser)<>0)) then begin free_localsymtables(pd.localst); diff --git a/compiler/powerpc/cpuinfo.pas b/compiler/powerpc/cpuinfo.pas index f0738fa118..75332583b4 100644 --- a/compiler/powerpc/cpuinfo.pas +++ b/compiler/powerpc/cpuinfo.pas @@ -47,8 +47,6 @@ Const { calling conventions supported by the code generator } supported_calling_conventions : tproccalloptions = [ pocall_internproc, - pocall_compilerproc, - pocall_inline, pocall_stdcall, { the difference to stdcall is only the name mangling } pocall_cdecl, diff --git a/compiler/psub.pas b/compiler/psub.pas index a1d3349fde..8cef4f0a97 100644 --- a/compiler/psub.pas +++ b/compiler/psub.pas @@ -1050,7 +1050,7 @@ implementation end; end; - if (procdef.proccalloption=pocall_inline) then + if (po_inline in procdef.procoptions) then begin { Can we inline this procedure? } if checknodeinlining(procdef) then @@ -1260,7 +1260,7 @@ implementation { We can't support inlining for procedures that have nested procedures because the nested procedures use a fixed offset for accessing locals in the parent procedure (PFV) } - if (current_procinfo.procdef.proccalloption=pocall_inline) and + if (po_inline in current_procinfo.procdef.procoptions) and (tcgprocinfo(current_procinfo).nestedprocs.count>0) then begin Message1(parser_w_not_supported_for_inline,'nested procedures'); diff --git a/compiler/rautils.pas b/compiler/rautils.pas index 2c254b5140..e1afa9b6ad 100644 --- a/compiler/rautils.pas +++ b/compiler/rautils.pas @@ -829,7 +829,7 @@ Begin indexreg:=NR_NO; opr.typ:=OPR_LOCAL; if assigned(current_procinfo.parent) and - (current_procinfo.procdef.proccalloption<>pocall_inline) and + not(po_inline in current_procinfo.procdef.procoptions) and (sym.owner<>current_procinfo.procdef.localst) and (sym.owner<>current_procinfo.procdef.parast) and (current_procinfo.procdef.localst.symtablelevel>normal_function_level) and diff --git a/compiler/sparc/cpuinfo.pas b/compiler/sparc/cpuinfo.pas index 11f1ffd1c9..e6658dcf1b 100644 --- a/compiler/sparc/cpuinfo.pas +++ b/compiler/sparc/cpuinfo.pas @@ -47,8 +47,6 @@ const { calling conventions supported by the code generator } supported_calling_conventions : tproccalloptions = [ pocall_internproc, - pocall_compilerproc, - pocall_inline, pocall_stdcall, pocall_cdecl, pocall_cppdecl diff --git a/compiler/sparc/cpupara.pas b/compiler/sparc/cpupara.pas index 155d0c412d..24db81008a 100644 --- a/compiler/sparc/cpupara.pas +++ b/compiler/sparc/cpupara.pas @@ -171,12 +171,12 @@ implementation begin p.funcretloc[side].loc:=LOC_REGISTER; { high } - if (side=callerside) or (p.proccalloption=pocall_inline)then + if (side=callerside) (po_inline in p.procoptions) then p.funcretloc[side].register64.reghi:=NR_FUNCTION_RESULT64_HIGH_REG else p.funcretloc[side].register64.reghi:=NR_FUNCTION_RETURN64_HIGH_REG; { low } - if (side=callerside) or (p.proccalloption=pocall_inline) then + if (side=callerside) or (po_inline in p.procoptions) then p.funcretloc[side].register64.reglo:=NR_FUNCTION_RESULT64_LOW_REG else p.funcretloc[side].register64.reglo:=NR_FUNCTION_RETURN64_LOW_REG; @@ -186,7 +186,7 @@ implementation begin p.funcretloc[side].loc:=LOC_REGISTER; p.funcretloc[side].size:=retcgsize; - if (side=callerside) or (p.proccalloption=pocall_inline)then + if (side=callerside) or (po_inline in p.procoptions)then p.funcretloc[side].register:=newreg(R_INTREGISTER,RS_FUNCTION_RESULT_REG,cgsize2subreg(retcgsize)) else p.funcretloc[side].register:=newreg(R_INTREGISTER,RS_FUNCTION_RETURN_REG,cgsize2subreg(retcgsize)); diff --git a/compiler/symconst.pas b/compiler/symconst.pas index 406cf465eb..0f4a98e507 100644 --- a/compiler/symconst.pas +++ b/compiler/symconst.pas @@ -267,7 +267,11 @@ type po_syscall_basesysv, po_syscall_sysvbase, po_syscall_r12base, - po_local + po_local, + { Procedure can be inlined } + po_inline, + { Procedure is used for internal compiler calls } + po_compilerproc ); tprocoptions=set of tprocoption; @@ -445,8 +449,4 @@ const implementation -initialization - if pocall_default in [pocall_register,pocall_internproc] then - include(pushleftright_pocalls,pocall_compilerproc); - end. diff --git a/compiler/symdef.pas b/compiler/symdef.pas index 7b7a58d638..29813f592a 100644 --- a/compiler/symdef.pas +++ b/compiler/symdef.pas @@ -3694,7 +3694,7 @@ implementation {$endif i386} proctypeoption:=tproctypeoption(ppufile.getbyte); proccalloption:=tproccalloption(ppufile.getbyte); - ppufile.getsmallset(procoptions); + ppufile.getnormalset(procoptions); location_reset(funcretloc[callerside],LOC_INVALID,OS_NO); location_reset(funcretloc[calleeside],LOC_INVALID,OS_NO); @@ -3731,7 +3731,7 @@ implementation {$endif} ppufile.putbyte(ord(proctypeoption)); ppufile.putbyte(ord(proccalloption)); - ppufile.putsmallset(procoptions); + ppufile.putnormalset(procoptions); ppufile.do_interface_crc:=oldintfcrc; if (po_explicitparaloc in procoptions) then diff --git a/compiler/utils/ppudump.pp b/compiler/utils/ppudump.pp index 3836cc8d2a..da9b653468 100644 --- a/compiler/utils/ppudump.pp +++ b/compiler/utils/ppudump.pp @@ -769,14 +769,10 @@ type pocall_cdecl, { C++ calling conventions } pocall_cppdecl, - { Procedure is used for internal compiler calls } - pocall_compilerproc, { Far16 for OS/2 } pocall_far16, { Old style FPC default calling } pocall_oldfpccall, - { Procedure is an assembler macro } - pocall_inline, { Procedure has compiler magic} pocall_internproc, { procedure is a system call, applies e.g. to MorphOS and PalmOS } @@ -845,7 +841,19 @@ type po_has_mangledname, po_has_public_name, po_forward, - po_global + po_global, + po_has_inlininginfo, + { The different kind of syscalls on MorphOS } + po_syscall_legacy, + po_syscall_sysv, + po_syscall_basesysv, + po_syscall_sysvbase, + po_syscall_r12base, + po_local, + { Procedure can be inlined } + po_inline, + { Procedure is used for internal compiler calls } + po_compilerproc ); tprocoptions=set of tprocoption; procedure read_abstract_proc_def(var proccalloption:tproccalloption;var procoptions:tprocoptions); @@ -866,10 +874,8 @@ const proccalloptionStr : array[tproccalloption] of string[14]=('', 'CDecl', 'CPPDecl', - 'CompilerProc', 'Far16', 'OldFPCCall', - 'Inline', 'InternProc', 'SysCall', 'Pascal', @@ -890,7 +896,7 @@ const (mask:potype_function; str:'Function'), (mask:potype_procedure; str:'Procedure') ); - procopts=26; + procopts=35; procopt : array[1..procopts] of tprocopt=( (mask:po_classmethod; str:'ClassMethod'), (mask:po_virtualmethod; str:'VirtualMethod'), @@ -917,7 +923,16 @@ const (mask:po_has_mangledname; str:'HasMangledName'), (mask:po_has_public_name; str:'HasPublicName'), (mask:po_forward; str:'Forward'), - (mask:po_global; str:'Global') + (mask:po_global; str:'Global'), + (mask:po_has_inlininginfo;str:'HasInliningInfo'), + (mask:po_syscall_legacy; str:'SyscallLegacy'), + (mask:po_syscall_sysv; str:'SyscallSysV'), + (mask:po_syscall_basesysv;str:'SyscallBaseSysV'), + (mask:po_syscall_sysvbase;str:'SyscallSysVBase'), + (mask:po_syscall_r12base; str:'SyscallR12Base'), + (mask:po_local; str:'Local'), + (mask:po_inline; str:'Inline'), + (mask:po_compilerproc; str:'CompilerProc') ); var proctypeoption : tproctypeoption; @@ -943,7 +958,7 @@ begin writeln; proccalloption:=tproccalloption(ppufile.getbyte); writeln(space,' CallOption : ',proccalloptionStr[proccalloption]); - ppufile.getsmallset(procoptions); + ppufile.getnormalset(procoptions); if procoptions<>[] then begin write(space,' Options : '); @@ -1500,7 +1515,7 @@ begin write (space,' Library symbol : '); readderef; end; - if (calloption=pocall_inline) then + if (po_inline in procoptions) then begin write (space,' FuncretSym : '); readderef; @@ -1516,12 +1531,12 @@ begin readdefinitions('parast',false); readsymbols('parast'); { localst } - if (calloption = pocall_inline) then + if (po_inline in procoptions) then begin readdefinitions('localst',false); readsymbols('localst'); end; - if (calloption=pocall_inline) then + if (po_inline in procoptions) then readnodetree; delete(space,1,4); end;