]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/build/BuildReport.py
BaseTools:use iterate list to replace the itertools
[mirror_edk2.git] / BaseTools / Source / Python / build / BuildReport.py
index 3f3c1a12f1f035d085e31e355a3e4ae1f1a8ac34..6c9a20b373a09e1e1011c58f6a9d1ccad12eaa6c 100644 (file)
@@ -332,10 +332,6 @@ class LibraryReport(object):
     #\r
     def __init__(self, M):\r
         self.LibraryList = []\r
-        if int(str(M.AutoGenVersion), 0) >= 0x00010005:\r
-            self._EdkIIModule = True\r
-        else:\r
-            self._EdkIIModule = False\r
 \r
         for Lib in M.DependentLibraryList:\r
             LibInfPath = str(Lib)\r
@@ -368,28 +364,23 @@ class LibraryReport(object):
                 LibInfPath = LibraryItem[0]\r
                 FileWrite(File, LibInfPath)\r
 \r
-                #\r
-                # Report library class, library constructor and destructor for\r
-                # EDKII style module.\r
-                #\r
-                if self._EdkIIModule:\r
-                    LibClass = LibraryItem[1]\r
-                    EdkIILibInfo = ""\r
-                    LibConstructor = " ".join(LibraryItem[2])\r
-                    if LibConstructor:\r
-                        EdkIILibInfo += " C = " + LibConstructor\r
-                    LibDestructor = " ".join(LibraryItem[3])\r
-                    if LibDestructor:\r
-                        EdkIILibInfo += " D = " + LibDestructor\r
-                    LibDepex = " ".join(LibraryItem[4])\r
-                    if LibDepex:\r
-                        EdkIILibInfo += " Depex = " + LibDepex\r
-                    if LibraryItem[5]:\r
-                        EdkIILibInfo += " Time = " + LibraryItem[5]\r
-                    if EdkIILibInfo:\r
-                        FileWrite(File, "{%s: %s}" % (LibClass, EdkIILibInfo))\r
-                    else:\r
-                        FileWrite(File, "{%s}" % LibClass)\r
+                LibClass = LibraryItem[1]\r
+                EdkIILibInfo = ""\r
+                LibConstructor = " ".join(LibraryItem[2])\r
+                if LibConstructor:\r
+                    EdkIILibInfo += " C = " + LibConstructor\r
+                LibDestructor = " ".join(LibraryItem[3])\r
+                if LibDestructor:\r
+                    EdkIILibInfo += " D = " + LibDestructor\r
+                LibDepex = " ".join(LibraryItem[4])\r
+                if LibDepex:\r
+                    EdkIILibInfo += " Depex = " + LibDepex\r
+                if LibraryItem[5]:\r
+                    EdkIILibInfo += " Time = " + LibraryItem[5]\r
+                if EdkIILibInfo:\r
+                    FileWrite(File, "{%s: %s}" % (LibClass, EdkIILibInfo))\r
+                else:\r
+                    FileWrite(File, "{%s}" % LibClass)\r
 \r
             FileWrite(File, gSubSectionEnd)\r
 \r
@@ -1204,8 +1195,11 @@ class PcdReport(object):
         HasDscOverride = False\r
         if struct:\r
             for _, Values in struct.items():\r
-                if Values[1] and Values[1].endswith('.dsc'):\r
-                    HasDscOverride = True\r
+                for Key, value in Values.items():\r
+                    if value[1] and value[1].endswith('.dsc'):\r
+                        HasDscOverride = True\r
+                        break\r
+                if HasDscOverride == True:\r
                     break\r
         return HasDscOverride\r
 \r
@@ -1254,9 +1248,11 @@ class PcdReport(object):
                         Value = "0x{:X} ({})".format(int(Value, 0), Value)\r
                 FileWrite(File, '    %*s = %s' % (self.MaxLen + 19, 'DEC DEFAULT', Value))\r
             if IsStructure:\r
-                self.PrintStructureInfo(File, Pcd.DefaultValues)\r
+                for filedvalues in Pcd.DefaultValues.values():\r
+                    self.PrintStructureInfo(File, filedvalues)\r
         if DecMatch and IsStructure:\r
-            self.PrintStructureInfo(File, Pcd.DefaultValues)\r
+            for filedvalues in Pcd.DefaultValues.values():\r
+                self.PrintStructureInfo(File, filedvalues)\r
 \r
     def PrintPcdValue(self, File, Pcd, PcdTokenCName, TypeName, IsStructure, DscMatch, DscDefaultValue, InfMatch, InfDefaultValue, DecMatch, DecDefaultValue, Flag = '  '):\r
         if not Pcd.SkuInfoList:\r
@@ -1546,15 +1542,8 @@ class PredictionReport(object):
 \r
                 if Module.Guid and not Module.IsLibrary:\r
                     EntryPoint = " ".join(Module.Module.ModuleEntryPointList)\r
-                    if int(str(Module.AutoGenVersion), 0) >= 0x00010005:\r
-                        RealEntryPoint = "_ModuleEntryPoint"\r
-                    else:\r
-                        RealEntryPoint = EntryPoint\r
-                        if EntryPoint == "_ModuleEntryPoint":\r
-                            CCFlags = Module.BuildOption.get("CC", {}).get("FLAGS", "")\r
-                            Match = gGlueLibEntryPoint.search(CCFlags)\r
-                            if Match:\r
-                                EntryPoint = Match.group(1)\r
+\r
+                    RealEntryPoint = "_ModuleEntryPoint"\r
 \r
                     self._FfsEntryPoint[Module.Guid.upper()] = (EntryPoint, RealEntryPoint)\r
 \r