summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/Workspace/MetaFileParser.py
diff options
context:
space:
mode:
authorYunhua Feng <yunhuax.feng@intel.com>2018-01-27 00:28:05 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2018-01-30 22:44:59 +0800
commit35f613d96ce43c7b23cd77aab063424ec4422e0c (patch)
tree470967c42683749dcc72a3626fd78192e896c1dc /BaseTools/Source/Python/Workspace/MetaFileParser.py
parentb23fc39cd3c32663a0fa5ae11676e4ad4a2dddf9 (diff)
downloadedk2-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/Workspace/MetaFileParser.py')
-rw-r--r--BaseTools/Source/Python/Workspace/MetaFileParser.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py b/BaseTools/Source/Python/Workspace/MetaFileParser.py
index 8f4b5e5cc1..c928cef70f 100644
--- a/BaseTools/Source/Python/Workspace/MetaFileParser.py
+++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py
@@ -1593,6 +1593,8 @@ class DscParser(MetaFileParser):
ValList[Index] = ValueExpression(PcdValue, self._Macros)(True)
except WrnExpression, Value:
ValList[Index] = Value.result
+ except:
+ pass
if ValList[Index] == 'True':
ValList[Index] = '1'
@@ -1990,14 +1992,6 @@ class DecParser(MetaFileParser):
PcdValue = ValueList[0]
if PcdValue:
try:
- ValueList[0] = ValueExpression(PcdValue, self._AllPcdDict)(True)
- except WrnExpression, Value:
- ValueList[0] = Value.result
- except BadExpression, Value:
- EdkLogger.error('Parser', FORMAT_INVALID, Value, File=self.MetaFile, Line=self._LineIndex + 1)
-
- if ValueList[0]:
- try:
ValueList[0] = ValueExpressionEx(ValueList[0], ValueList[1], self._GuidDict)(True)
except BadExpression, Value:
EdkLogger.error('Parser', FORMAT_INVALID, Value, ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)