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.136; helo=mga12.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (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 CDA8B21106C6B for ; Wed, 29 Aug 2018 07:42:25 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Aug 2018 07:42:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,303,1531810800"; d="scan'208";a="85942772" Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga001.jf.intel.com with ESMTP; 29 Aug 2018 07:42:24 -0700 From: Jaben Carsey To: edk2-devel@lists.01.org Cc: Yonghong Zhu , Liming Gao Date: Wed, 29 Aug 2018 07:42:21 -0700 Message-Id: <55e43fe041371a7fce5a192d245fb9a69f31b64e.1535412668.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: Subject: [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: Wed, 29 Aug 2018 14:42:26 -0000 IsSupportedArch and IsBinaryModule return the same value under the same curcimstances. 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 = PathClass(NormPath(Inf), GlobalData.gWorkspace, self.Arch) M = self.BuildDatabase[InfClass, self.Arch, self.BuildTarget, 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 PlatformAutoGen(AutoGen): # If a module INF in FDF but not in current arch's DSC module 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 the PCDs into database. - if not M.IsSupportedArch: + if not M.IsBinaryModule: continue # Override the module PCD setting by platform setting ModulePcdList = self.ApplyPcdSetting(M, M.Pcds) diff --git a/BaseTools/Source/Python/Workspace/InfBuildData.py b/BaseTools/Source/Python/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=ErrorInfo, File=self.MetaFile) return Binaries - ## Check whether it exists the binaries with current ARCH in AsBuild INF - 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 = property(_GetDepex) DepexExpression = property(_GetDepexExpression) IsBinaryModule = property(_IsBinaryModule) - IsSupportedArch = property(_IsSupportedArch) -- 2.16.2.windows.1