mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 01:39:27 +02:00
* 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 -
This commit is contained in:
parent
9941ca2a1f
commit
8bc4e0a32f
@ -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,
|
||||
|
@ -1900,10 +1900,8 @@ end;
|
||||
DefProcCallName : array[tproccalloption] of string[12] = ('',
|
||||
'CDECL',
|
||||
'CPPDECL',
|
||||
'', { compilerproc }
|
||||
'FAR16',
|
||||
'OLDFPCCALL',
|
||||
'INLINE',
|
||||
'', { internproc }
|
||||
'', { syscall }
|
||||
'PASCAL',
|
||||
|
@ -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',
|
||||
|
@ -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,
|
||||
|
@ -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 }
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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');
|
||||
|
||||
|
@ -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));
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
@ -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');
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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));
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user