From nobody Sat May 4 18:47:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1522970054166563.6059259568293; Thu, 5 Apr 2018 16:14:14 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 6CBF32265A8AE; Thu, 5 Apr 2018 16:14:08 -0700 (PDT) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E8ABD226FAA78 for ; Thu, 5 Apr 2018 16:14:06 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Apr 2018 16:14:06 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.141]) by orsmga004.jf.intel.com with ESMTP; 05 Apr 2018 16:14:05 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,412,1517904000"; d="scan'208";a="189047081" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Thu, 5 Apr 2018 16:13:49 -0700 Message-Id: <0a8ccd81d619fd57af01064183fce34bbed20bcc.1522969978.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 01/14] BaseTools: remove unused file X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" ToolsDefClassObject didnt need Dictionary, it needed an import from there. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/Common/Dictionary.py | 76 ----------------= ---- BaseTools/Source/Python/Common/ToolDefClassObject.py | 7 +- 2 files changed, 5 insertions(+), 78 deletions(-) diff --git a/BaseTools/Source/Python/Common/Dictionary.py b/BaseTools/Sourc= e/Python/Common/Dictionary.py deleted file mode 100644 index f653275ff13f..000000000000 --- a/BaseTools/Source/Python/Common/Dictionary.py +++ /dev/null @@ -1,76 +0,0 @@ -## @file -# Define a dictionary structure -# -# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
-# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BS= D License -# which accompanies this distribution. The full text of the license may b= e found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -# - -## -# Import Modules -# -import EdkLogger -from DataType import * -from Common.LongFilePathSupport import OpenLongFilePath as open - -## Convert a text file to a dictionary -# -# Convert a text file to a dictionary of (name:value) pairs. -# -# @retval 0 Convert successful -# @retval 1 Open file failed -# -def ConvertTextFileToDictionary(FileName, Dictionary, CommentCharacter, Ke= ySplitCharacter, ValueSplitFlag, ValueSplitCharacter): - try: - F =3D open(FileName, 'r') - Keys =3D [] - for Line in F: - if Line.startswith(CommentCharacter): - continue - LineList =3D Line.split(KeySplitCharacter, 1) - if len(LineList) >=3D 2: - Key =3D LineList[0].split() - if len(Key) =3D=3D 1 and Key[0][0] !=3D CommentCharacter and K= ey[0] not in Keys: - if ValueSplitFlag: - Dictionary[Key[0]] =3D LineList[1].replace('\\', '/').= split(ValueSplitCharacter) - else: - Dictionary[Key[0]] =3D LineList[1].strip().replace('\\= ', '/') - Keys +=3D [Key[0]] - F.close() - return 0 - except: - EdkLogger.info('Open file failed') - return 1 - -## Print the dictionary -# -# Print all items of dictionary one by one -# -# @param Dict: The dictionary to be printed -# -def printDict(Dict): - if Dict is not None: - KeyList =3D Dict.keys() - for Key in KeyList: - if Dict[Key] !=3D '': - print Key + ' =3D ' + str(Dict[Key]) - -## Print the dictionary -# -# Print the items of dictionary which matched with input key -# -# @param list: The dictionary to be printed -# @param key: The key of the item to be printed -# -def printList(Key, List): - if type(List) =3D=3D type([]): - if len(List) > 0: - if Key.find(TAB_SPLIT) !=3D -1: - print "\n" + Key - for Item in List: - print Item diff --git a/BaseTools/Source/Python/Common/ToolDefClassObject.py b/BaseToo= ls/Source/Python/Common/ToolDefClassObject.py index 1ab848f1ec68..73ebdaf6b179 100644 --- a/BaseTools/Source/Python/Common/ToolDefClassObject.py +++ b/BaseTools/Source/Python/Common/ToolDefClassObject.py @@ -1,7 +1,7 @@ ## @file # This file is used to define each component of tools_def.txt file # -# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BS= D License # which accompanies this distribution. The full text of the license may b= e found at @@ -18,7 +18,6 @@ import Common.LongFilePathOs as os import re import EdkLogger =20 -from Dictionary import * from BuildToolError import * from TargetTxtClassObject import * from Common.LongFilePathSupport import OpenLongFilePath as open @@ -27,6 +26,10 @@ from Common.String import NormPath import Common.GlobalData as GlobalData from Common import GlobalData from Common.MultipleWorkspace import MultipleWorkspace as mws +from DataType import TAB_TOD_DEFINES_TARGET,TAB_TOD_DEFINES_TOOL_CHAIN_TAG= ,\ + TAB_TOD_DEFINES_TARGET_ARCH,TAB_TOD_DEFINES_COMMAND_T= YPE\ + ,TAB_TOD_DEFINES_FAMILY,TAB_TOD_DEFINES_BUILDRULEFAMI= LY + =20 ## # Static variables used for pattern --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat May 4 18:47:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1522970056882707.2178940593644; Thu, 5 Apr 2018 16:14:16 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 9782A2265A8B2; Thu, 5 Apr 2018 16:14:08 -0700 (PDT) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1B7B5226FAA94 for ; Thu, 5 Apr 2018 16:14:07 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Apr 2018 16:14:06 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.141]) by orsmga004.jf.intel.com with ESMTP; 05 Apr 2018 16:14:05 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,412,1517904000"; d="scan'208";a="189047084" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Thu, 5 Apr 2018 16:13:50 -0700 Message-Id: <75515aa0980f51c3ee569df1725632150592f906.1522969978.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 02/14] BaseTools: remove uncalled functions X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/Common/TargetTxtClassObject.py | 27 --------------= ------ 1 file changed, 27 deletions(-) diff --git a/BaseTools/Source/Python/Common/TargetTxtClassObject.py b/BaseT= ools/Source/Python/Common/TargetTxtClassObject.py index 0ba7725dd5b5..f8459c892e36 100644 --- a/BaseTools/Source/Python/Common/TargetTxtClassObject.py +++ b/BaseTools/Source/Python/Common/TargetTxtClassObject.py @@ -137,33 +137,6 @@ class TargetTxtClassObject(object): F.close() return 0 =20 - ## Print the dictionary - # - # Print all items of dictionary one by one - # - # @param Dict: The dictionary to be printed - # - def printDict(Dict): - if Dict is not None: - KeyList =3D Dict.keys() - for Key in KeyList: - if Dict[Key] !=3D '': - print Key + ' =3D ' + str(Dict[Key]) - - ## Print the dictionary - # - # Print the items of dictionary which matched with input key - # - # @param list: The dictionary to be printed - # @param key: The key of the item to be printed - # - def printList(Key, List): - if type(List) =3D=3D type([]): - if len(List) > 0: - if Key.find(TAB_SPLIT) !=3D -1: - print "\n" + Key - for Item in List: - print Item ## TargetTxtDict # # Load target.txt in input Conf dir --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat May 4 18:47:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1522970059455476.7956695703009; Thu, 5 Apr 2018 16:14:19 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id BC9032265A8D4; Thu, 5 Apr 2018 16:14:09 -0700 (PDT) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 41E5C226FAA78 for ; Thu, 5 Apr 2018 16:14:07 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Apr 2018 16:14:06 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.141]) by orsmga004.jf.intel.com with ESMTP; 05 Apr 2018 16:14:05 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,412,1517904000"; d="scan'208";a="189047086" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Thu, 5 Apr 2018 16:13:51 -0700 Message-Id: <5118dff3c392dcc7f3acc63d0f562327ca3c963f.1522969978.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 03/14] BaseTools: defaultdict(set) allows us to just add to the set X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" New sets will get created automatically when needed Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/AutoGen.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/= Python/AutoGen/AutoGen.py index 3384fdb70b7e..91a0742a33be 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -45,6 +45,7 @@ import InfSectionParser import datetime import hashlib from GenVar import VariableMgr,var_info +from collections import defaultdict =20 ## Regular expression for splitting Dependency Expression string into toke= ns gDepexTokenPattern =3D re.compile("(\(|\)|\w+| \S+\.inf)") @@ -3495,8 +3496,8 @@ class ModuleAutoGen(AutoGen): if self._BuildTargets is None: self._IntroBuildTargetList =3D set() self._FinalBuildTargetList =3D set() - self._BuildTargets =3D {} - self._FileTypes =3D {} + self._BuildTargets =3D defaultdict(set) + self._FileTypes =3D defaultdict(set) =20 SubDirectory =3D os.path.join(self.OutputDir, File.SubDir) if not os.path.exists(SubDirectory): @@ -3533,8 +3534,6 @@ class ModuleAutoGen(AutoGen): break =20 FileType =3D RuleObject.SourceFileType - if FileType not in self._FileTypes: - self._FileTypes[FileType] =3D set() self._FileTypes[FileType].add(Source) =20 # stop at STATIC_LIBRARY for library @@ -3552,8 +3551,6 @@ class ModuleAutoGen(AutoGen): # Only do build for target with outputs self._FinalBuildTargetList.add(Target) =20 - if FileType not in self._BuildTargets: - self._BuildTargets[FileType] =3D set() self._BuildTargets[FileType].add(Target) =20 if not Source.IsBinary and Source =3D=3D File: @@ -3572,8 +3569,8 @@ class ModuleAutoGen(AutoGen): if self._BuildTargets is None: self._IntroBuildTargetList =3D set() self._FinalBuildTargetList =3D set() - self._BuildTargets =3D {} - self._FileTypes =3D {} + self._BuildTargets =3D defaultdict(set) + self._FileTypes =3D defaultdict(set) =20 #TRICK: call _GetSourceFileList to apply build rule for source fil= es if self.SourceFileList: --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat May 4 18:47:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1522970062123901.5601804801282; Thu, 5 Apr 2018 16:14:22 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E52C02265A8DD; Thu, 5 Apr 2018 16:14:09 -0700 (PDT) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 67EB622526484 for ; Thu, 5 Apr 2018 16:14:07 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Apr 2018 16:14:06 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.141]) by orsmga004.jf.intel.com with ESMTP; 05 Apr 2018 16:14:05 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,412,1517904000"; d="scan'208";a="189047089" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Thu, 5 Apr 2018 16:13:52 -0700 Message-Id: <1fd8614ac264e99740a1ba5026c80a0fe23f48e8.1522969978.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 04/14] BaseTools: sets are faster to check via "in" due to hashing X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" switch list to set: 1)we dont care about order 2)we only check for membership. then remove ".keys()" from dict looping: allow generators opportunity to optimize Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/AutoGen.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/= Python/AutoGen/AutoGen.py index 91a0742a33be..bd720a4dd295 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -354,9 +354,9 @@ class WorkspaceAutoGen(AutoGen): MetaFile_cache =3D {} for Arch in self.ArchList: Platform_cache[Arch] =3D self.BuildDatabase[self.M= etaFile, Arch, Target, Toolchain] - MetaFile_cache[Arch] =3D [] - for Pkey in Platform_cache[Arch].Modules.keys(): - MetaFile_cache[Arch].append(Platform_cache[Arc= h].Modules[Pkey].MetaFile) + MetaFile_cache[Arch] =3D 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 =3D PathClass(NormPath(Inf), GlobalData= .gWorkspace, Arch) for Arch in self.ArchList: @@ -371,9 +371,9 @@ class WorkspaceAutoGen(AutoGen): for Arch in self.ArchList: if Arch =3D=3D key: Platform =3D self.BuildDatabase[self.MetaFile,= Arch, Target, Toolchain] - MetaFileList =3D [] - for Pkey in Platform.Modules.keys(): - MetaFileList.append(Platform.Modules[Pkey]= .MetaFile) + MetaFileList =3D set() + for Pkey in Platform.Modules: + MetaFileList.add(Platform.Modules[Pkey].Me= taFile) for Inf in self.FdfProfile.InfDict[key]: ModuleFile =3D PathClass(NormPath(Inf), Gl= obalData.gWorkspace, Arch) if ModuleFile in MetaFileList: --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat May 4 18:47:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1522970067282861.0522888697749; Thu, 5 Apr 2018 16:14:27 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 469F72268522A; Thu, 5 Apr 2018 16:14:10 -0700 (PDT) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7E3BC22526495 for ; Thu, 5 Apr 2018 16:14:07 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Apr 2018 16:14:06 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.141]) by orsmga004.jf.intel.com with ESMTP; 05 Apr 2018 16:14:05 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,412,1517904000"; d="scan'208";a="189047092" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Thu, 5 Apr 2018 16:13:53 -0700 Message-Id: <25a6ba27703f8ba8b3d90cbf25fbb95952085d4b.1522969978.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 05/14] BaseTools: replace a dict with a set X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" As we never use the values, just keep the keys in a set. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/AutoGen.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/= Python/AutoGen/AutoGen.py index bd720a4dd295..cf76b8054467 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -554,11 +554,11 @@ class WorkspaceAutoGen(AutoGen): ModuleData =3D self.BuildDatabase[ModuleFile, Arch, Target= , Toolchain] PkgSet.update(ModuleData.Packages) Pkgs =3D list(PkgSet) + list(PGen.PackageList) - DecPcds =3D {} + DecPcds =3D set() DecPcdsKey =3D set() for Pkg in Pkgs: for Pcd in Pkg.Pcds: - DecPcds[Pcd[0], Pcd[1]] =3D Pkg.Pcds[Pcd] + DecPcds.add((Pcd[0], Pcd[1])) DecPcdsKey.add((Pcd[0], Pcd[1], Pcd[2])) =20 Platform.SkuName =3D self.SkuId --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat May 4 18:47:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1522970072157326.060109305537; Thu, 5 Apr 2018 16:14:32 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 996C6225264B7; Thu, 5 Apr 2018 16:14:10 -0700 (PDT) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 8DFAF226FAA78 for ; Thu, 5 Apr 2018 16:14:07 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Apr 2018 16:14:06 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.141]) by orsmga004.jf.intel.com with ESMTP; 05 Apr 2018 16:14:05 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,412,1517904000"; d="scan'208";a="189047095" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Thu, 5 Apr 2018 16:13:54 -0700 Message-Id: <081932c55eb7a8b3dbff82cafd3809b38c5cecf7.1522969978.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 06/14] BaseTools: remove unused variables X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" some were populated, but never used after. some were never used. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/AutoGen.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/= Python/AutoGen/AutoGen.py index cf76b8054467..d00cc6c6cd3b 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -1400,8 +1400,6 @@ class PlatformAutoGen(AutoGen): =20 # for gathering error information NoDatumTypePcdList =3D set() - PcdNotInDb =3D [] - self._GuidValue =3D {} FdfModuleList =3D [] for InfName in self._AsBuildInfList: InfName =3D mws.join(self.WorkspaceDir, InfName) @@ -1439,8 +1437,6 @@ class PlatformAutoGen(AutoGen): if PcdFromModule.Type in GenC.gDynamicPcd and \ PcdFromModule.IsFromBinaryInf =3D=3D False: # Print warning message to let the developer m= ake 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=20 # FDF modules, and the INF lists a PCD can only us= e the PcdsDynamicEx=20 @@ -1448,8 +1444,6 @@ class PlatformAutoGen(AutoGen): # PCD as PcdsDynamicEx), then DO NOT break the bui= ld; DO NOT add the=20 # 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 & D= XE module, @@ -1930,7 +1924,6 @@ class PlatformAutoGen(AutoGen): self._ToolDefinitions[Tool][Attr] =3D Value =20 ToolsDef =3D '' - MakePath =3D '' if GlobalData.gOptions.SilentMode and "MAKE" in self._ToolDefi= nitions: if "FLAGS" not in self._ToolDefinitions["MAKE"]: self._ToolDefinitions["MAKE"]["FLAGS"] =3D "" @@ -1951,9 +1944,7 @@ class PlatformAutoGen(AutoGen): =20 if Attr =3D=3D "PATH": # Don't put MAKE definition in the file - if Tool =3D=3D "MAKE": - MakePath =3D Value - else: + if Tool !=3D "MAKE": ToolsDef +=3D "%s =3D %s\n" % (Tool, Value) elif Attr !=3D "DLL": # Don't put MAKE definition in the file --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat May 4 18:47:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 15229700697792.4653563781406547; Thu, 5 Apr 2018 16:14:29 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 7083D22685231; Thu, 5 Apr 2018 16:14:10 -0700 (PDT) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 90ED0225264A7 for ; Thu, 5 Apr 2018 16:14:07 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Apr 2018 16:14:06 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.141]) by orsmga004.jf.intel.com with ESMTP; 05 Apr 2018 16:14:05 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,412,1517904000"; d="scan'208";a="189047098" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Thu, 5 Apr 2018 16:13:55 -0700 Message-Id: <6df4fb3ca342c0f458a1be0a320ff8bc576cfbe0.1522969978.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 07/14] BaseTools: change list to set X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Order is irelevant duplication is auto-prevented Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/AutoGen.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/= Python/AutoGen/AutoGen.py index d00cc6c6cd3b..a8c49658bd21 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -3927,7 +3927,7 @@ class ModuleAutoGen(AutoGen): ## Create AsBuilt INF file the module # def CreateAsBuiltInf(self, IsOnlyCopy =3D False): - self.OutputFile =3D [] + self.OutputFile =3D set() if IsOnlyCopy: if GlobalData.gBinCacheDest: self.CopyModuleToCache() @@ -4068,8 +4068,7 @@ class ModuleAutoGen(AutoGen): DebugDir =3D self.DebugDir.replace('\\', '/').strip('/') for Item in self.CodaTargetList: File =3D Item.Target.Path.replace('\\', '/').strip('/').replac= e(DebugDir, '').replace(OutputDir, '').strip('/') - if File not in self.OutputFile: - self.OutputFile.append(File) + self.OutputFile.add(File) if os.path.isabs(File): File =3D File.replace('\\', '/').strip('/').replace(Output= Dir, '').strip('/') if Item.Target.Ext.lower() =3D=3D '.aml': @@ -4081,8 +4080,7 @@ class ModuleAutoGen(AutoGen): else: AsBuiltInfDict['binary_item'] +=3D ['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'] +=3D ['PEI_DEPEX|' + self.Na= me + '.depex'] if self.ModuleType in ['DXE_DRIVER', 'DXE_RUNTIME_DRIVER', 'DX= E_SAL_DRIVER', 'UEFI_DRIVER']: @@ -4093,15 +4091,13 @@ class ModuleAutoGen(AutoGen): Bin =3D self._GenOffsetBin() if Bin: AsBuiltInfDict['binary_item'] +=3D ['BIN|%s' % Bin] - if Bin not in self.OutputFile: - self.OutputFile.append(Bin) + self.OutputFile.add(Bin) =20 for Root, Dirs, Files in os.walk(OutputDir): for File in Files: if File.lower().endswith('.pdb'): AsBuiltInfDict['binary_item'] +=3D ['DISPOSABLE|' + Fi= le] - if File not in self.OutputFile: - self.OutputFile.append(File) + self.OutputFile.add(File) HeaderComments =3D self.Module.HeaderComments StartPos =3D 0 for Index in range(len(HeaderComments)): --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat May 4 18:47:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 152297008217399.12176792268338; Thu, 5 Apr 2018 16:14:42 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 35EB32268523C; Thu, 5 Apr 2018 16:14:11 -0700 (PDT) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D305A22526495 for ; Thu, 5 Apr 2018 16:14:07 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Apr 2018 16:14:06 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.141]) by orsmga004.jf.intel.com with ESMTP; 05 Apr 2018 16:14:05 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,412,1517904000"; d="scan'208";a="189047101" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Thu, 5 Apr 2018 16:13:56 -0700 Message-Id: <1c3ce766df8b26f82d0917cb0867fb9a9ac88c22.1522969978.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 08/14] BaseTools: simplify testing for existance and containing data X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" and remove a duplicate "if" block from 6 lines up. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/AutoGen.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/= Python/AutoGen/AutoGen.py index a8c49658bd21..cc08baacfae5 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -2364,17 +2364,15 @@ class PlatformAutoGen(AutoGen): ToPcd.Type, Module, FromPcd.T= ype), File=3Dself.MetaFile) =20 - if FromPcd.MaxDatumSize not in [None, '']: + if FromPcd.MaxDatumSize: ToPcd.MaxDatumSize =3D FromPcd.MaxDatumSize - if FromPcd.DefaultValue not in [None, '']: + if FromPcd.DefaultValue: ToPcd.DefaultValue =3D FromPcd.DefaultValue - if FromPcd.TokenValue not in [None, '']: + if FromPcd.TokenValue: ToPcd.TokenValue =3D FromPcd.TokenValue - if FromPcd.MaxDatumSize not in [None, '']: - ToPcd.MaxDatumSize =3D FromPcd.MaxDatumSize - if FromPcd.DatumType not in [None, '']: + if FromPcd.DatumType: ToPcd.DatumType =3D FromPcd.DatumType - if FromPcd.SkuInfoList not in [None, '', []]: + if FromPcd.SkuInfoList: ToPcd.SkuInfoList =3D FromPcd.SkuInfoList # Add Flexible PCD format parse if ToPcd.DefaultValue: @@ -3945,11 +3943,11 @@ class ModuleAutoGen(AutoGen): return =20 # Skip the following code for modules with no source files - if self.SourceFileList is None or self.SourceFileList =3D=3D []: + if not self.SourceFileList: return =20 # Skip the following code for modules without any binary files - if self.BinaryFileList <> None and self.BinaryFileList <> []: + if not self.BinaryFileList: return =20 ### TODO: How to handles mixed source and binary modules --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat May 4 18:47:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1522970087524293.18654027689763; Thu, 5 Apr 2018 16:14:47 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 852D922685245; Thu, 5 Apr 2018 16:14:11 -0700 (PDT) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 09FCF226FAA78 for ; Thu, 5 Apr 2018 16:14:08 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Apr 2018 16:14:06 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.141]) by orsmga004.jf.intel.com with ESMTP; 05 Apr 2018 16:14:05 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,412,1517904000"; d="scan'208";a="189047104" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Thu, 5 Apr 2018 16:13:57 -0700 Message-Id: <4ffa5d10e2c57cd22406b5f0a1ad5b509560a967.1522969978.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 09/14] BaseTools: optimize buildoptions loop X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" change a dict to a double defaultdict to prevent needing to seed innter val= ues. move "Value" determination under a conditional continue statement Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/AutoGen.py | 21 ++++++-------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/= Python/AutoGen/AutoGen.py index cc08baacfae5..74828fdb62ef 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -2698,40 +2698,31 @@ class PlatformAutoGen(AutoGen): AllTools =3D set(ModuleOptions.keys() + PlatformOptions.keys() + PlatformModuleOptions.keys() + ModuleTypeOptions.ke= ys() + self.ToolDefinition.keys()) - BuildOptions =3D {} + BuildOptions =3D defaultdict(lambda: defaultdict(str)) for Tool in AllTools: - if Tool not in BuildOptions: - BuildOptions[Tool] =3D {} - for Options in [self.ToolDefinition, ModuleOptions, PlatformOp= tions, ModuleTypeOptions, PlatformModuleOptions]: if Tool not in Options: continue for Attr in Options[Tool]: - Value =3D Options[Tool][Attr] # # Do not generate it in Makefile # if Attr =3D=3D TAB_TOD_DEFINES_BUILDRULEORDER: continue - if Attr not in BuildOptions[Tool]: - BuildOptions[Tool][Attr] =3D "" + Value =3D Options[Tool][Attr] # check if override is indicated if Value.startswith('=3D'): - ToolPath =3D Value[1:] - ToolPath =3D mws.handleWsMacro(ToolPath) - BuildOptions[Tool][Attr] =3D ToolPath + BuildOptions[Tool][Attr] =3D mws.handleWsMacro(Val= ue[1:]) else: - Value =3D mws.handleWsMacro(Value) if Attr !=3D 'PATH': - BuildOptions[Tool][Attr] +=3D " " + Value + BuildOptions[Tool][Attr] +=3D " " + mws.handle= WsMacro(Value) else: - BuildOptions[Tool][Attr] =3D Value + BuildOptions[Tool][Attr] =3D mws.handleWsMacro= (Value) + if Module.AutoGenVersion < 0x00010005 and self.Workspace.UniFlag i= s not None: # # Override UNI flag only for EDK module. # - if 'BUILD' not in BuildOptions: - BuildOptions['BUILD'] =3D {} BuildOptions['BUILD']['FLAGS'] =3D self.Workspace.UniFlag return BuildOptions, BuildRuleOrder =20 --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat May 4 18:47:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1522970077257605.1659436151687; Thu, 5 Apr 2018 16:14:37 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E414022685236; Thu, 5 Apr 2018 16:14:10 -0700 (PDT) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B92DF22526484 for ; Thu, 5 Apr 2018 16:14:07 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Apr 2018 16:14:06 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.141]) by orsmga004.jf.intel.com with ESMTP; 05 Apr 2018 16:14:05 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,412,1517904000"; d="scan'208";a="189047107" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Thu, 5 Apr 2018 16:13:58 -0700 Message-Id: X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 10/14] BaseTools: change another list to set X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" potentially accelerate "in" testing which is the use for this variable Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/AutoGen.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/= Python/AutoGen/AutoGen.py index 74828fdb62ef..c52386c8484a 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -3790,7 +3790,7 @@ class ModuleAutoGen(AutoGen): if not self.SourceFileList: return [] =20 - NameGuids =3D [] + NameGuids =3D set() for SrcFile in self.SourceFileList: if SrcFile.Ext.lower() !=3D '.vfr': continue @@ -3822,7 +3822,7 @@ class ModuleAutoGen(AutoGen): if not Guid: break NameArray =3D ConvertStringToByteArray('L"' + Name.group(1= ) + '"') - NameGuids.append((NameArray, GuidStructureStringToGuidStri= ng(Guid.group(1)))) + NameGuids.add((NameArray, GuidStructureStringToGuidString(= Guid.group(1)))) Pos =3D Content.find('efivarstore', Name.end()) if not NameGuids: return [] --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat May 4 18:47:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1522970079652405.39814589343086; Thu, 5 Apr 2018 16:14:39 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 1207622685239; Thu, 5 Apr 2018 16:14:11 -0700 (PDT) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C702D22526485 for ; Thu, 5 Apr 2018 16:14:07 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Apr 2018 16:14:06 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.141]) by orsmga004.jf.intel.com with ESMTP; 05 Apr 2018 16:14:05 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,412,1517904000"; d="scan'208";a="189047110" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Thu, 5 Apr 2018 16:13:59 -0700 Message-Id: <746aefd8f5e7d59011db9a3538cdf4ff3a949508.1522969978.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 11/14] BaseTools: remove unneeded function call X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/AutoGen.py | 1 - 1 file changed, 1 deletion(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/= Python/AutoGen/AutoGen.py index c52386c8484a..42536a61535a 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -3897,7 +3897,6 @@ class ModuleAutoGen(AutoGen): VfrGuid =3D [0xb4, 0x7c, 0xbc, 0xd0, 0x47, 0x6a, 0x5f, 0x4= 9, 0xaa, 0x11, 0x71, 0x7, 0x46, 0xda, 0x6, 0xa2] VfrGuid =3D [chr(ItemGuid) for ItemGuid in VfrGuid] fStringIO.write(''.join(VfrGuid)) =20 - type (Item[1])=20 VfrValue =3D pack ('Q', int (Item[1], 16)) fStringIO.write (VfrValue) # --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat May 4 18:47:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1522970084728799.008344576623; Thu, 5 Apr 2018 16:14:44 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 5FE8522685240; Thu, 5 Apr 2018 16:14:11 -0700 (PDT) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E8AF4225264A7 for ; Thu, 5 Apr 2018 16:14:07 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Apr 2018 16:14:06 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.141]) by orsmga004.jf.intel.com with ESMTP; 05 Apr 2018 16:14:05 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,412,1517904000"; d="scan'208";a="189047113" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Thu, 5 Apr 2018 16:14:00 -0700 Message-Id: X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 12/14] BaseTools: change more list to set X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" potentially accelerate "in" testing remove uncalled function Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/AutoGen.py | 5 ++-- BaseTools/Source/Python/AutoGen/BuildEngine.py | 29 ++++++-------------- 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/= Python/AutoGen/AutoGen.py index 42536a61535a..342cd618c605 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -4191,7 +4191,7 @@ class ModuleAutoGen(AutoGen): PcdItem =3D PcdComments + '\n ' + PcdItem AsBuiltInfDict['patchablepcd_item'].append(PcdItem) =20 - HiiPcds =3D [] + HiiPcds =3D set() for Pcd in Pcds + VfrPcds: PcdComments =3D '' PcdCommentList =3D [] @@ -4214,8 +4214,7 @@ class ModuleAutoGen(AutoGen): # if (SkuId, Pcd.TokenSpaceGuidCName, Pcd.TokenCName) in Hii= Pcds: continue - else: - HiiPcds.append((SkuId, Pcd.TokenSpaceGuidCName, Pcd.To= kenCName)) + HiiPcds.add((SkuId, Pcd.TokenSpaceGuidCName, Pcd.TokenCNam= e)) if (Pcd.TokenSpaceGuidCName, Pcd.TokenCName) in self._PcdComme= nts: PcdCommentList =3D self._PcdComments[Pcd.TokenSpaceGuidCNa= me, Pcd.TokenCName][:] if HiiInfo: diff --git a/BaseTools/Source/Python/AutoGen/BuildEngine.py b/BaseTools/Sou= rce/Python/AutoGen/BuildEngine.py index 0daed7da610d..1663ddd21bb0 100644 --- a/BaseTools/Source/Python/AutoGen/BuildEngine.py +++ b/BaseTools/Source/Python/AutoGen/BuildEngine.py @@ -161,7 +161,7 @@ class FileBuildRule: =20 # Check input files self.IsMultipleInput =3D False - self.SourceFileExtList =3D [] + self.SourceFileExtList =3D set() for File in Input: Base, Ext =3D os.path.splitext(File) if Base.find("*") >=3D 0: @@ -172,8 +172,7 @@ class FileBuildRule: # There's no "*" and "?" in file name self.ExtraSourceFileList.append(File) continue - if Ext not in self.SourceFileExtList: - self.SourceFileExtList.append(Ext) + self.SourceFileExtList.add(Ext) =20 # Check output files self.DestFileList =3D [] @@ -194,16 +193,6 @@ class FileBuildRule: CommandString =3D "\n\t".join(self.CommandList) return "%s : %s\n\t%s" % (DestString, SourceString, CommandString) =20 - ## Check if given file extension is supported by this rule - # - # @param FileExt The extension of a file - # - # @retval True If the extension is supported - # @retval False If the extension is not supported - # - def IsSupported(self, FileExt): - return FileExt in self.SourceFileExtList - def Instantiate(self, Macros=3D{}): NewRuleObject =3D copy.copy(self) NewRuleObject.BuildTargets =3D {} @@ -365,8 +354,8 @@ class BuildRule: self._State =3D "" self._RuleInfo =3D tdict(True, 2) # {toolchain family : {"Inpu= tFile": {}, "OutputFile" : [], "Command" : []}} self._FileType =3D '' - self._BuildTypeList =3D [] - self._ArchList =3D [] + self._BuildTypeList =3D set() + self._ArchList =3D set() self._FamilyList =3D [] self._TotalToolChainFamilySet =3D set() self._RuleObjectList =3D [] # FileBuildRule object list @@ -456,8 +445,8 @@ class BuildRule: # def ParseSectionHeader(self, LineIndex): self._RuleInfo =3D tdict(True, 2) - self._BuildTypeList =3D [] - self._ArchList =3D [] + self._BuildTypeList =3D set() + self._ArchList =3D set() self._FamilyList =3D [] self._TotalToolChainFamilySet =3D set() FileType =3D '' @@ -494,10 +483,8 @@ class BuildRule: BuildType =3D TokenList[1] if len(TokenList) > 2: Arch =3D TokenList[2] - if BuildType not in self._BuildTypeList: - self._BuildTypeList.append(BuildType) - if Arch not in self._ArchList: - self._ArchList.append(Arch) + self._BuildTypeList.add(BuildType) + self._ArchList.add(Arch) =20 if 'COMMON' in self._BuildTypeList and len(self._BuildTypeList) > = 1: EdkLogger.error("build", FORMAT_INVALID, --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat May 4 18:47:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1522970064727245.68032800454432; Thu, 5 Apr 2018 16:14:24 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 1BB2022685223; Thu, 5 Apr 2018 16:14:10 -0700 (PDT) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7AB1E22526485 for ; Thu, 5 Apr 2018 16:14:07 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Apr 2018 16:14:06 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.141]) by orsmga004.jf.intel.com with ESMTP; 05 Apr 2018 16:14:05 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,412,1517904000"; d="scan'208";a="189047116" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Thu, 5 Apr 2018 16:14:01 -0700 Message-Id: <32f7b5ddb005b2da4180dffdae092b87d04495e1.1522969978.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 13/14] BaseTools: GenC - move content from both parts of if/else X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" move identical lines out of both if and else and move 1 level up. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/AutoGen/GenC.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/GenC.py b/BaseTools/Source/Pyt= hon/AutoGen/GenC.py index 4d9ea1b2a8b1..f10ed5dbbe36 100644 --- a/BaseTools/Source/Python/AutoGen/GenC.py +++ b/BaseTools/Source/Python/AutoGen/GenC.py @@ -1136,16 +1136,14 @@ def CreateModulePcdCode(Info, AutoGenC, AutoGenH, P= cd): # # For unicode, UINT16 array will be generated, so the alignmen= t of unicode is guaranteed. # + AutoGenH.Append('#define %s %s%s\n' %(PcdValueName, Type, Pcd= VariableName)) if Unicode: - AutoGenH.Append('#define %s %s%s\n' %(PcdValueName, Type,= PcdVariableName)) AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s UINT16 %= s%s =3D %s;\n' % (Const, PcdVariableName, Array, Value)) AutoGenH.Append('extern %s UINT16 %s%s;\n' %(Const, PcdVar= iableName, Array)) - AutoGenH.Append('#define %s %s%s\n' %(GetModeName, Type, = PcdVariableName)) else: - AutoGenH.Append('#define %s %s%s\n' %(PcdValueName, Type,= PcdVariableName)) AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s UINT8 %s= %s =3D %s;\n' % (Const, PcdVariableName, Array, Value)) AutoGenH.Append('extern %s UINT8 %s%s;\n' %(Const, PcdVari= ableName, Array)) - AutoGenH.Append('#define %s %s%s\n' %(GetModeName, Type, = PcdVariableName)) + AutoGenH.Append('#define %s %s%s\n' %(GetModeName, Type, PcdV= ariableName)) =20 PcdDataSize =3D GetPcdSize(Pcd) if Pcd.Type =3D=3D TAB_PCDS_FIXED_AT_BUILD: --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat May 4 18:47:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1522970074633702.2054480186297; Thu, 5 Apr 2018 16:14:34 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id BF2862265A8C6; Thu, 5 Apr 2018 16:14:10 -0700 (PDT) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9C9CA225264AB for ; Thu, 5 Apr 2018 16:14:07 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Apr 2018 16:14:06 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.141]) by orsmga004.jf.intel.com with ESMTP; 05 Apr 2018 16:14:05 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,412,1517904000"; d="scan'208";a="189047119" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Thu, 5 Apr 2018 16:14:02 -0700 Message-Id: <14593a5f937eed96986ff2f01ade60055b9d79f0.1522969978.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 14/14] BaseTools: refactor and remove out of date use of .keys() X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" this is no longer required to make dictionary objects iterable. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu =20 --- BaseTools/Scripts/SmiHandlerProfileSymbolGen.py | 4 ++-- BaseTools/Source/Python/AutoGen/GenMake.py | 2 +- BaseTools/Source/Python/GenFds/Fv.py | 2 +- BaseTools/Source/Python/GenFds/Section.py | 5 +---- BaseTools/Source/Python/TargetTool/TargetTool.py | 3 +-- BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py | 5 +---- BaseTools/Source/Python/build/build.py | 4 +--- 7 files changed, 8 insertions(+), 17 deletions(-) diff --git a/BaseTools/Scripts/SmiHandlerProfileSymbolGen.py b/BaseTools/Sc= ripts/SmiHandlerProfileSymbolGen.py index f03278b64f8f..26c092410386 100644 --- a/BaseTools/Scripts/SmiHandlerProfileSymbolGen.py +++ b/BaseTools/Scripts/SmiHandlerProfileSymbolGen.py @@ -204,7 +204,7 @@ def genGuidString(guidreffile): if len(guidLineList) =3D=3D 2: guid =3D guidLineList[0] guidName =3D guidLineList[1] - if guid not in dictGuid.keys() : + if guid not in dictGuid : dictGuid[guid] =3D guidName =20 def createSym(symbolName): @@ -256,7 +256,7 @@ def main(): for smiEntry in SmiEntry: if smiEntry.hasAttribute("HandlerType"): guidValue =3D smiEntry.getAttribute("HandlerType") - if guidValue in dictGuid.keys() : + if guidValue in dictGuid: smiEntry.setAttribute("HandlerType", dictGuid[guidValu= e]) SmiHandler =3D smiEntry.getElementsByTagName("SmiHandler") for smiHandler in SmiHandler: diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/= Python/AutoGen/GenMake.py index dcdfcca1a5b0..61432516fd26 100644 --- a/BaseTools/Source/Python/AutoGen/GenMake.py +++ b/BaseTools/Source/Python/AutoGen/GenMake.py @@ -491,7 +491,7 @@ cleanlib: ImageEntryPoint =3D "_ModuleEntryPoint" =20 for k, v in self._AutoGenObject.Module.Defines.iteritems(): - if k not in self._AutoGenObject.Macros.keys(): + if k not in self._AutoGenObject.Macros: self._AutoGenObject.Macros[k] =3D v =20 if 'MODULE_ENTRY_POINT' not in self._AutoGenObject.Macros.keys(): diff --git a/BaseTools/Source/Python/GenFds/Fv.py b/BaseTools/Source/Python= /GenFds/Fv.py index 14e36b885966..345ad3bdcc90 100644 --- a/BaseTools/Source/Python/GenFds/Fv.py +++ b/BaseTools/Source/Python/GenFds/Fv.py @@ -318,7 +318,7 @@ class FV (FvClassObject): ' %s' %ErasePloarity + \ T_CHAR_LF) if not (self.FvAttributeDict is None): - for FvAttribute in self.FvAttributeDict.keys() : + for FvAttribute in self.FvAttributeDict: if FvAttribute =3D=3D "FvUsedSizeEnable": if self.FvAttributeDict[FvAttribute].upper() in ('TRUE= ', '1') : self.UsedSizeEnable =3D True diff --git a/BaseTools/Source/Python/GenFds/Section.py b/BaseTools/Source/P= ython/GenFds/Section.py index 5e0b4bee7d1c..6335c249a693 100644 --- a/BaseTools/Source/Python/GenFds/Section.py +++ b/BaseTools/Source/Python/GenFds/Section.py @@ -111,10 +111,7 @@ class Section (SectionClassObject): # @retval tuple (File list, boolean) # def GetFileList(FfsInf, FileType, FileExtension, Dict =3D {}, IsMakefi= le=3DFalse): - if FileType in Section.SectFileType.keys() : - IsSect =3D True - else : - IsSect =3D False + IsSect =3D FileType in Section.SectFileType =20 if FileExtension is not None: Suffix =3D FileExtension diff --git a/BaseTools/Source/Python/TargetTool/TargetTool.py b/BaseTools/S= ource/Python/TargetTool/TargetTool.py index ede9713c9b8b..143b53ec35ef 100644 --- a/BaseTools/Source/Python/TargetTool/TargetTool.py +++ b/BaseTools/Source/Python/TargetTool/TargetTool.py @@ -80,9 +80,8 @@ class TargetTool(): traceback.print_exception(last_type, last_value, last_tb) =20 def Print(self): - KeyList =3D self.TargetTxtDictionary.keys() errMsg =3D '' - for Key in KeyList: + for Key in self.TargetTxtDictionary: if type(self.TargetTxtDictionary[Key]) =3D=3D type([]): print "%-30s =3D %s" % (Key, ''.join(elem + ' ' for elem i= n self.TargetTxtDictionary[Key])) elif self.TargetTxtDictionary[Key] is None: diff --git a/BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py b/Ba= seTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py index e37a0b6c3be7..165ac111272a 100644 --- a/BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py +++ b/BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py @@ -486,10 +486,7 @@ class InfPomAlignment(ModuleObject): # # Get all LibraryClasses # - LibClassObj =3D self.Parser.InfLibraryClassSection.LibraryClas= ses - Keys =3D LibClassObj.keys() - for Key in Keys: - LibraryClassData =3D LibClassObj[Key] + for LibraryClassData in self.Parser.InfLibraryClassSection.Lib= raryClasses.values(): for Item in LibraryClassData: LibraryClass =3D CommonObject.LibraryClassObject() LibraryClass.SetUsage(DT.USAGE_ITEM_CONSUMES) diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Pyth= on/build/build.py index f211f8c64116..ceacc124933c 100644 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -1421,9 +1421,7 @@ class Build(): def _RebaseModule (self, MapBuffer, BaseAddress, ModuleList, AddrIsOff= set =3D True, ModeIsSmm =3D False): if ModeIsSmm: AddrIsOffset =3D False - InfFileNameList =3D ModuleList.keys() - #InfFileNameList.sort() - for InfFile in InfFileNameList: + for InfFile in ModuleList: sys.stdout.write (".") sys.stdout.flush() ModuleInfo =3D ModuleList[InfFile] --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel