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 <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Yonghong Zhu
2016-03-23 17:34:13 +08:00
parent f423d76021
commit c8d07c5eeb
3 changed files with 104 additions and 17 deletions

View File

@ -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.<BR>
# Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>
# 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: