* [Patch] BaseTools: Rollback Filter out unused structure pcds
@ 2018-10-26 14:34 BobCF
2018-10-27 7:26 ` Gao, Liming
0 siblings, 1 reply; 2+ messages in thread
From: BobCF @ 2018-10-26 14:34 UTC (permalink / raw)
To: edk2-devel; +Cc: Bob C Feng, Liming Gao
This reverts commit 51d17bb7b0da0d9c9e91c226f1982d7020f43795.
commit 51d17bb7b0da0d9c9e91c226f1982d7020f43795 adds 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>
---
.../Source/Python/Workspace/DscBuildData.py | 19 -------------------
1 file changed, 19 deletions(-)
diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py
index 9882a36df8..6d596b2b54 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -280,11 +280,10 @@ class DscBuildData(PlatformBuildClassObject):
self._RFCLanguages = None
self._ISOLanguages = None
self._VpdToolGuid = None
self._MacroDict = None
self.DefaultStores = None
- self.UsedStructurePcd = None
## handle Override Path of Module
def _HandleOverridePath(self):
RecordList = self._RawData[MODEL_META_DATA_COMPONENT, self._Arch]
for Record in RecordList:
@@ -1468,11 +1467,10 @@ class DscBuildData(PlatformBuildClassObject):
if str_pcd_obj.Type in [self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII], self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]]:
str_pcd_obj_str.DefaultFromDSC = {skuname:{defaultstore: str_pcd_obj.SkuInfoList[skuname].DefaultStoreDict.get(defaultstore, str_pcd_obj.SkuInfoList[skuname].HiiDefaultValue) for defaultstore in DefaultStores} for skuname in str_pcd_obj.SkuInfoList}
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}
S_pcd_set[Pcd] = str_pcd_obj_str
- self.FilterStrcturePcd(S_pcd_set)
if S_pcd_set:
GlobalData.gStructurePcd[self.Arch] = S_pcd_set
for stru_pcd in S_pcd_set.values():
for skuid in SkuIds:
if skuid in stru_pcd.SkuOverrideValues:
@@ -1564,27 +1562,10 @@ class DscBuildData(PlatformBuildClassObject):
elif TAB_DEFAULT in pcd.SkuInfoList and TAB_COMMON in pcd.SkuInfoList:
del pcd.SkuInfoList[TAB_COMMON]
map(self.FilterSkuSettings, [Pcds[pcdkey] for pcdkey in Pcds if Pcds[pcdkey].Type in DynamicPcdType])
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
#
# @param Type PCD type
#
--
2.18.0.windows.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Patch] BaseTools: Rollback Filter out unused structure pcds
2018-10-26 14:34 [Patch] BaseTools: Rollback Filter out unused structure pcds BobCF
@ 2018-10-27 7:26 ` Gao, Liming
0 siblings, 0 replies; 2+ messages in thread
From: Gao, Liming @ 2018-10-27 7:26 UTC (permalink / raw)
To: Feng, Bob C, edk2-devel@lists.01.org
Reviewed-by: Liming Gao <liming.gao@intel.com>
> -----Original Message-----
> From: Feng, Bob C
> Sent: Friday, October 26, 2018 10:35 PM
> To: edk2-devel@lists.01.org
> Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <liming.gao@intel.com>
> Subject: [Patch] BaseTools: Rollback Filter out unused structure pcds
>
> This reverts commit 51d17bb7b0da0d9c9e91c226f1982d7020f43795.
> commit 51d17bb7b0da0d9c9e91c226f1982d7020f43795 adds 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>
> ---
> .../Source/Python/Workspace/DscBuildData.py | 19 -------------------
> 1 file changed, 19 deletions(-)
>
> diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py
> index 9882a36df8..6d596b2b54 100644
> --- a/BaseTools/Source/Python/Workspace/DscBuildData.py
> +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
> @@ -280,11 +280,10 @@ class DscBuildData(PlatformBuildClassObject):
> self._RFCLanguages = None
> self._ISOLanguages = None
> self._VpdToolGuid = None
> self._MacroDict = None
> self.DefaultStores = None
> - self.UsedStructurePcd = None
>
> ## handle Override Path of Module
> def _HandleOverridePath(self):
> RecordList = self._RawData[MODEL_META_DATA_COMPONENT, self._Arch]
> for Record in RecordList:
> @@ -1468,11 +1467,10 @@ class DscBuildData(PlatformBuildClassObject):
> if str_pcd_obj.Type in [self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII],
> self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]]:
> str_pcd_obj_str.DefaultFromDSC = {skuname:{defaultstore:
> str_pcd_obj.SkuInfoList[skuname].DefaultStoreDict.get(defaultstore, str_pcd_obj.SkuInfoList[skuname].HiiDefaultValue) for defaultstore
> in DefaultStores} for skuname in str_pcd_obj.SkuInfoList}
> 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}
> S_pcd_set[Pcd] = str_pcd_obj_str
> - self.FilterStrcturePcd(S_pcd_set)
> if S_pcd_set:
> GlobalData.gStructurePcd[self.Arch] = S_pcd_set
> for stru_pcd in S_pcd_set.values():
> for skuid in SkuIds:
> if skuid in stru_pcd.SkuOverrideValues:
> @@ -1564,27 +1562,10 @@ class DscBuildData(PlatformBuildClassObject):
> elif TAB_DEFAULT in pcd.SkuInfoList and TAB_COMMON in pcd.SkuInfoList:
> del pcd.SkuInfoList[TAB_COMMON]
>
> map(self.FilterSkuSettings, [Pcds[pcdkey] for pcdkey in Pcds if Pcds[pcdkey].Type in DynamicPcdType])
> 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
> #
> # @param Type PCD type
> #
> --
> 2.18.0.windows.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-10-27 7:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-26 14:34 [Patch] BaseTools: Rollback Filter out unused structure pcds BobCF
2018-10-27 7:26 ` Gao, Liming
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox