[edk2] [Patch v1 4/4] BaseTools/build/build: delete variable

2019-01-24 Thread Jaben Carsey
delete the shared global variable from Common.Misc delete the uncalled users of the variable from build.build Cc: Bob Feng Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/Common/Misc.py | 3 - BaseTools/Source

[edk2] [Patch v1 2/4] BaseTools/Common/Misc: remove uncalled code

2019-01-24 Thread Jaben Carsey
no use for this code content. Cc: Bob Feng Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/Common/Misc.py | 46 1 file changed, 46 deletions(-) diff --git a/BaseTools/Source/Python/Common

[edk2] [Patch v1 0/4] Cleanup the Common.misc file

2019-01-24 Thread Jaben Carsey
move functions and remove unused content from common.misc Cc: Bob Feng Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Jaben Carsey (4): BaseTools/Common/Misc: move private functions BaseTools/Common/Misc: remove uncalled code BaseTools

[edk2] [Patch v1 1/4] BaseTools/Common/Misc: move private functions

2019-01-24 Thread Jaben Carsey
These 2 functions are only used internally. move them to the smallest scope and use them. Cc: Bob Feng Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/Common/Misc.py | 92 ++-- 1 file changed, 46

[edk2] [Patch v1 3/4] BaseTools/Common/Misc: Cleanup the imports

2019-01-24 Thread Jaben Carsey
Refactor to 'dict' from 'IterableUserDict' which was only required for old python interpreter. Sort imports according to PEP8 Remove those we dont need. Cc: Bob Feng Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source

[edk2] [Patch V2 5/5] BaseTools/GenFds/Capsule: move function logic

2019-01-17 Thread Jaben Carsey
Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/Common/Misc.py| 6 -- BaseTools/Source/Python/GenFds/Capsule.py | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/Common/Misc.py

[edk2] [Patch V2 4/5] BaseTools/AutoGen: move functions

2019-01-17 Thread Jaben Carsey
Move SplitOption and ConvertStringToByteArray from Common.Misc to this file. There were no other consumers of the functions. Cc: Bob Feng Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/AutoGen/AutoGen.py | 77

[edk2] [Patch V2 0/5] cleanup shared functions

2019-01-17 Thread Jaben Carsey
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=42 Many shared functions are not used by more than one consumer. Move them local to consumer until the use arises for sharing. Cc: Bob Feng Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey

[edk2] [Patch V2 3/5] BaseTools/DscBuildData: move function

2019-01-17 Thread Jaben Carsey
Move IsFieldValuieAnArray from Common.Misc to this file. There were no other consumers of the function. Cc: Bob Feng Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/Common/Misc.py| 18 +-- BaseTools

[edk2] [Patch V2 1/5] BaseTools/build/build: refactor and move functions

2019-01-17 Thread Jaben Carsey
Move DataDump and DataRestore from Common.Misc to this file. There were no other consumers of these 2 functions. Import threading since that module is used in build. Cc: Bob Feng Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools

[edk2] [Patch V2 2/5] BaseTools/Workspace/InfBuildData: move functions

2019-01-17 Thread Jaben Carsey
Move ProtocolValue and PpiValue from Common.Misc to this file. There were no other consumers of these 2 functions. Cc: Bob Feng Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/Common/Misc.py| 38

[edk2] [Patch v1 3/5] BaseTools/DscBuildData: move function

2019-01-10 Thread Jaben Carsey
Move IsFieldValuieAnArray from Common.Misc to this file. There were no other consumers of the function. Cc: Bob Feng Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/Common/Misc.py| 18 +-- BaseTools

[edk2] [Patch v1 5/5] BaseTools/GenFds/Capsule: move function logic

2019-01-10 Thread Jaben Carsey
Move PackRegistryFormatGuid logic from Common.Misc to this file. There were no other consumers of the function. As it is one line, just replace the logic without the separate function. Cc: Bob Feng Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben

