[cfe-commits] r65102 - in /cfe/trunk/tools/ccc/ccclib: HostInfo.py ToolChain.py

Daniel Dunbar daniel at zuster.org
Thu Feb 19 17:36:35 PST 2009


Author: ddunbar
Date: Thu Feb 19 19:36:35 2009
New Revision: 65102

URL: http://llvm.org/viewvc/llvm-project?rev=65102&view=rev
Log:
ccc: Store arch name in all toolchains.
 - No functionality change.

Modified:
    cfe/trunk/tools/ccc/ccclib/HostInfo.py
    cfe/trunk/tools/ccc/ccclib/ToolChain.py

Modified: cfe/trunk/tools/ccc/ccclib/HostInfo.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/ccc/ccclib/HostInfo.py?rev=65102&r1=65101&r2=65102&view=diff

==============================================================================
--- cfe/trunk/tools/ccc/ccclib/HostInfo.py (original)
+++ cfe/trunk/tools/ccc/ccclib/HostInfo.py Thu Feb 19 19:36:35 2009
@@ -43,11 +43,11 @@
     def getToolChainForArch(self, arch):
         if arch in ('i386', 'x86_64'):
             return ToolChain.Darwin_X86_ToolChain(self.driver,
+                                                  arch,
                                                   self.darwinVersion,
-                                                  self.gccVersion,
-                                                  arch)
+                                                  self.gccVersion)
 
-        return ToolChain.Generic_GCC_ToolChain(self.driver)
+        return ToolChain.Generic_GCC_ToolChain(self.driver, '')
 
 class DarwinPPCHostInfo(DarwinHostInfo):
     def getArchName(self, args):
@@ -92,14 +92,14 @@
 # Unknown
 
 class UnknownHostInfo(HostInfo):
-    def getArchName(self):
+    def getArchName(self, args):
         raise RuntimeError,'getArchName() unsupported on unknown host.'
 
     def useDriverDriver(self):
         return False
 
     def getToolChain(self):
-        return ToolChain.Generic_GCC_ToolChain(self.driver)
+        return ToolChain.Generic_GCC_ToolChain(self.driver, '')
 
 def getUnknownHostInfo(driver):
     return UnknownHostInfo(driver)

Modified: cfe/trunk/tools/ccc/ccclib/ToolChain.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/ccc/ccclib/ToolChain.py?rev=65102&r1=65101&r2=65102&view=diff

==============================================================================
--- cfe/trunk/tools/ccc/ccclib/ToolChain.py (original)
+++ cfe/trunk/tools/ccc/ccclib/ToolChain.py Thu Feb 19 19:36:35 2009
@@ -10,10 +10,11 @@
 class ToolChain(object):
     """ToolChain - Provide mappings of Actions to Tools."""
 
-    def __init__(self, driver, 
+    def __init__(self, driver, archName,
                  filePathPrefixes=[],
                  programPathPrefixes=[]):
         self.driver = driver
+        self.archName = archName
         self.filePathPrefixes = list(filePathPrefixes)
         self.programPathPrefixes = list(programPathPrefixes)
 
@@ -80,13 +81,12 @@
         return True
 
 class Darwin_X86_ToolChain(ToolChain):
-    def __init__(self, driver, darwinVersion, gccVersion, archName):
-        super(Darwin_X86_ToolChain, self).__init__(driver)
+    def __init__(self, driver, archName, darwinVersion, gccVersion):
+        super(Darwin_X86_ToolChain, self).__init__(driver, archName)
         assert isinstance(darwinVersion, tuple) and len(darwinVersion) == 3
         assert isinstance(gccVersion, tuple) and len(gccVersion) == 3
         self.darwinVersion = darwinVersion
         self.gccVersion = gccVersion
-        self.archName = archName
 
         self.clangTool = Tools.Clang_CompileTool(self)
         cc = Tools.Darwin_X86_CompileTool(self)
@@ -235,8 +235,8 @@
     perform all subcommands; this relies on gcc translating the
     options appropriately."""
 
-    def __init__(self, driver):
-        super(Generic_GCC_ToolChain, self).__init__(driver)
+    def __init__(self, driver, archName):
+        super(Generic_GCC_ToolChain, self).__init__(driver, archName)
         cc = Tools.GCC_CompileTool(self)
         self.clangTool = Tools.Clang_CompileTool(self)
         self.toolMap = {





More information about the cfe-commits mailing list