From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.93; helo=mga11.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 5FB9F21107197 for ; Thu, 30 Aug 2018 06:02:57 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Aug 2018 06:02:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,306,1531810800"; d="scan'208";a="79580658" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga003.jf.intel.com with ESMTP; 30 Aug 2018 06:02:56 -0700 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 30 Aug 2018 06:02:56 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 30 Aug 2018 06:02:56 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.240]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.185]) with mapi id 14.03.0319.002; Thu, 30 Aug 2018 21:02:53 +0800 From: "Zhu, Yonghong" To: "Carsey, Jaben" , "edk2-devel@lists.01.org" CC: "Gao, Liming" , "Zhu, Yonghong" Thread-Topic: [PATCH v1 1/1] BaseTools: Refactor to remove functionally equivalent functions Thread-Index: AQHUP6aF5fBX+ArxiEqI/q8Byc7Oz6TYRCow Date: Thu, 30 Aug 2018 13:02:53 +0000 Message-ID: References: <55e43fe041371a7fce5a192d245fb9a69f31b64e.1535412668.git.jaben.carsey@intel.com> In-Reply-To: <55e43fe041371a7fce5a192d245fb9a69f31b64e.1535412668.git.jaben.carsey@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 v1 1/1] BaseTools: Refactor to remove functionally equivalent functions X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2018 13:02:57 -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: Carsey, Jaben=20 Sent: Wednesday, August 29, 2018 10:42 PM To: edk2-devel@lists.01.org Cc: Zhu, Yonghong ; Gao, Liming Subject: [PATCH v1 1/1] BaseTools: Refactor to remove functionally equivale= nt functions IsSupportedArch and IsBinaryModule return the same value under the same cur= cimstances. Remove newer one with fewer callers and send them to the other= function. Cc: Yonghong Zhu Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/AutoGen/AutoGen.py | 4 ++-- BaseTools/Source/Python/Workspace/InfBuildData.py | 8 +------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/= Python/AutoGen/AutoGen.py index eb1b28388967..5c0df45bb90a 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -1092,7 +1092,7 @@ class PlatformAutoGen(AutoGen): for Inf in self._AsBuildInfList: InfClass =3D PathClass(NormPath(Inf), GlobalData.gWorkspac= e, self.Arch) M =3D self.BuildDatabase[InfClass, self.Arch, self.BuildTa= rget, self.ToolChain] - if not M.IsSupportedArch: + if not M.IsBinaryModule: continue self._AsBuildModuleList.append(InfClass) # get library/modules for build @@ -1347,7 +1347,7 @@ class Platfo= rmAutoGen(AutoGen): # If a module INF in FDF but not in current arch's DSC mod= ule list, it must be module (either binary or source) # for different Arch. PCDs in source module for different = Arch is already added before, so skip the source module here. # For binary module, if in current arch, we need to list t= he PCDs into database. - if not M.IsSupportedArch: + if not M.IsBinaryModule: continue # Override the module PCD setting by platform setting ModulePcdList =3D self.ApplyPcdSetting(M, M.Pcds) diff --g= it a/BaseTools/Source/Python/Workspace/InfBuildData.py b/BaseTools/Source/P= ython/Workspace/InfBuildData.py index 7c3d712efe63..44ced491ad55 100644 --- a/BaseTools/Source/Python/Workspace/InfBuildData.py +++ b/BaseTools/Source/Python/Workspace/InfBuildData.py @@ -578,12 +578,7 @@ class InfBuildData(ModuleBuildClassObject): EdkLogger.error('build', RESOURCE_NOT_AVAILABLE, ExtraData=3DE= rrorInfo, File=3Dself.MetaFile) =20 return Binaries - ## Check whether it exists the binaries with current ARCH in AsBuild I= NF - def _IsSupportedArch(self): - if self._GetBinaries() and not self._GetSourceFiles(): - return True - else: - return False + ## Retrieve source files def _GetSourceFiles(self): # Ignore all source files in a binary build mode @@ -1170,4 +1165,= 3 @@ class InfBuildData(ModuleBuildClassObject): Depex =3D property(_GetDepex) DepexExpression =3D property(_GetDepexExpression) IsBinaryModule =3D property(_IsBinaryModule) - IsSupportedArch =3D property(_IsSupportedArch) -- 2.16.2.windows.1