From c8d07c5eeb481e777ad48dc1737d1ab1be67bd44 Mon Sep 17 00:00:00 2001 From: Yonghong Zhu Date: Wed, 23 Mar 2016 17:34:13 +0800 Subject: BaseTools: Add two new sections for PCD in the build report Build Spec updated to add two new sections for PCD in the build report. 1.Conditional directives section:If the DSC or FDF file contains conditional directive statements. 2.Unused PCDs section: If the DSC or FDF file define values for PCDs that are not used by any module and are not used in conditional directive statements. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu Reviewed-by: Liming Gao --- BaseTools/Source/Python/Common/Expression.py | 6 +++++- BaseTools/Source/Python/Common/GlobalData.py | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'BaseTools/Source/Python/Common') diff --git a/BaseTools/Source/Python/Common/Expression.py b/BaseTools/Source/Python/Common/Expression.py index 3c8d14e6ce..7b3030c5fa 100644 --- a/BaseTools/Source/Python/Common/Expression.py +++ b/BaseTools/Source/Python/Common/Expression.py @@ -1,7 +1,7 @@ ## @file # This file is used to parse and evaluate expression in directive or PCD value. # -# Copyright (c) 2011, Intel Corporation. All rights reserved.
+# Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -76,6 +76,10 @@ def ReplaceExprMacro(String, Macros, ExceptionList = None): InQuote = True MacroStartPos = String.find('$(') if MacroStartPos < 0: + for Pcd in gPlatformPcds.keys(): + if Pcd in String: + if Pcd not in gConditionalPcds: + gConditionalPcds.append(Pcd) continue RetStr = '' while MacroStartPos >= 0: diff --git a/BaseTools/Source/Python/Common/GlobalData.py b/BaseTools/Source/Python/Common/GlobalData.py index 8f544bd1b2..c3439ebbfc 100644 --- a/BaseTools/Source/Python/Common/GlobalData.py +++ b/BaseTools/Source/Python/Common/GlobalData.py @@ -78,3 +78,6 @@ gFdfParser = None gTempInfs = [] BuildOptionPcd = [] + +# Pcd name for the Pcd which used in the Conditional directives +gConditionalPcds = [] -- cgit v1.2.3