[edk2] [Patch v1 4/5] BaseTools/AutoGen: move functions

2019-01-10 Thread Jaben Carsey
Move SplitOption and ConvertStringToByteArray from Common.Misc to this file. There were no other consumers of the functions. Cc: Bob Feng Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/AutoGen/AutoGen.py | 77

[edk2] [Patch v1 2/5] BaseTools/Workspace/InfBuildData: move functions

2019-01-10 Thread Jaben Carsey
Move ProtocolValue and PpiValue from Common.Misc to this file. There were no other consumers of these 2 functions. Cc: Bob Feng Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/Common/Misc.py| 38

[edk2] [Patch v1 1/5] BaseTools/build/build: refactor and move functions

2019-01-10 Thread Jaben Carsey
Move DataDump and DataRestore from Common.Misc to this file. There were no other consumers of these 2 functions. Import threading since that module is used in build. Cc: Bob Feng Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools

[edk2] [Patch v1 0/5] cleanup shared functions

2019-01-10 Thread Jaben Carsey
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=42 Many shared functions are not used by more than one consumer. Move them local to consumer until the use arises for sharing. Cc: Bob Feng Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey

[edk2] [v2 1/1] BaseTools: fix imports

2019-01-09 Thread Jaben Carsey
=42 Cc: Bob Feng Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/AutoGen/AutoGen.py | 6 ++ BaseTools/Source/Python/AutoGen/GenC.py | 2 +- BaseTools/Source/Python

[edk2] [Patch v1 1/1] BaseTools: fix imports

2019-01-08 Thread Jaben Carsey
=42 Cc: Bob Feng Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/AutoGen/AutoGen.py | 6 ++ BaseTools/Source/Python/AutoGen/GenC.py | 2 +- BaseTools/Source/Python

[edk2] [Patch v1 1/1] MdeModulePkg: fix comments in BaseSortLib

2019-01-08 Thread Jaben Carsey
The comments are incorrect for the base version of this lib. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Cc: Star Zeng Cc: Jian J Wang --- MdeModulePkg/Library/BaseSortLib/BaseSortLib.c | 22 1 file changed, 9 insertions(+), 13

[edk2] [Patch v1 1/1] BaseTools: Move Identification file to Eot

2018-11-16 Thread Jaben Carsey
Move the Identification file. This file is only ever imported into the Eot tool. Cc: Yonghong Zhu Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/{Common => Eot}/Identification.py | 0 BaseTools/Source/Python/

[edk2] [Patch v1 1/1] BaseTools: create and use a standard shared variable for '*'

2018-11-16 Thread Jaben Carsey
add a variable for the string '*' and then use it instead of lots of '*' Cc: Yonghong Zhu Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/AutoGen/AutoGen.py | 54 ++-- BaseTools/Source

[edk2] [Patch v1 1/1] BaseTools: cleanup LongFilePathSupport usage

2018-11-16 Thread Jaben Carsey
1) remove an identical function and import it from Common.LongFilePathSupport 2) remove an import that is not needed/used. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/AutoGen/UniClassObject.py

[edk2] [Patch v1 1/1] MdeModulePkg: fix comments in BaseSortLib

2018-10-31 Thread Jaben Carsey
The comments are incorrect for the base version of this lib. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Cc: Star Zeng Cc: Jian J Wang --- MdeModulePkg/Library/BaseSortLib/BaseSortLib.c | 22 1 file changed, 9 insertions(+), 13

[edk2] [Patch v3 6/6] BaseTools/GenFds: create and use new variable in FdfParser

2018-10-23 Thread Jaben Carsey
replace lots of '}' and "}" with a shared new consistent variable. Cc: Bob Feng Cc: Yonghong Zhu Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/GenFds/FdfParser.py | 45 ++-- 1 file c

[edk2] [Patch v3 5/6] BaseTools/GenFds: refactor FdfParser warnings

2018-10-23 Thread Jaben Carsey
make functions for common error messages refactor to use these functions Cc: Yonghong Zhu Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/GenFds/FdfParser.py | 603 ++-- 1 file changed, 303

[edk2] [Patch v3 3/6] Basetools/GenFds: refactor class FV

2018-10-23 Thread Jaben Carsey
1) initialize UiFvName via __init__ parameter. No change to default behavior. 2) initialize 3 empty lists in __init__. Curently not guarenteed initialized. Cc: Yonghong Zhu Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source

[edk2] [Patch v3 0/6] BaseTools/GenFds: cleanup GenFds

2018-10-23 Thread Jaben Carsey
unused code/parameters/variables 6) add standard warnings and use them for common code changes from v1: 1) do not shadow CapsuleFV. 2) rebase on master changes from v2: 1) do not delete duplicate function calls. 2) add ".lower()" for GUID string comparison. 3) rebase on master Jaben

[edk2] [Patch v3 2/6] BaseTools/GenFds: change objects to sets

2018-10-23 Thread Jaben Carsey
Change lists and tuples used solely for "in" testing to sets. These operations are not order dependent. fixed some line length for PEP8 compliance on some. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTo

[edk2] [Patch v3 4/6] BaseTools/GenFds: remove MacroDict parameter

2018-10-23 Thread Jaben Carsey
use MacroDict 4. GetFilePart calls into GetSectionData, otherwise doesn’t use MacroDict Go to 1 and repeat forever. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/GenFds/FdfParser.py | 48 +++- 1 file changed

[edk2] [PATCH v1 1/1] BaseTools: delete unused file

2018-10-10 Thread Jaben Carsey
this file is not imported/used. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/Common/Database.py | 120 1 file changed, 120 deletions(-) diff --git a/BaseTools/Source/Python

[edk2] [PATCH v2 7/7] BaseTools/GenFds: create and use new variable in FdfParser

2018-09-28 Thread Jaben Carsey
replace lots of '}' and "}" with a shared new consistent variable. Cc: Bob Feng Cc: Yonghong Zhu Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/GenFds/FdfParser.py | 45 ++-- 1 file c

[edk2] [PATCH v2 4/7] BaseTools/GenFds: remove MacroDict parameter

2018-09-28 Thread Jaben Carsey
use MacroDict 4. GetFilePart calls into GetSectionData, otherwise doesn’t use MacroDict Go to 1 and repeat forever. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/GenFds/FdfParser.py | 48 +++- 1 file changed

[edk2] [PATCH v2 2/7] BaseTools/GenFds: change objects to sets

2018-09-28 Thread Jaben Carsey
Change lists and tuples used solely for "in" testing to sets. These operations are not order dependent. fixed some line length for PEP8 compliance on some. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTo

[edk2] [PATCH v2 6/7] BaseTools/GenFds: Remove duplicate function calls

2018-09-28 Thread Jaben Carsey
every call to GetAprioriSection() is duplicated on the line below. remove one of the calls. Cc: Bob Feng Cc: Yonghong Zhu Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/GenFds/FdfParser.py | 2 -- 1 file changed

[edk2] [PATCH v2 5/7] BaseTools/GenFds: refactor FdfParser warnings

2018-09-28 Thread Jaben Carsey
make functions for common error messages refactor to use these functions Cc: Yonghong Zhu Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/GenFds/FdfParser.py | 603 ++-- 1 file changed, 303

[edk2] [PATCH v2 0/7] BaseTools/GenFds: cleanup GenFds

2018-09-28 Thread Jaben Carsey
unused code/parameters/variables 6) add standard warnings and use them for common code changes from v1: 1) do not shadow CapsuleFV. 2) rebase on master Jaben Carsey (7): BaseTools/GenFds: cleanup GenFds BaseTools/GenFds: change objects to sets Basetools/GenFds: refactor class FV BaseTools

