From 11fd466394d945f20de98d013acb95b8603437c2 Mon Sep 17 00:00:00 2001 From: yury Date: Sat, 20 Jun 2020 11:14:43 +0000 Subject: [PATCH] * Optimize parentfp when optimization level 1 and higher to be debugger friendly. git-svn-id: trunk@45661 - --- compiler/ncgcal.pas | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/ncgcal.pas b/compiler/ncgcal.pas index f32faabd2a..1961b90cde 100644 --- a/compiler/ncgcal.pas +++ b/compiler/ncgcal.pas @@ -143,12 +143,14 @@ implementation pd: tprocdef; begin { The parameter can be optimized as unused when: + optimization level 1 and higher this is a direct call to a routine, not a procvar and the routine is not an exception filter and the parameter is not used by the routine and implementation of the routine is already processed. } - result:=assigned(parasym.Owner) and + result:=(cs_opt_level1 in current_settings.optimizerswitches) and + assigned(parasym.Owner) and (parasym.Owner.defowner.typ=procdef); if not result then exit;