mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-12 09:29:07 +02:00
- removed the discardresult proc directive
git-svn-id: trunk@49017 -
This commit is contained in:
parent
800bb3adc2
commit
9fa61a6c9f
@ -2429,7 +2429,7 @@ type
|
||||
end;
|
||||
const
|
||||
{Should contain the number of procedure directives we support.}
|
||||
num_proc_directives=54;
|
||||
num_proc_directives=53;
|
||||
proc_direcdata:array[1..num_proc_directives] of proc_dir_rec=
|
||||
(
|
||||
(
|
||||
@ -2495,15 +2495,6 @@ const
|
||||
mutexclpocall : [];
|
||||
mutexclpotype : [potype_constructor,potype_destructor,potype_class_constructor,potype_class_destructor];
|
||||
mutexclpo : [po_assembler,po_external]
|
||||
),(
|
||||
idtok:_DISCARDRESULT;
|
||||
pd_flags : [pd_interface,pd_implemen,pd_body,pd_procvar];
|
||||
handler : nil;
|
||||
pocall : pocall_none;
|
||||
pooption : [po_discardresult];
|
||||
mutexclpocall : [];
|
||||
mutexclpotype : [potype_function,potype_constructor,potype_destructor,potype_class_constructor,potype_class_destructor];
|
||||
mutexclpo : []
|
||||
),(
|
||||
idtok:_DISPID;
|
||||
pd_flags : [pd_dispinterface];
|
||||
|
@ -435,9 +435,7 @@ type
|
||||
"varargs" modifier or Mac-Pascal ".." parameter }
|
||||
po_variadic,
|
||||
{ implicitly return same type as the class instance to which the message is sent }
|
||||
po_objc_related_result_type,
|
||||
{ procedure returns value (like a function), that should be discarded }
|
||||
po_discardresult
|
||||
po_objc_related_result_type
|
||||
);
|
||||
tprocoptions=set of tprocoption;
|
||||
|
||||
@ -1103,8 +1101,7 @@ inherited_objectoptions : tobjectoptions = [oo_has_virtual,oo_has_private,oo_has
|
||||
'po_is_auto_setter',{po_is_auto_setter}
|
||||
'po_noinline',{po_noinline}
|
||||
'C-style array-of-const', {po_variadic}
|
||||
'objc-related-result-type', {po_objc_related_result_type}
|
||||
'po_discardresult' { po_discardresult }
|
||||
'objc-related-result-type' {po_objc_related_result_type}
|
||||
);
|
||||
|
||||
implementation
|
||||
|
@ -305,7 +305,6 @@ type
|
||||
_OBJCCATEGORY,
|
||||
_OBJCPROTOCOL,
|
||||
_WEAKEXTERNAL,
|
||||
_DISCARDRESULT,
|
||||
_DISPINTERFACE,
|
||||
_UNIMPLEMENTED,
|
||||
_IMPLEMENTATION,
|
||||
@ -648,7 +647,6 @@ const
|
||||
(str:'OBJCCATEGORY' ;special:false;keyword:[m_objectivec1];op:NOTOKEN), { Objective-C category }
|
||||
(str:'OBJCPROTOCOL' ;special:false;keyword:[m_objectivec1];op:NOTOKEN), { Objective-C protocol }
|
||||
(str:'WEAKEXTERNAL' ;special:false;keyword:[m_none];op:NOTOKEN),
|
||||
(str:'DISCARDRESULT' ;special:false;keyword:[m_none];op:NOTOKEN),
|
||||
(str:'DISPINTERFACE' ;special:false;keyword:[m_class];op:NOTOKEN),
|
||||
(str:'UNIMPLEMENTED' ;special:false;keyword:[m_none];op:NOTOKEN),
|
||||
(str:'IMPLEMENTATION';special:false;keyword:alllanguagemodes-[m_iso,m_extpas];op:NOTOKEN),
|
||||
|
@ -2997,8 +2997,7 @@ const
|
||||
(mask:po_is_auto_setter; str: 'Automatically generated setter'),
|
||||
(mask:po_noinline; str: 'Never inline'),
|
||||
(mask:po_variadic; str: 'C VarArgs with array-of-const para'),
|
||||
(mask:po_objc_related_result_type; str: 'Objective-C related result type'),
|
||||
(mask:po_discardresult; str: 'Discard result')
|
||||
(mask:po_objc_related_result_type; str: 'Objective-C related result type')
|
||||
);
|
||||
var
|
||||
proctypeoption : tproctypeoption;
|
||||
|
@ -2055,7 +2055,7 @@ implementation
|
||||
else
|
||||
ft:=tcpuprocdef(pd).create_functype;
|
||||
totalremovesize:=Length(ft.params)-Length(ft.results);
|
||||
if (Length(ft.results)=0) and (po_discardresult in pd.procoptions) then
|
||||
if Length(ft.results)=0 then
|
||||
dec(totalremovesize);
|
||||
{ remove parameters from internal evaluation stack counter (in case of
|
||||
e.g. no parameters and a result, it can also increase) }
|
||||
|
@ -60,7 +60,7 @@ implementation
|
||||
|
||||
procedure twasmcallnode.do_release_unused_return_value;
|
||||
begin
|
||||
if is_void(resultdef) and not (po_discardresult in procdefinition.procoptions) then
|
||||
if is_void(resultdef) then
|
||||
exit;
|
||||
current_asmdata.CurrAsmList.concat(taicpu.op_none(a_drop));
|
||||
thlcgwasm(hlcg).decstack(current_asmdata.CurrAsmList,1);
|
||||
|
Loading…
Reference in New Issue
Block a user