]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Refactor to remove functionally equivalent functions
authorCarsey, Jaben <jaben.carsey@intel.com>
Wed, 29 Aug 2018 14:42:21 +0000 (22:42 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Thu, 30 Aug 2018 13:05:18 +0000 (21:05 +0800)
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 <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
BaseTools/Source/Python/AutoGen/AutoGen.py
BaseTools/Source/Python/Workspace/InfBuildData.py

index 15365e7b1d744166347a6420322b6f7d6c847104..95370d182157243e04153cc0709a5c0b05a0fd94 100644 (file)
@@ -1091,7 +1091,7 @@ class PlatformAutoGen(AutoGen):
             for Inf in self._AsBuildInfList:\r
                 InfClass = PathClass(NormPath(Inf), GlobalData.gWorkspace, self.Arch)\r
                 M = self.BuildDatabase[InfClass, self.Arch, self.BuildTarget, self.ToolChain]\r
-                if not M.IsSupportedArch:\r
+                if not M.IsBinaryModule:\r
                     continue\r
                 self._AsBuildModuleList.append(InfClass)\r
         # get library/modules for build\r
@@ -1346,7 +1346,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)\r
                 # for different Arch. PCDs in source module for different Arch is already added before, so skip the source module here.\r
                 # For binary module, if in current arch, we need to list the PCDs into database.\r
-                if not M.IsSupportedArch:\r
+                if not M.IsBinaryModule:\r
                     continue\r
                 # Override the module PCD setting by platform setting\r
                 ModulePcdList = self.ApplyPcdSetting(M, M.Pcds)\r
index 1325b4f0295a9e6da50c681708333c8706f72e94..d666c092a6de67faac6d9c1408ac07c0c8f9b6a3 100644 (file)
@@ -578,12 +578,7 @@ class InfBuildData(ModuleBuildClassObject):
             EdkLogger.error('build', RESOURCE_NOT_AVAILABLE, ExtraData=ErrorInfo, File=self.MetaFile)\r
 \r
         return Binaries\r
-    ## Check whether it exists the binaries with current ARCH in AsBuild INF\r
-    def _IsSupportedArch(self):\r
-        if self._GetBinaries() and not self._GetSourceFiles():\r
-            return True\r
-        else:\r
-            return False\r
+\r
     ## Retrieve source files\r
     def _GetSourceFiles(self):\r
         # Ignore all source files in a binary build mode\r
@@ -1170,4 +1165,3 @@ class InfBuildData(ModuleBuildClassObject):
     Depex                   = property(_GetDepex)\r
     DepexExpression         = property(_GetDepexExpression)\r
     IsBinaryModule          = property(_IsBinaryModule)\r
-    IsSupportedArch         = property(_IsSupportedArch)\r