BaseTools: Sort PCD by token space first then by PcdCName

Sort PCD by token space first, then by PcdCName in the build report.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
This commit is contained in:
Yunhua Feng 2018-05-24 11:25:21 +08:00 committed by Yonghong Zhu
parent 8653ea2088
commit 238d9b5c64
1 changed files with 172 additions and 168 deletions

View File

@ -927,19 +927,23 @@ class PcdReport(object):
FileWrite(File, gSubSectionStart) FileWrite(File, gSubSectionStart)
FileWrite(File, TAB_BRG_PCD) FileWrite(File, TAB_BRG_PCD)
FileWrite(File, gSubSectionSep) FileWrite(File, gSubSectionSep)
AllPcdDict = {}
for Key in PcdDict: for Key in PcdDict:
AllPcdDict[Key] = {}
for Type in PcdDict[Key]:
for Pcd in PcdDict[Key][Type]:
AllPcdDict[Key][(Pcd.TokenCName, Type)] = Pcd
for Key in sorted(AllPcdDict):
# #
# Group PCD by their token space GUID C Name # Group PCD by their token space GUID C Name
# #
First = True First = True
for Type in PcdDict[Key]: for PcdTokenCName, Type in sorted(AllPcdDict[Key]):
# #
# Group PCD by their usage type # Group PCD by their usage type
# #
Pcd = AllPcdDict[Key][(PcdTokenCName, Type)]
TypeName, DecType = gPcdTypeMap.get(Type, ("", Type)) TypeName, DecType = gPcdTypeMap.get(Type, ("", Type))
for Pcd in PcdDict[Key][Type]:
PcdTokenCName = Pcd.TokenCName
MixedPcdFlag = False MixedPcdFlag = False
if GlobalData.MixedPcd: if GlobalData.MixedPcd:
for PcdKey in GlobalData.MixedPcd: for PcdKey in GlobalData.MixedPcd:
@ -1106,11 +1110,11 @@ class PcdReport(object):
continue continue
IsByteArray, ArrayList = ByteArrayForamt(ModuleDefault.strip()) IsByteArray, ArrayList = ByteArrayForamt(ModuleDefault.strip())
if IsByteArray: if IsByteArray:
FileWrite(File, ' *M %-*s = %s' % (self.MaxLen + 19, ModulePath, '{')) FileWrite(File, ' *M %-*s = %s' % (self.MaxLen + 15, ModulePath, '{'))
for Array in ArrayList: for Array in ArrayList:
FileWrite(File, '%s' % (Array)) FileWrite(File, '%s' % (Array))
else: else:
FileWrite(File, ' *M %-*s = %s' % (self.MaxLen + 19, ModulePath, ModuleDefault.strip())) FileWrite(File, ' *M %-*s = %s' % (self.MaxLen + 15, ModulePath, ModuleDefault.strip()))
if ModulePcdSet is None: if ModulePcdSet is None:
FileWrite(File, gSectionEnd) FileWrite(File, gSectionEnd)