summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornickysn <nickysn@3ad0048d-3df7-0310-abae-a5850022a9f2>2021-03-20 01:22:43 +0000
committernickysn <nickysn@3ad0048d-3df7-0310-abae-a5850022a9f2>2021-03-20 01:22:43 +0000
commit33d19e4dbfdc4e2b55a11527256ff16e9182ad31 (patch)
tree0d1dfba610a021b2c5547221b1b8b7697c1f23b0
parent0c681bd17444c61ac217a650a45f4d5032636796 (diff)
downloadfpc-33d19e4dbfdc4e2b55a11527256ff16e9182ad31.tar.gz
- removed the discardresult proc directive
git-svn-id: https://svn.freepascal.org/svn/fpc/trunk@49017 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r--compiler/pdecsub.pas11
-rw-r--r--compiler/symconst.pas7
-rw-r--r--compiler/tokens.pas2
-rw-r--r--compiler/utils/ppuutils/ppudump.pp3
-rw-r--r--compiler/wasm32/hlcgcpu.pas2
-rw-r--r--compiler/wasm32/nwasmcal.pas2
6 files changed, 6 insertions, 21 deletions
diff --git a/compiler/pdecsub.pas b/compiler/pdecsub.pas
index bb888c9e1a..b7ce1fda75 100644
--- a/compiler/pdecsub.pas
+++ b/compiler/pdecsub.pas
@@ -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=
(
(
@@ -2496,15 +2496,6 @@ const
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];
handler : @pd_dispid;
diff --git a/compiler/symconst.pas b/compiler/symconst.pas
index a59e28173a..aa97d73dc8 100644
--- a/compiler/symconst.pas
+++ b/compiler/symconst.pas
@@ -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
diff --git a/compiler/tokens.pas b/compiler/tokens.pas
index 7fe203af37..f15cd286d8 100644
--- a/compiler/tokens.pas
+++ b/compiler/tokens.pas
@@ -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),
diff --git a/compiler/utils/ppuutils/ppudump.pp b/compiler/utils/ppuutils/ppudump.pp
index bbea4bde1e..5b277f9560 100644
--- a/compiler/utils/ppuutils/ppudump.pp
+++ b/compiler/utils/ppuutils/ppudump.pp
@@ -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;
diff --git a/compiler/wasm32/hlcgcpu.pas b/compiler/wasm32/hlcgcpu.pas
index 808bbe5d2b..91df2cd909 100644
--- a/compiler/wasm32/hlcgcpu.pas
+++ b/compiler/wasm32/hlcgcpu.pas
@@ -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) }
diff --git a/compiler/wasm32/nwasmcal.pas b/compiler/wasm32/nwasmcal.pas
index c293363ce2..ad9de24404 100644
--- a/compiler/wasm32/nwasmcal.pas
+++ b/compiler/wasm32/nwasmcal.pas
@@ -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);