Enabled depex optimization in AutoGen
authorjwang36 <jwang36@7335b38e-4728-0410-8992-fb3ffe349368>
Thu, 28 Feb 2008 07:19:53 +0000 (07:19 +0000)
committerjwang36 <jwang36@7335b38e-4728-0410-8992-fb3ffe349368>
Thu, 28 Feb 2008 07:19:53 +0000 (07:19 +0000)
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@1027 7335b38e-4728-0410-8992-fb3ffe349368

Source/Python/AutoGen/AutoGen.py
Source/Python/AutoGen/GenDepex.py

index 4ef3403..c381e1c 100755 (executable)
@@ -1214,7 +1214,7 @@ class ModuleAutoGen(object):
 \r
         os.chdir(self.BuildInfo.OutputDir)\r
         if self.BuildInfo.DepexList != []:\r
-            Dpx = GenDepex.DependencyExpression(self.BuildInfo.DepexList, self.BuildInfo.ModuleType)\r
+            Dpx = GenDepex.DependencyExpression(self.BuildInfo.DepexList, self.BuildInfo.ModuleType, True)\r
             DpxFile = gAutoGenDepexFileName % {"module_name" : self.BuildInfo.Name}\r
             if Dpx.Generate(DpxFile):\r
                 AutoGenList.append(DpxFile)\r
index d5e899a..93c65fa 100644 (file)
@@ -223,8 +223,13 @@ class DependencyExpression:
             if Token in self.SupportedOpcode or Token in NewOperand:\r
                 continue\r
             NewOperand.append(Token)\r
-        Op = " " + Op + " "\r
-        self.TokenList = Op.join(NewOperand).split()\r
+\r
+        self.TokenList = []\r
+        while True:\r
+            self.TokenList.append(NewOperand.pop(0))\r
+            if NewOperand == []:\r
+                break\r
+            self.TokenList.append(Op)\r
         self.PostfixNotation = []\r
         self.GetPostfixNotation()\r
 \r