From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.31; helo=mga06.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 663302033D1B6 for ; Sun, 27 May 2018 18:19:37 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 May 2018 18:19:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,450,1520924400"; d="scan'208";a="232376038" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga006.fm.intel.com with ESMTP; 27 May 2018 18:19:36 -0700 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 27 May 2018 18:19:36 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx117.amr.corp.intel.com (10.18.116.17) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 27 May 2018 18:19:36 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.51]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.17]) with mapi id 14.03.0319.002; Mon, 28 May 2018 09:19:33 +0800 From: "Zhu, Yonghong" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" CC: "Zurcher@ml01.01.org" , "Zurcher, Christopher J" , "Gao, Liming" , "Zhu, Yonghong" Thread-Topic: [edk2] [Patch] BaseTools/GenFds: Remove redundant GetRealFileLine call Thread-Index: AQHT87tKLpfv8J/pWUSHO2BkQJylkqREXGlg Date: Mon, 28 May 2018 01:19:32 +0000 Message-ID: References: <1527206363-10064-1-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1527206363-10064-1-git-send-email-yonghong.zhu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] BaseTools/GenFds: Remove redundant GetRealFileLine call X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 May 2018 01:19:37 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Yonghong Zhu =20 Best Regards, Zhu Yonghong -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Yong= hong Zhu Sent: Friday, May 25, 2018 7:59 AM To: edk2-devel@lists.01.org Cc: Zurcher@ml01.01.org; Zurcher, Christopher J ; Gao, Liming Subject: [edk2] [Patch] BaseTools/GenFds: Remove redundant GetRealFileLine = call From: Zurcher, Christopher J The EvaluateConditional function should not call GetRealFileLine because th= is is already done in Warning init and only needs to be calculated in the e= vent of a parsing failure. This fix stops InsertedLines from being subtract= ed twice during error handling. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zurcher, Christopher J --- BaseTools/Source/Python/GenFds/FdfParser.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source= /Python/GenFds/FdfParser.py index 8a9296c..4518d8f 100644 --- a/BaseTools/Source/Python/GenFds/FdfParser.py +++ b/BaseTools/Source/Python/GenFds/FdfParser.py @@ -912,11 +912,10 @@ class FdfParser: # Highest priority =20 return MacroDict =20 def __EvaluateConditional(self, Expression, Line, Op =3D None, Value = =3D None): - FileLineTuple =3D GetRealFileLine(self.FileName, Line) MacroPcdDict =3D self.__CollectMacroPcd() if Op =3D=3D 'eval': try: if Value: return ValueExpression(Expression, MacroPcdDict)(True)= @@ -937,16 +936,16 @@ class FdfParser: Info =3D GlobalData.gPlatformOtherPcds[Excpt.Pcd] raise Warning("Cannot use this PCD (%s) in an expr= ession as" " it must be defined in a [PcdsFixed= AtBuild] or [PcdsFeatureFlag] section" " of the DSC file (%s), and it is cu= rrently defined in this section:" " %s, line #: %d." % (Excpt.Pcd, Glo= balData.gPlatformOtherPcds['DSCFILE'], Info[0], Info[1]), - *FileLineTuple) + self.FileName, Line) else: raise Warning("PCD (%s) is not defined in DSC file= (%s)" % (Excpt.Pcd, GlobalData.gPlatformOtherPcds['DSCFILE']), - *FileLineTuple) + self.FileName, Line) else: - raise Warning(str(Excpt), *FileLineTuple) + raise Warning(str(Excpt), self.FileName, Line) else: if Expression.startswith('$(') and Expression[-1] =3D=3D ')': Expression =3D Expression[2:-1] =20 return Expression in MacroPcdDict =20 -- 2.6.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel