diff options
author | Yunhua Feng <yunhuax.feng@intel.com> | 2018-01-27 00:28:05 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2018-01-30 22:44:59 +0800 |
commit | 35f613d96ce43c7b23cd77aab063424ec4422e0c (patch) | |
tree | 470967c42683749dcc72a3626fd78192e896c1dc /BaseTools/Source/Python/AutoGen/AutoGen.py | |
parent | b23fc39cd3c32663a0fa5ae11676e4ad4a2dddf9 (diff) | |
download | edk2-35f613d96ce43c7b23cd77aab063424ec4422e0c.tar.gz edk2-35f613d96ce43c7b23cd77aab063424ec4422e0c.tar.bz2 edk2-35f613d96ce43c7b23cd77aab063424ec4422e0c.zip |
BaseTools: Enhance parse performance by optimize ValueExpressionEx
Optimize ValueExpressionEx function to enhance meta-data file parse
performance.
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/AutoGen/AutoGen.py')
-rw-r--r-- | BaseTools/Source/Python/AutoGen/AutoGen.py | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index ab178c9a4a..1cf50e872f 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -1245,6 +1245,7 @@ class PlatformAutoGen(AutoGen): # get the original module/package/platform objects
self.BuildDatabase = Workspace.BuildDatabase
self.DscBuildDataObj = Workspace.Platform
+ self._GuidDict = Workspace._GuidDict
# flag indicating if the makefile/C-code file has been created or not
self.IsMakeFileCreated = False
@@ -2463,22 +2464,9 @@ class PlatformAutoGen(AutoGen): if FromPcd.SkuInfoList not in [None, '', []]:
ToPcd.SkuInfoList = FromPcd.SkuInfoList
# Add Flexible PCD format parse
- PcdValue = ToPcd.DefaultValue
- if PcdValue:
- try:
- ToPcd.DefaultValue = ValueExpression(PcdValue)(True)
- except WrnExpression, Value:
- ToPcd.DefaultValue = Value.result
- except BadExpression, Value:
- EdkLogger.error('Parser', FORMAT_INVALID, 'PCD [%s.%s] Value "%s", %s' %(ToPcd.TokenSpaceGuidCName, ToPcd.TokenCName, ToPcd.DefaultValue, Value),
- File=self.MetaFile)
if ToPcd.DefaultValue:
- _GuidDict = {}
- for Pkg in self.PackageList:
- Guids = Pkg.Guids
- _GuidDict.update(Guids)
try:
- ToPcd.DefaultValue = ValueExpressionEx(ToPcd.DefaultValue, ToPcd.DatumType, _GuidDict)(True)
+ ToPcd.DefaultValue = ValueExpressionEx(ToPcd.DefaultValue, ToPcd.DatumType, self._GuidDict)(True)
except BadExpression, Value:
EdkLogger.error('Parser', FORMAT_INVALID, 'PCD [%s.%s] Value "%s", %s' %(ToPcd.TokenSpaceGuidCName, ToPcd.TokenCName, ToPcd.DefaultValue, Value),
File=self.MetaFile)
|