[edk2] [PATCH v2 3/7] Basetools/GenFds: refactor class FV

2018-09-28 Thread Jaben Carsey
1) initialize UiFvName via __init__ parameter. No change to default behavior. 2) initialize 3 empty lists in __init__. Curently not guarenteed initialized. Cc: Yonghong Zhu Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source

[edk2] [PATCH v1 5/7] BaseTools/GenFds: refactor FdfParser warnings

2018-09-24 Thread Jaben Carsey
make functions for common error messages refactor to use these functions Cc: Yonghong Zhu Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/GenFds/FdfParser.py | 603 ++-- 1 file changed, 303

[edk2] [PATCH v1 2/7] BaseTools/GenFds: change objects to sets

2018-09-24 Thread Jaben Carsey
Change lists and tuples used solely for "in" testing to sets. These operations are not order dependent. fixed some line length for PEP8 compliance on some. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTo

[edk2] [PATCH v1 4/7] BaseTools/GenFds: remove MacroDict parameter

2018-09-24 Thread Jaben Carsey
use MacroDict 4. GetFilePart calls into GetSectionData, otherwise doesn’t use MacroDict Go to 1 and repeat forever. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/GenFds/FdfParser.py | 48 +++- 1 file changed

[edk2] [PATCH v1 7/7] BaseTools/GenFds: create and use new variable in FdfParser

2018-09-24 Thread Jaben Carsey
replace lots of '}' and "}" with a shared new consistent variable. Cc: Bob Feng Cc: Yonghong Zhu Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/GenFds/FdfParser.py | 45 ++-- 1 file c

[edk2] [PATCH v1 3/7] Basetools/GenFds: refactor class FV

2018-09-24 Thread Jaben Carsey
1) initialize UiFvName via __init__ parameter. No change to default behavior. 2) initialize 3 empty lists in __init__. Curently not guarenteed initialized. Cc: Yonghong Zhu Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source

[edk2] [PATCH v1 0/7] BaseTools/GenFds: cleanup GenFds

2018-09-24 Thread Jaben Carsey
unused code/parameters/variables 6) add standard warnings and use them for common code Jaben Carsey (7): BaseTools/GenFds: cleanup GenFds BaseTools/GenFds: change objects to sets Basetools/GenFds: refactor class FV BaseTools/GenFds: remove MacroDict parameter BaseTools/GenFds: refactor

[edk2] [PATCH v1 6/7] BaseTools/GenFds: Remove duplicate function calls

2018-09-24 Thread Jaben Carsey
every call to GetAprioriSection() is duplicated on the line below. remove one of the calls. Cc: Bob Feng Cc: Yonghong Zhu Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/GenFds/FdfParser.py | 2 -- 1 file changed

[edk2] [PATCH v1] BaseTools/GenFds: remove function parameter

2018-09-14 Thread Jaben Carsey
: Bob C Feng Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/GenFds/FdfParser.py | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python

[edk2] [PATCH v2 2/9] BaseTools: AutoGen refactor WorkspaceAutoGen class

2018-09-10 Thread Jaben Carsey
Update the WorkspaceAutoGen class to use caching decorators and remove the no longer needed private variables. Cc: Liming Gao Cc: Yonghong Zhu Cc: Bob Feng Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/AutoGen/AutoGen.py | 69

[edk2] [PATCH v2 0/9] BaseTools: refactor Workspace classes

2018-09-10 Thread Jaben Carsey
callers from accessing "private" data and use the existing properties 6) removed a circular dependency between APIs v2: fix error where class attribute M was accidentally removed. Jaben Carsey (9): BaseTools: Refactor PlatformAutoGen BaseTools: AutoGen refactor WorkspaceAut

[edk2] [PATCH v2 5/9] BaseTools: Workspace classes refactor properties

2018-09-10 Thread Jaben Carsey
1) use decorators 2) also change some private functions to public when all callers are external 3) change external callers to use functions instead of directly accessing private data. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben

[edk2] [PATCH v2 8/9] BaseTools: refactor to not overcreate ModuleAutoGen objects

2018-09-10 Thread Jaben Carsey
currently created for 3 different purposes and saved once. this makes it created once and saved and then referenced. Cc: Liming Gao Cc: Yonghong Zhu Cc: Bob Feng Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/AutoGen/AutoGen.py

[edk2] [PATCH v2 7/9] BaseTools: Don't save unused workspace data

2018-09-10 Thread Jaben Carsey
FlexibleFieldName was never used not set. DefinitionPosition (file and line number) are recalculated and never used outside the function. remove the saving of the data. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey

[edk2] [PATCH v2 9/9] BaseTools: refactor to cache InfBuildData data

2018-09-10 Thread Jaben Carsey
use Common.caching and auto cache properties and functions of InfBuildData Cc: Liming Gao Cc: Yonghong Zhu Cc: Bob Feng Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/Workspace/InfBuildData.py | 840 +--- 1 file

[edk2] [PATCH v2 4/9] BaseTools: refactor class properties

2018-09-10 Thread Jaben Carsey
use decorators and auto cache those that were cached manually remove properties never used Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/Common/Misc.py | 90 +--- 1 file changed

[edk2] [PATCH v2 3/9] BaseTools: AutoGen - refactor class properties

2018-09-10 Thread Jaben Carsey
use function decorators Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/AutoGen/GenMake.py | 20 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/BaseTools/Source

[edk2] [PATCH v2 1/9] BaseTools: Refactor PlatformAutoGen

2018-09-10 Thread Jaben Carsey
use decorators for property and automatic caching remove circular dependency between some APIs Cc: Liming Gao Cc: Yonghong Zhu Cc: Bob Feng Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/AutoGen/AutoGen.py | 587

[edk2] [PATCH v2 6/9] BaseTools: refactor Build Database objects

2018-09-10 Thread Jaben Carsey
1) use namedtuple instead of custom class when apropriate 2) rename collections.OrderedDict to OrderedDict since we import it already Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/Workspace

[edk2] [PATCH v1 1/1] BaseTools\GenFds: remove extra content

2018-09-10 Thread Jaben Carsey
remove uncalled functions remove extra blank lines remove commented out code Cc: Yonghong Zhu Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/GenFds/FdfParser.py | 56 1 file changed, 56

[edk2] [PATCH v1 1/1] BaseTools/GenFds: Verify binaries all the time

2018-09-06 Thread Jaben Carsey
Currently, Basetools only verifies Binary file list existance for default ARCH, but it should verify for a specified ARCH the same. Also, dont save the list to a unused variable. Cc: Yonghong Zhu Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey

[edk2] [PATCH v1 1/1] BaseTools/GenFds: delete unused file

2018-09-05 Thread Jaben Carsey
Cc: Yonghong Zhu Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/GenFds/Attribute.py | 28 1 file changed, 28 deletions(-) diff --git a/BaseTools/Source/Python/GenFds/Attribute.py b/BaseTools

[edk2] [PATCH v1 1/1] BaseTools/GenFds: remove function without callers

2018-09-05 Thread Jaben Carsey
Cc: Yonghong Zhu Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py | 17 - 1 file changed, 17 deletions(-) diff --git a/BaseTools/Source/Python/GenFds

[edk2] [PATCH v1 1/1] BaseTools: refactor to remove duplicate functions

2018-09-05 Thread Jaben Carsey
Update GenFdsGlobalVariable GetAlignment to support G. replace use of local function in Region with updated shared function. Cc: Yonghong Zhu Cc: Liming Gao Cc: Bob C Feng Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/GenFds

[edk2] [PATCH v1 8/9] BaseTools: refactor to not overcreate ModuleAutoGen objects

