BaseTools: Rollback Filter out unused structure pcds
This reverts commit51d17bb7b0. commit51d17bb7b0adds new check of Pcds in the platform unused library INF files. It breaks the existing platform. To avoid the impact, roll back this change first. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob C Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
@@ -282,7 +282,6 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
self._VpdToolGuid = None
|
self._VpdToolGuid = None
|
||||||
self._MacroDict = None
|
self._MacroDict = None
|
||||||
self.DefaultStores = None
|
self.DefaultStores = None
|
||||||
self.UsedStructurePcd = None
|
|
||||||
|
|
||||||
## handle Override Path of Module
|
## handle Override Path of Module
|
||||||
def _HandleOverridePath(self):
|
def _HandleOverridePath(self):
|
||||||
@@ -1470,7 +1469,6 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
else:
|
else:
|
||||||
str_pcd_obj_str.DefaultFromDSC = {skuname:{defaultstore: str_pcd_obj.SkuInfoList[skuname].DefaultStoreDict.get(defaultstore, str_pcd_obj.SkuInfoList[skuname].DefaultValue) for defaultstore in DefaultStores} for skuname in str_pcd_obj.SkuInfoList}
|
str_pcd_obj_str.DefaultFromDSC = {skuname:{defaultstore: str_pcd_obj.SkuInfoList[skuname].DefaultStoreDict.get(defaultstore, str_pcd_obj.SkuInfoList[skuname].DefaultValue) for defaultstore in DefaultStores} for skuname in str_pcd_obj.SkuInfoList}
|
||||||
S_pcd_set[Pcd] = str_pcd_obj_str
|
S_pcd_set[Pcd] = str_pcd_obj_str
|
||||||
self.FilterStrcturePcd(S_pcd_set)
|
|
||||||
if S_pcd_set:
|
if S_pcd_set:
|
||||||
GlobalData.gStructurePcd[self.Arch] = S_pcd_set
|
GlobalData.gStructurePcd[self.Arch] = S_pcd_set
|
||||||
for stru_pcd in S_pcd_set.values():
|
for stru_pcd in S_pcd_set.values():
|
||||||
@@ -1566,23 +1564,6 @@ class DscBuildData(PlatformBuildClassObject):
|
|||||||
|
|
||||||
map(self.FilterSkuSettings, [Pcds[pcdkey] for pcdkey in Pcds if Pcds[pcdkey].Type in DynamicPcdType])
|
map(self.FilterSkuSettings, [Pcds[pcdkey] for pcdkey in Pcds if Pcds[pcdkey].Type in DynamicPcdType])
|
||||||
return Pcds
|
return Pcds
|
||||||
#Filter the StrucutrePcd that is not used by any module in dsc file and fdf file.
|
|
||||||
def FilterStrcturePcd(self, S_pcd_set):
|
|
||||||
if not self.UsedStructurePcd:
|
|
||||||
FdfInfList = []
|
|
||||||
if GlobalData.gFdfParser:
|
|
||||||
FdfInfList = GlobalData.gFdfParser.Profile.InfList
|
|
||||||
FdfModuleList = [PathClass(NormPath(Inf), GlobalData.gWorkspace, Arch=self._Arch) for Inf in FdfInfList]
|
|
||||||
AllModulePcds = set()
|
|
||||||
ModuleSet = set(self._Modules.keys() + self.LibraryInstances + FdfModuleList)
|
|
||||||
for ModuleFile in ModuleSet:
|
|
||||||
ModuleData = self._Bdb[ModuleFile, self._Arch, self._Target, self._Toolchain]
|
|
||||||
AllModulePcds = AllModulePcds | set(ModuleData.Pcds.keys())
|
|
||||||
|
|
||||||
self.UsedStructurePcd = AllModulePcds
|
|
||||||
UnusedStruPcds = set(S_pcd_set.keys()) - self.UsedStructurePcd
|
|
||||||
for (Token, TokenSpaceGuid) in UnusedStruPcds:
|
|
||||||
del S_pcd_set[(Token, TokenSpaceGuid)]
|
|
||||||
|
|
||||||
## Retrieve non-dynamic PCD settings
|
## Retrieve non-dynamic PCD settings
|
||||||
#
|
#
|
||||||
|
|||||||
Reference in New Issue
Block a user