From ae57950fc878618083bca435fa4bc00d4bec97c1 Mon Sep 17 00:00:00 2001 From: zhijufan Date: Wed, 12 Sep 2018 14:58:54 +0800 Subject: [PATCH] BaseTools: Fix a bug for Unused PCDs section display in the report Fix a regression issue caused by ac4578af364, when there doesn't exist not used PCD, it also display the not used Pcd section in the report. Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=1170 Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan Reviewed-by: Yonghong Zhu --- BaseTools/Source/Python/build/BuildReport.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Source/Python/build/BuildReport.py index c7fa1b97db..49bcd9c060 100644 --- a/BaseTools/Source/Python/build/BuildReport.py +++ b/BaseTools/Source/Python/build/BuildReport.py @@ -888,7 +888,17 @@ class PcdReport(object): if self.ConditionalPcds: self.GenerateReportDetail(File, ModulePcdSet, 1) if self.UnusedPcds: - self.GenerateReportDetail(File, ModulePcdSet, 2) + IsEmpty = True + for Token in self.UnusedPcds: + TokenDict = self.UnusedPcds[Token] + for Type in TokenDict: + if TokenDict[Type]: + IsEmpty = False + break + if not IsEmpty: + break + if not IsEmpty: + self.GenerateReportDetail(File, ModulePcdSet, 2) self.GenerateReportDetail(File, ModulePcdSet) ## -- 2.39.2