BaseTools: fix a bug for PEI VPD Pcd collection

When a PEI phase VPD PCD only list in the DSC IA32 arch, then build X64
arch image, it missed to collect this PEI VPD pcd into VPD Pcd map file.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py
index f29d368..50d585f 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -861,6 +861,7 @@
     # 

     _DynaPcdList_ = []

     _NonDynaPcdList_ = []

+    _PlatformPcds = {}

     

     #

     # The priority list while override build option 

@@ -1213,8 +1214,12 @@
         OtherPcdArray   = []

         VpdPcdDict      = {}

         VpdFile               = VpdInfoFile.VpdInfoFile()

-        NeedProcessVpdMapFile = False                    

-        

+        NeedProcessVpdMapFile = False

+

+        for pcd in self.Platform.Pcds.keys():

+            if pcd not in self._PlatformPcds.keys():

+                self._PlatformPcds[pcd] = self.Platform.Pcds[pcd]

+

         if (self.Workspace.ArchList[-1] == self.Arch): 

             for Pcd in self._DynamicPcdList:

                 # just pick the a value to determine whether is unicode string type

@@ -1233,13 +1238,13 @@
                 if Pcd.Type in [TAB_PCDS_DYNAMIC_VPD, TAB_PCDS_DYNAMIC_EX_VPD]:

                     VpdPcdDict[(Pcd.TokenCName, Pcd.TokenSpaceGuidCName)] = Pcd

 

-            PlatformPcds = self.Platform.Pcds.keys()

+            PlatformPcds = self._PlatformPcds.keys()

             PlatformPcds.sort()

             #

             # Add VPD type PCD into VpdFile and determine whether the VPD PCD need to be fixed up.

             #

             for PcdKey in PlatformPcds:

-                Pcd = self.Platform.Pcds[PcdKey]

+                Pcd = self._PlatformPcds[PcdKey]

                 if Pcd.Type in [TAB_PCDS_DYNAMIC_VPD, TAB_PCDS_DYNAMIC_EX_VPD] and \

                    PcdKey in VpdPcdDict:

                     Pcd = VpdPcdDict[PcdKey]

@@ -1281,7 +1286,7 @@
             # An example is PCD for signature usage.

             #            

             for DscPcd in PlatformPcds:

-                DscPcdEntry = self.Platform.Pcds[DscPcd]

+                DscPcdEntry = self._PlatformPcds[DscPcd]

                 if DscPcdEntry.Type in [TAB_PCDS_DYNAMIC_VPD, TAB_PCDS_DYNAMIC_EX_VPD]:

                     if not (self.Platform.VpdToolGuid == None or self.Platform.VpdToolGuid == ''):

                         FoundFlag = False