2018-08-29 Thread Jaben Carsey
currently created for 3 different purposes and saved once. this makes it created once and saved and then referenced. Cc: Liming Gao Cc: Yonghong Zhu Cc: Bob Feng Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/AutoGen/AutoGen.py

[edk2] [PATCH v1 9/9] BaseTools: refactor to cache InfBuildData data

2018-08-29 Thread Jaben Carsey
use Common.caching and auto cache properties and functions of InfBuildData Cc: Liming Gao Cc: Yonghong Zhu Cc: Bob Feng Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/Workspace/InfBuildData.py | 842 +--- 1 file

[edk2] [PATCH v1 4/9] BaseTools: refactor class properties

2018-08-29 Thread Jaben Carsey
use decorators and auto cache those that were cached manually remove properties never used Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/Common/Misc.py | 90 +--- 1 file changed

[edk2] [PATCH v1 6/9] BaseTools: refactor Build Database objects

2018-08-29 Thread Jaben Carsey
1) use namedtuple instead of custom class when apropriate 2) rename collections.OrderedDict to OrderedDict since we import it already Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/Workspace

[edk2] [PATCH v1 5/9] BaseTools: Workspace classes refactor properties

2018-08-29 Thread Jaben Carsey
1) use decorators 2) also change some private functions to public when all callers are external 3) change external callers to use functions instead of directly accessing private data. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben

[edk2] [PATCH v1 3/9] BaseTools: AutoGen - refactor class properties

2018-08-29 Thread Jaben Carsey
use function decorators Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/AutoGen/GenMake.py | 20 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/BaseTools/Source

[edk2] [PATCH v1 7/9] BaseTools: Don't save unused workspace data

2018-08-29 Thread Jaben Carsey
FlexibleFieldName was never used not set. DefinitionPosition (file and line number) are recalculated and never used outside the function. remove the saving of the data. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey

[edk2] [PATCH v1 1/9] BaseTools: Refactor PlatformAutoGen

2018-08-29 Thread Jaben Carsey
use decorators for property and automatic caching remove circular dependency between some APIs Cc: Liming Gao Cc: Yonghong Zhu Cc: Bob Feng Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/AutoGen/AutoGen.py | 587

[edk2] [PATCH v1 0/9] BaseTools: refactor Workspace classes

2018-08-29 Thread Jaben Carsey
callers from accessing "private" data and use the existing properties 6) removed a circular dependency between APIs Jaben Carsey (9): BaseTools: Refactor PlatformAutoGen BaseTools: AutoGen refactor WorkspaceAutoGen class BaseTools: AutoGen - refactor class properties BaseTools

[edk2] [PATCH v1 2/9] BaseTools: AutoGen refactor WorkspaceAutoGen class

2018-08-29 Thread Jaben Carsey
Update the WorkspaceAutoGen class to use caching decorators and remove the no longer needed private variables. Cc: Liming Gao Cc: Yonghong Zhu Cc: Bob Feng Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/AutoGen/AutoGen.py | 69

[edk2] [PATCH v1 1/1] BaseTools: Clarify a DSC parsing error about PCDs

2018-08-29 Thread Jaben Carsey
This error needs the information about which DEC files were searched. Cc: Yonghong Zhu Cc: Liming Gao Cc: Lee Hamel Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/Workspace/DscBuildData.py | 2 +- 1 file changed, 1 insertion

[edk2] [PATCH v1 1/1] BaseTools: Refactor to remove functionally equivalent functions

2018-08-29 Thread Jaben Carsey
IsSupportedArch and IsBinaryModule return the same value under the same curcimstances. Remove newer one with fewer callers and send them to the other function. Cc: Yonghong Zhu Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools

[edk2] [PATCH v1 1/1] BaseTools: minimize assignment processing

2018-08-28 Thread Jaben Carsey
Reverse the checking and only assign once to each variable. Cc: Yonghong Zhu Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/Workspace/DscBuildData.py | 15 --- 1 file changed, 8 insertions(+), 7

