X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FAutoGen%2FAutoGen.py;h=5940e88682edf3486abe0feabb9ba64fe3cce897;hp=3865827f26df751814d3eda57f2636641b7ec082;hb=eca980c0c899;hpb=9006a2c6a35bfa607ddaa6d6c2a0738b65f6da97 diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index 3865827f26..5940e88682 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -46,10 +46,21 @@ import datetime import hashlib from GenVar import VariableMgr,var_info from collections import OrderedDict +from collections import defaultdict ## Regular expression for splitting Dependency Expression string into tokens gDepexTokenPattern = re.compile("(\(|\)|\w+| \S+\.inf)") +## Regular expression for match: PCD(xxxx.yyy) +gPCDAsGuidPattern = re.compile(r"^PCD\(.+\..+\)$") + +# +# Regular expression for finding Include Directories, the difference between MSFT and INTEL/GCC/RVCT +# is the former use /I , the Latter used -I to specify include directories +# +gBuildOptIncludePatternMsft = re.compile(r"(?:.*?)/I[ \t]*([^ ]*)", re.MULTILINE | re.DOTALL) +gBuildOptIncludePatternOther = re.compile(r"(?:.*?)-I[ \t]*([^ ]*)", re.MULTILINE | re.DOTALL) + # # Match name = variable # @@ -354,9 +365,9 @@ class WorkspaceAutoGen(AutoGen): MetaFile_cache = {} for Arch in self.ArchList: Platform_cache[Arch] = self.BuildDatabase[self.MetaFile, Arch, Target, Toolchain] - MetaFile_cache[Arch] = [] - for Pkey in Platform_cache[Arch].Modules.keys(): - MetaFile_cache[Arch].append(Platform_cache[Arch].Modules[Pkey].MetaFile) + MetaFile_cache[Arch] = set() + for Pkey in Platform_cache[Arch].Modules: + MetaFile_cache[Arch].add(Platform_cache[Arch].Modules[Pkey].MetaFile) for Inf in self.FdfProfile.InfDict[key]: ModuleFile = PathClass(NormPath(Inf), GlobalData.gWorkspace, Arch) for Arch in self.ArchList: @@ -371,9 +382,9 @@ class WorkspaceAutoGen(AutoGen): for Arch in self.ArchList: if Arch == key: Platform = self.BuildDatabase[self.MetaFile, Arch, Target, Toolchain] - MetaFileList = [] - for Pkey in Platform.Modules.keys(): - MetaFileList.append(Platform.Modules[Pkey].MetaFile) + MetaFileList = set() + for Pkey in Platform.Modules: + MetaFileList.add(Platform.Modules[Pkey].MetaFile) for Inf in self.FdfProfile.InfDict[key]: ModuleFile = PathClass(NormPath(Inf), GlobalData.gWorkspace, Arch) if ModuleFile in MetaFileList: @@ -400,13 +411,8 @@ class WorkspaceAutoGen(AutoGen): for Arch in self.ArchList: Platform = self.BuildDatabase[self.MetaFile, Arch, Target, Toolchain] - - - - - - SourcePcdDict = {'DynamicEx':[], 'PatchableInModule':[],'Dynamic':[],'FixedAtBuild':[]} - BinaryPcdDict = {'DynamicEx':[], 'PatchableInModule':[]} + SourcePcdDict = {'DynamicEx':set(), 'PatchableInModule':set(),'Dynamic':set(),'FixedAtBuild':set()} + BinaryPcdDict = {'DynamicEx':set(), 'PatchableInModule':set()} SourcePcdDict_Keys = SourcePcdDict.keys() BinaryPcdDict_Keys = BinaryPcdDict.keys() @@ -432,27 +438,21 @@ class WorkspaceAutoGen(AutoGen): if 'DynamicEx' in BuildData.Pcds[key].Type: if BuildData.IsBinaryModule: - if (BuildData.Pcds[key].TokenCName, BuildData.Pcds[key].TokenSpaceGuidCName) not in BinaryPcdDict['DynamicEx']: - BinaryPcdDict['DynamicEx'].append((BuildData.Pcds[key].TokenCName, BuildData.Pcds[key].TokenSpaceGuidCName)) + BinaryPcdDict['DynamicEx'].add((BuildData.Pcds[key].TokenCName, BuildData.Pcds[key].TokenSpaceGuidCName)) else: - if (BuildData.Pcds[key].TokenCName, BuildData.Pcds[key].TokenSpaceGuidCName) not in SourcePcdDict['DynamicEx']: - SourcePcdDict['DynamicEx'].append((BuildData.Pcds[key].TokenCName, BuildData.Pcds[key].TokenSpaceGuidCName)) + SourcePcdDict['DynamicEx'].add((BuildData.Pcds[key].TokenCName, BuildData.Pcds[key].TokenSpaceGuidCName)) elif 'PatchableInModule' in BuildData.Pcds[key].Type: if BuildData.MetaFile.Ext == '.inf': if BuildData.IsBinaryModule: - if (BuildData.Pcds[key].TokenCName, BuildData.Pcds[key].TokenSpaceGuidCName) not in BinaryPcdDict['PatchableInModule']: - BinaryPcdDict['PatchableInModule'].append((BuildData.Pcds[key].TokenCName, BuildData.Pcds[key].TokenSpaceGuidCName)) + BinaryPcdDict['PatchableInModule'].add((BuildData.Pcds[key].TokenCName, BuildData.Pcds[key].TokenSpaceGuidCName)) else: - if (BuildData.Pcds[key].TokenCName, BuildData.Pcds[key].TokenSpaceGuidCName) not in SourcePcdDict['PatchableInModule']: - SourcePcdDict['PatchableInModule'].append((BuildData.Pcds[key].TokenCName, BuildData.Pcds[key].TokenSpaceGuidCName)) + SourcePcdDict['PatchableInModule'].add((BuildData.Pcds[key].TokenCName, BuildData.Pcds[key].TokenSpaceGuidCName)) elif 'Dynamic' in BuildData.Pcds[key].Type: - if (BuildData.Pcds[key].TokenCName, BuildData.Pcds[key].TokenSpaceGuidCName) not in SourcePcdDict['Dynamic']: - SourcePcdDict['Dynamic'].append((BuildData.Pcds[key].TokenCName, BuildData.Pcds[key].TokenSpaceGuidCName)) + SourcePcdDict['Dynamic'].add((BuildData.Pcds[key].TokenCName, BuildData.Pcds[key].TokenSpaceGuidCName)) elif 'FixedAtBuild' in BuildData.Pcds[key].Type: - if (BuildData.Pcds[key].TokenCName, BuildData.Pcds[key].TokenSpaceGuidCName) not in SourcePcdDict['FixedAtBuild']: - SourcePcdDict['FixedAtBuild'].append((BuildData.Pcds[key].TokenCName, BuildData.Pcds[key].TokenSpaceGuidCName)) + SourcePcdDict['FixedAtBuild'].add((BuildData.Pcds[key].TokenCName, BuildData.Pcds[key].TokenSpaceGuidCName)) else: pass # @@ -461,16 +461,14 @@ class WorkspaceAutoGen(AutoGen): for i in SourcePcdDict_Keys: for j in SourcePcdDict_Keys: if i != j: - IntersectionList = list(set(SourcePcdDict[i]).intersection(set(SourcePcdDict[j]))) - if len(IntersectionList) > 0: + Intersections = SourcePcdDict[i].intersection(SourcePcdDict[j]) + if len(Intersections) > 0: EdkLogger.error( 'build', FORMAT_INVALID, "Building modules from source INFs, following PCD use %s and %s access method. It must be corrected to use only one access method." % (i, j), - ExtraData="%s" % '\n\t'.join([str(P[1]+'.'+P[0]) for P in IntersectionList]) + ExtraData="%s" % '\n\t'.join([str(P[1]+'.'+P[0]) for P in Intersections]) ) - else: - pass # # intersection the BinaryPCD for Mixed PCD @@ -478,8 +476,8 @@ class WorkspaceAutoGen(AutoGen): for i in BinaryPcdDict_Keys: for j in BinaryPcdDict_Keys: if i != j: - IntersectionList = list(set(BinaryPcdDict[i]).intersection(set(BinaryPcdDict[j]))) - for item in IntersectionList: + Intersections = BinaryPcdDict[i].intersection(BinaryPcdDict[j]) + for item in Intersections: NewPcd1 = (item[0] + '_' + i, item[1]) NewPcd2 = (item[0] + '_' + j, item[1]) if item not in GlobalData.MixedPcd: @@ -489,8 +487,6 @@ class WorkspaceAutoGen(AutoGen): GlobalData.MixedPcd[item].append(NewPcd1) if NewPcd2 not in GlobalData.MixedPcd[item]: GlobalData.MixedPcd[item].append(NewPcd2) - else: - pass # # intersection the SourcePCD and BinaryPCD for Mixed PCD @@ -498,8 +494,8 @@ class WorkspaceAutoGen(AutoGen): for i in SourcePcdDict_Keys: for j in BinaryPcdDict_Keys: if i != j: - IntersectionList = list(set(SourcePcdDict[i]).intersection(set(BinaryPcdDict[j]))) - for item in IntersectionList: + Intersections = SourcePcdDict[i].intersection(BinaryPcdDict[j]) + for item in Intersections: NewPcd1 = (item[0] + '_' + i, item[1]) NewPcd2 = (item[0] + '_' + j, item[1]) if item not in GlobalData.MixedPcd: @@ -509,8 +505,6 @@ class WorkspaceAutoGen(AutoGen): GlobalData.MixedPcd[item].append(NewPcd1) if NewPcd2 not in GlobalData.MixedPcd[item]: GlobalData.MixedPcd[item].append(NewPcd2) - else: - pass for BuildData in PGen.BuildDatabase._CACHE_.values(): if BuildData.Arch != Arch: @@ -531,11 +525,7 @@ class WorkspaceAutoGen(AutoGen): del BuildData.Pcds[key] BuildData.Pcds[newkey] = Value break - else: - pass break - else: - pass # handle the mixed pcd in FDF file for key in PcdSet: @@ -554,11 +544,11 @@ class WorkspaceAutoGen(AutoGen): ModuleData = self.BuildDatabase[ModuleFile, Arch, Target, Toolchain] PkgSet.update(ModuleData.Packages) Pkgs = list(PkgSet) + list(PGen.PackageList) - DecPcds = {} + DecPcds = set() DecPcdsKey = set() for Pkg in Pkgs: for Pcd in Pkg.Pcds: - DecPcds[Pcd[0], Pcd[1]] = Pkg.Pcds[Pcd] + DecPcds.add((Pcd[0], Pcd[1])) DecPcdsKey.add((Pcd[0], Pcd[1], Pcd[2])) Platform.SkuName = self.SkuId @@ -819,13 +809,11 @@ class WorkspaceAutoGen(AutoGen): InfFoundFlag = False if FfsFile.NameGuid is not None: - _CheckPCDAsGuidPattern = re.compile("^PCD\(.+\..+\)$") - # # If the NameGuid reference a PCD name. # The style must match: PCD(xxxx.yyy) # - if _CheckPCDAsGuidPattern.match(FfsFile.NameGuid): + if gPCDAsGuidPattern.match(FfsFile.NameGuid): # # Replace the PCD value. # @@ -1290,7 +1278,7 @@ class PlatformAutoGen(AutoGen): FixedAtBuildPcds = {} ShareFixedAtBuildPcdsSameValue = {} for Module in LibAuto._ReferenceModules: - for Pcd in Module.FixedAtBuildPcds + LibAuto.FixedAtBuildPcds: + for Pcd in Module.FixedAtBuildPcds: key = ".".join((Pcd.TokenSpaceGuidCName,Pcd.TokenCName)) if key not in FixedAtBuildPcds: ShareFixedAtBuildPcdsSameValue[key] = True @@ -1307,7 +1295,7 @@ class PlatformAutoGen(AutoGen): if DscPcd.Type != "FixedAtBuild": continue if key in ShareFixedAtBuildPcdsSameValue and ShareFixedAtBuildPcdsSameValue[key]: - LibAuto.ConstPcd[key] = Pcd.DefaultValue + LibAuto.ConstPcd[key] = FixedAtBuildPcds[key] def CollectVariables(self, DynamicPcdSet): @@ -1400,8 +1388,6 @@ class PlatformAutoGen(AutoGen): # for gathering error information NoDatumTypePcdList = set() - PcdNotInDb = [] - self._GuidValue = {} FdfModuleList = [] for InfName in self._AsBuildInfList: InfName = mws.join(self.WorkspaceDir, InfName) @@ -1439,8 +1425,6 @@ class PlatformAutoGen(AutoGen): if PcdFromModule.Type in GenC.gDynamicPcd and \ PcdFromModule.IsFromBinaryInf == False: # Print warning message to let the developer make a determine. - if PcdFromModule not in PcdNotInDb: - PcdNotInDb.append(PcdFromModule) continue # If one of the Source built modules listed in the DSC is not listed in # FDF modules, and the INF lists a PCD can only use the PcdsDynamicEx @@ -1448,8 +1432,6 @@ class PlatformAutoGen(AutoGen): # PCD as PcdsDynamicEx), then DO NOT break the build; DO NOT add the # PCD to the Platform's PCD Database. if PcdFromModule.Type in GenC.gDynamicExPcd: - if PcdFromModule not in PcdNotInDb: - PcdNotInDb.append(PcdFromModule) continue # # If a dynamic PCD used by a PEM module/PEI module & DXE module, @@ -1930,7 +1912,6 @@ class PlatformAutoGen(AutoGen): self._ToolDefinitions[Tool][Attr] = Value ToolsDef = '' - MakePath = '' if GlobalData.gOptions.SilentMode and "MAKE" in self._ToolDefinitions: if "FLAGS" not in self._ToolDefinitions["MAKE"]: self._ToolDefinitions["MAKE"]["FLAGS"] = "" @@ -1951,9 +1932,7 @@ class PlatformAutoGen(AutoGen): if Attr == "PATH": # Don't put MAKE definition in the file - if Tool == "MAKE": - MakePath = Value - else: + if Tool != "MAKE": ToolsDef += "%s = %s\n" % (Tool, Value) elif Attr != "DLL": # Don't put MAKE definition in the file @@ -2373,17 +2352,15 @@ class PlatformAutoGen(AutoGen): ToPcd.Type, Module, FromPcd.Type), File=self.MetaFile) - if FromPcd.MaxDatumSize not in [None, '']: + if FromPcd.MaxDatumSize: ToPcd.MaxDatumSize = FromPcd.MaxDatumSize - if FromPcd.DefaultValue not in [None, '']: + if FromPcd.DefaultValue: ToPcd.DefaultValue = FromPcd.DefaultValue - if FromPcd.TokenValue not in [None, '']: + if FromPcd.TokenValue: ToPcd.TokenValue = FromPcd.TokenValue - if FromPcd.MaxDatumSize not in [None, '']: - ToPcd.MaxDatumSize = FromPcd.MaxDatumSize - if FromPcd.DatumType not in [None, '']: + if FromPcd.DatumType: ToPcd.DatumType = FromPcd.DatumType - if FromPcd.SkuInfoList not in [None, '', []]: + if FromPcd.SkuInfoList: ToPcd.SkuInfoList = FromPcd.SkuInfoList # Add Flexible PCD format parse if ToPcd.DefaultValue: @@ -2709,40 +2686,31 @@ class PlatformAutoGen(AutoGen): AllTools = set(ModuleOptions.keys() + PlatformOptions.keys() + PlatformModuleOptions.keys() + ModuleTypeOptions.keys() + self.ToolDefinition.keys()) - BuildOptions = {} + BuildOptions = defaultdict(lambda: defaultdict(str)) for Tool in AllTools: - if Tool not in BuildOptions: - BuildOptions[Tool] = {} - for Options in [self.ToolDefinition, ModuleOptions, PlatformOptions, ModuleTypeOptions, PlatformModuleOptions]: if Tool not in Options: continue for Attr in Options[Tool]: - Value = Options[Tool][Attr] # # Do not generate it in Makefile # if Attr == TAB_TOD_DEFINES_BUILDRULEORDER: continue - if Attr not in BuildOptions[Tool]: - BuildOptions[Tool][Attr] = "" + Value = Options[Tool][Attr] # check if override is indicated if Value.startswith('='): - ToolPath = Value[1:] - ToolPath = mws.handleWsMacro(ToolPath) - BuildOptions[Tool][Attr] = ToolPath + BuildOptions[Tool][Attr] = mws.handleWsMacro(Value[1:]) else: - Value = mws.handleWsMacro(Value) if Attr != 'PATH': - BuildOptions[Tool][Attr] += " " + Value + BuildOptions[Tool][Attr] += " " + mws.handleWsMacro(Value) else: - BuildOptions[Tool][Attr] = Value + BuildOptions[Tool][Attr] = mws.handleWsMacro(Value) + if Module.AutoGenVersion < 0x00010005 and self.Workspace.UniFlag is not None: # # Override UNI flag only for EDK module. # - if 'BUILD' not in BuildOptions: - BuildOptions['BUILD'] = {} BuildOptions['BUILD']['FLAGS'] = self.Workspace.UniFlag return BuildOptions, BuildRuleOrder @@ -3316,9 +3284,9 @@ class ModuleAutoGen(AutoGen): # is the former use /I , the Latter used -I to specify include directories # if self.PlatformInfo.ToolChainFamily in ('MSFT'): - gBuildOptIncludePattern = re.compile(r"(?:.*?)/I[ \t]*([^ ]*)", re.MULTILINE | re.DOTALL) + BuildOptIncludeRegEx = gBuildOptIncludePatternMsft elif self.PlatformInfo.ToolChainFamily in ('INTEL', 'GCC', 'RVCT'): - gBuildOptIncludePattern = re.compile(r"(?:.*?)-I[ \t]*([^ ]*)", re.MULTILINE | re.DOTALL) + BuildOptIncludeRegEx = gBuildOptIncludePatternOther else: # # New ToolChainFamily, don't known whether there is option to specify include directories @@ -3335,13 +3303,13 @@ class ModuleAutoGen(AutoGen): FlagOption = '' if self.PlatformInfo.ToolChainFamily != 'RVCT': - IncPathList = [NormPath(Path, self.Macros) for Path in gBuildOptIncludePattern.findall(FlagOption)] + IncPathList = [NormPath(Path, self.Macros) for Path in BuildOptIncludeRegEx.findall(FlagOption)] else: # # RVCT may specify a list of directory seperated by commas # IncPathList = [] - for Path in gBuildOptIncludePattern.findall(FlagOption): + for Path in BuildOptIncludeRegEx.findall(FlagOption): PathList = GetSplitList(Path, TAB_COMMA_SPLIT) IncPathList += [NormPath(PathEntry, self.Macros) for PathEntry in PathList] @@ -3496,8 +3464,8 @@ class ModuleAutoGen(AutoGen): if self._BuildTargets is None: self._IntroBuildTargetList = set() self._FinalBuildTargetList = set() - self._BuildTargets = {} - self._FileTypes = {} + self._BuildTargets = defaultdict(set) + self._FileTypes = defaultdict(set) SubDirectory = os.path.join(self.OutputDir, File.SubDir) if not os.path.exists(SubDirectory): @@ -3534,8 +3502,6 @@ class ModuleAutoGen(AutoGen): break FileType = RuleObject.SourceFileType - if FileType not in self._FileTypes: - self._FileTypes[FileType] = set() self._FileTypes[FileType].add(Source) # stop at STATIC_LIBRARY for library @@ -3553,8 +3519,6 @@ class ModuleAutoGen(AutoGen): # Only do build for target with outputs self._FinalBuildTargetList.add(Target) - if FileType not in self._BuildTargets: - self._BuildTargets[FileType] = set() self._BuildTargets[FileType].add(Target) if not Source.IsBinary and Source == File: @@ -3573,8 +3537,8 @@ class ModuleAutoGen(AutoGen): if self._BuildTargets is None: self._IntroBuildTargetList = set() self._FinalBuildTargetList = set() - self._BuildTargets = {} - self._FileTypes = {} + self._BuildTargets = defaultdict(set) + self._FileTypes = defaultdict(set) #TRICK: call _GetSourceFileList to apply build rule for source files if self.SourceFileList: @@ -3814,7 +3778,7 @@ class ModuleAutoGen(AutoGen): if not self.SourceFileList: return [] - NameGuids = [] + NameGuids = set() for SrcFile in self.SourceFileList: if SrcFile.Ext.lower() != '.vfr': continue @@ -3846,7 +3810,7 @@ class ModuleAutoGen(AutoGen): if not Guid: break NameArray = ConvertStringToByteArray('L"' + Name.group(1) + '"') - NameGuids.append((NameArray, GuidStructureStringToGuidString(Guid.group(1)))) + NameGuids.add((NameArray, GuidStructureStringToGuidString(Guid.group(1)))) Pos = Content.find('efivarstore', Name.end()) if not NameGuids: return [] @@ -3921,7 +3885,6 @@ class ModuleAutoGen(AutoGen): VfrGuid = [0xb4, 0x7c, 0xbc, 0xd0, 0x47, 0x6a, 0x5f, 0x49, 0xaa, 0x11, 0x71, 0x7, 0x46, 0xda, 0x6, 0xa2] VfrGuid = [chr(ItemGuid) for ItemGuid in VfrGuid] fStringIO.write(''.join(VfrGuid)) - type (Item[1]) VfrValue = pack ('Q', int (Item[1], 16)) fStringIO.write (VfrValue) # @@ -3940,7 +3903,7 @@ class ModuleAutoGen(AutoGen): ## Create AsBuilt INF file the module # def CreateAsBuiltInf(self, IsOnlyCopy = False): - self.OutputFile = [] + self.OutputFile = set() if IsOnlyCopy: if GlobalData.gBinCacheDest: self.CopyModuleToCache() @@ -3958,11 +3921,11 @@ class ModuleAutoGen(AutoGen): return # Skip the following code for modules with no source files - if self.SourceFileList is None or self.SourceFileList == []: + if not self.SourceFileList: return # Skip the following code for modules without any binary files - if self.BinaryFileList <> None and self.BinaryFileList <> []: + if not self.BinaryFileList: return ### TODO: How to handles mixed source and binary modules @@ -4081,8 +4044,7 @@ class ModuleAutoGen(AutoGen): DebugDir = self.DebugDir.replace('\\', '/').strip('/') for Item in self.CodaTargetList: File = Item.Target.Path.replace('\\', '/').strip('/').replace(DebugDir, '').replace(OutputDir, '').strip('/') - if File not in self.OutputFile: - self.OutputFile.append(File) + self.OutputFile.add(File) if os.path.isabs(File): File = File.replace('\\', '/').strip('/').replace(OutputDir, '').strip('/') if Item.Target.Ext.lower() == '.aml': @@ -4094,8 +4056,7 @@ class ModuleAutoGen(AutoGen): else: AsBuiltInfDict['binary_item'] += ['BIN|' + File] if self.DepexGenerated: - if self.Name + '.depex' not in self.OutputFile: - self.OutputFile.append(self.Name + '.depex') + self.OutputFile.add(self.Name + '.depex') if self.ModuleType in ['PEIM']: AsBuiltInfDict['binary_item'] += ['PEI_DEPEX|' + self.Name + '.depex'] if self.ModuleType in ['DXE_DRIVER', 'DXE_RUNTIME_DRIVER', 'DXE_SAL_DRIVER', 'UEFI_DRIVER']: @@ -4106,15 +4067,13 @@ class ModuleAutoGen(AutoGen): Bin = self._GenOffsetBin() if Bin: AsBuiltInfDict['binary_item'] += ['BIN|%s' % Bin] - if Bin not in self.OutputFile: - self.OutputFile.append(Bin) + self.OutputFile.add(Bin) for Root, Dirs, Files in os.walk(OutputDir): for File in Files: if File.lower().endswith('.pdb'): AsBuiltInfDict['binary_item'] += ['DISPOSABLE|' + File] - if File not in self.OutputFile: - self.OutputFile.append(File) + self.OutputFile.add(File) HeaderComments = self.Module.HeaderComments StartPos = 0 for Index in range(len(HeaderComments)): @@ -4220,7 +4179,7 @@ class ModuleAutoGen(AutoGen): PcdItem = PcdComments + '\n ' + PcdItem AsBuiltInfDict['patchablepcd_item'].append(PcdItem) - HiiPcds = [] + HiiPcds = set() for Pcd in Pcds + VfrPcds: PcdComments = '' PcdCommentList = [] @@ -4243,8 +4202,7 @@ class ModuleAutoGen(AutoGen): # if (SkuId, Pcd.TokenSpaceGuidCName, Pcd.TokenCName) in HiiPcds: continue - else: - HiiPcds.append((SkuId, Pcd.TokenSpaceGuidCName, Pcd.TokenCName)) + HiiPcds.add((SkuId, Pcd.TokenSpaceGuidCName, Pcd.TokenCName)) if (Pcd.TokenSpaceGuidCName, Pcd.TokenCName) in self._PcdComments: PcdCommentList = self._PcdComments[Pcd.TokenSpaceGuidCName, Pcd.TokenCName][:] if HiiInfo: