summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/Workspace/DecBuildData.py
diff options
context:
space:
mode:
authorCarsey, Jaben <jaben.carsey@intel.com>2019-01-10 03:00:41 +0800
committerBobCF <bob.c.feng@intel.com>2019-01-10 22:01:11 +0800
commit938cf4c33a0695ef1011b07e455a7ec2f87b5ad3 (patch)
tree54d533d009cb2e8952608eefe2baf6200971d2b1 /BaseTools/Source/Python/Workspace/DecBuildData.py
parenta53a888de8f5fa8dbf75a381e28f25a5497572f1 (diff)
downloadedk2-938cf4c33a0695ef1011b07e455a7ec2f87b5ad3.tar.gz
edk2-938cf4c33a0695ef1011b07e455a7ec2f87b5ad3.tar.bz2
edk2-938cf4c33a0695ef1011b07e455a7ec2f87b5ad3.zip
BaseTools: fix imports
1 - Some of these imports are cascaded from another file. Import them locally. 2 - Some of these imports are not used. Remove them. 3 - Some of these were missing the namespace used to import them. These changes facilitate optimization of BaseTools: https://bugzilla.tianocore.org/show_bug.cgi?id=42 Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/Workspace/DecBuildData.py')
-rw-r--r--BaseTools/Source/Python/Workspace/DecBuildData.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/BaseTools/Source/Python/Workspace/DecBuildData.py b/BaseTools/Source/Python/Workspace/DecBuildData.py
index cc00409fee..13b653bd98 100644
--- a/BaseTools/Source/Python/Workspace/DecBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DecBuildData.py
@@ -16,8 +16,10 @@ from Common.DataType import *
from Common.Misc import *
from types import *
from collections import OrderedDict
-
+from CommonDataClass.DataClass import *
from Workspace.BuildClassObject import PackageBuildClassObject, StructurePcd, PcdClassObject
+from Common.GlobalData import gGlobalDefines, gEcpSource
+from re import compile
## Platform build information from DEC file
#
@@ -109,7 +111,7 @@ class DecBuildData(PackageBuildClassObject):
@property
def _Macros(self):
if self._MacroDict is None:
- self._MacroDict = dict(GlobalData.gGlobalDefines)
+ self._MacroDict = dict(gGlobalDefines)
return self._MacroDict
## Get architecture
@@ -298,7 +300,7 @@ class DecBuildData(PackageBuildClassObject):
PublicInclues = []
RecordList = self._RawData[MODEL_EFI_INCLUDE, self._Arch]
Macros = self._Macros
- Macros["EDK_SOURCE"] = GlobalData.gEcpSource
+ Macros["EDK_SOURCE"] = gEcpSource
for Record in RecordList:
File = PathClass(NormPath(Record[0], Macros), self._PackageDir, Arch=self._Arch)
LineNo = Record[-1]
@@ -464,6 +466,7 @@ class DecBuildData(PackageBuildClassObject):
StructurePcds = self.ProcessStructurePcd(StrPcdSet)
for pcd in StructurePcds:
Pcds[pcd.TokenCName, pcd.TokenSpaceGuidCName, self._PCD_TYPE_STRING_[Type]] = pcd
+ StructPattern = compile(r'[_a-zA-Z][0-9A-Za-z_]*$')
for pcd in Pcds.values():
if pcd.DatumType not in [TAB_UINT8, TAB_UINT16, TAB_UINT32, TAB_UINT64, TAB_VOID, "BOOLEAN"]:
if not pcd.IsAggregateDatumType():