[edk2] [PATCH v1 1/1] BaseTools: AutoGen.py remove unused import

2018-08-27 Thread Jaben Carsey
AutoGen does not use anything defined in BuildClassObject Cc: Yonghong Zhu Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/AutoGen/AutoGen.py | 1 - 1 file changed, 1 deletion(-) diff --git a/BaseTools/Source

[edk2] [PATCH v1 1/1] BaseTools: Create and use a shared value for 'MSFT' from DataType

2018-08-24 Thread Jaben Carsey
I see lots of 'MSFT' throughout code and this can reduce them. Cc: Bob Feng Cc: Yonghong Zhu Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/AutoGen/AutoGen.py | 8 BaseTools/Source

[edk2] [PATCH v1 1/1] BaseTools: remove unused setter functions

2018-08-17 Thread Jaben Carsey
Cc: Yonghong Zhu Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/Workspace/DecBuildData.py | 17 +-- BaseTools/Source/Python/Workspace/DscBuildData.py | 17 +-- BaseTools/Source/Python/Workspace

[edk2] [PATCH v1 1/1] BaseTools: remove unused code

2018-08-16 Thread Jaben Carsey
the if statment just has pass statement. invert if condition and just use do the else work. Cc: Yonghong Zhu Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/Workspace/InfBuildData.py | 6 +- 1 file changed, 1

[edk2] [PATCH v1 1/1] BaseTools: Eot - fix variable names

2018-08-07 Thread Jaben Carsey
1) currently a couple classes use m instead of self (including some mixed functions that should have previously failed). 2) deleted some blank lines. Cc: Yonghong Zhu Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python

[edk2] [PATCH v1 2/5] BaseTools: AutoGen - tag a function as cachable

2018-08-03 Thread Jaben Carsey
MakeFile generation is once per module, so mark it as such. also move the time stamp creation function inside as it's only called from one place. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python

[edk2] [PATCH v1 1/5] BaseTools: AutoGen refactor ModuleAutoGen caching

2018-08-03 Thread Jaben Carsey
: Bob Feng Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/AutoGen/AutoGen.py | 1147 +--- BaseTools/Source/Python/AutoGen/GenC.py|2 +- BaseTools/Source/Python/AutoGen/GenMake.py | 12 +- BaseTools/Source/Pyt

[edk2] [PATCH v1 3/5] BaseTools: AutoGen refactor to iterate less

2018-08-03 Thread Jaben Carsey
-by: Jaben Carsey --- BaseTools/Source/Python/AutoGen/AutoGen.py | 138 ++-- 1 file changed, 66 insertions(+), 72 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index 55c84fe4fbc2..7c67f40bff00 100644 --- a/BaseTools

[edk2] [PATCH v1 0/5] Refactor AutoGen - class ModuleAutoGen

2018-08-03 Thread Jaben Carsey
. Jaben Carsey (5): BaseTools: AutoGen refactor ModuleAutoGen caching BaseTools: AutoGen - tag a function as cachable BaseTools: AutoGen refactor to iterate less BaseTools/Source/Python/AutoGen/AutoGen.py | 1852 +--- BaseTools/Source/Python/AutoGen/BuildEngine.py | 36

[edk2] [PATCH v1 1/1] PatchCheck - add error message for invalid parameter

2018-08-02 Thread Jaben Carsey
Currently if an invalid parameter is passed, it gives a stack trace. This changes it to an error message. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Scripts/PatchCheck.py | 9 ++--- 1 file changed, 6

[edk2] [PATCH v1 1/1] BaseTools: AutoGen - change class variable to funciton variable

2018-07-19 Thread Jaben Carsey
This variable is only used in one function, make it local there. Also when iterating on the variable, use dict.items() to get value instead of re-looking up the value multiple times. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben

[edk2] [PATCH v1 1/1] BaseTools: AutoGen - clean up access

2018-06-27 Thread Jaben Carsey
1) add a property so others can access needed data 2) change GenMake to use property 3) add local variable in GenMake to speed up access Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/AutoGen

[edk2] [PATCH v1 1/1] BaseTools: AutoGen - move constructor out of loop

2018-06-27 Thread Jaben Carsey
Create the 2 comparison objects once outside the loop. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/AutoGen/AutoGen.py | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git

[edk2] [PATCH v1 1/1] BaseTools: Move variable out of Global

2018-06-26 Thread Jaben Carsey
Move single use list from GlobalData (gTempInfs) into the file that uses it as _TempInfs Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/Common/GlobalData.py | 7 --- BaseTools/Source/Python

[edk2] [PATCH v1 1/1] BaseTools: AutoGen - Remove unused variables.

2018-06-25 Thread Jaben Carsey
There are 2 variables that we populate, but never use. remove them entirely. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/AutoGen/AutoGen.py | 10 -- 1 file changed, 10 deletions

[edk2] [PATCH v1 09/11] BaseTools: refactor to stop re-allocating strings

2018-06-20 Thread Jaben Carsey
strings are immutable. allocate minimal duplication. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/AutoGen/AutoGen.py | 30 BaseTools/Source/Python/AutoGen/GenC.py

[edk2] [PATCH v1 11/11] BaseTools: remove extra assignment

2018-06-20 Thread Jaben Carsey
there is no use to assign back to a variable. just return the result. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/Common/Expression.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions

[edk2] [PATCH v1 08/11] BaseTools: refactor to change object types

2018-06-20 Thread Jaben Carsey
change to object types that are closer to use case. for example: when using a list as a double ended queue, use the built in object. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/AutoGen

[edk2] [PATCH v1 07/11] BaseTools: refactor file opening/writing

2018-06-20 Thread Jaben Carsey
change mode minimal needed permissions change to use with statement Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/AutoGen/AutoGen.py | 57 - BaseTools/Source/Python

[edk2] [PATCH v1 04/11] BaseTools: remove repeated calls to startswith/endswith

2018-06-20 Thread Jaben Carsey
As both can take a tuple, use that instead of calling repeatedly. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/AutoGen/GenMake.py | 2 +- BaseTools/Source/Python/AutoGen

[edk2] [PATCH v1 05/11] BaseTools: use set presence instead of series of equality

2018-06-20 Thread Jaben Carsey
Instead of testing each equality individually, just make a set and test once. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/Ecc/Configuration.py | 10 +- 1 file changed, 1 insertion(+), 9

[edk2] [PATCH v1 06/11] BaseTools: refactor section generation

2018-06-20 Thread Jaben Carsey
use with for opening files remove unneeded variables dont seek to 0 for just opened file Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/Common/DataType.py | 1 + BaseTools/Source

[edk2] [PATCH v2 00/11] BaseTools Refactoring

2018-06-20 Thread Jaben Carsey
performing operation since strings are immutable and must be completely reallocated and moved for each concatenation. v2: Update for concerns sent by Yonghong. Jaben Carsey (11): BaseTools: decorate base classes to prevent instantiation BaseTools: Workspace - create a base class BaseTools

[edk2] [PATCH v1 01/11] BaseTools: decorate base classes to prevent instantiation

2018-06-20 Thread Jaben Carsey
use python's ABC (abstract base class) to raise type errors if we instantiate classes we designed to be used only as base classes for other classes. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python

[edk2] [PATCH v1 02/11] BaseTools: Workspace - create a base class

2018-06-20 Thread Jaben Carsey
refactor 3 classes and create a new base class for their shared functions. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/Workspace/BuildClassObject.py | 140 +++- 1 file changed

[edk2] [PATCH v1 03/11] BaseTools: remove unused code

2018-06-20 Thread Jaben Carsey
delete commented out code delete never used class/variable/function/import refactor to remove Ffs class dont construct class just for class attribute Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python

  1   2   3   4   >