diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2009-01-10 02:07:54 +0000 | 
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2009-01-10 02:07:54 +0000 | 
| commit | cb8d7e131cfb06cb251c2ddceddf83f9cb5bc57d (patch) | |
| tree | 85245d311e2db8e44b3dedd529a893069a287cc9 /clang/tools/ccc/ccclib/HostInfo.py | |
| parent | eacf5b174dd6e7b910a84cd88be5580ff8277e3c (diff) | |
| download | bcm5719-llvm-cb8d7e131cfb06cb251c2ddceddf83f9cb5bc57d.tar.gz bcm5719-llvm-cb8d7e131cfb06cb251c2ddceddf83f9cb5bc57d.zip | |
ccc: Introduce ToolChains for mapping Actions to Tools which can
perform them.
 - A ToolChain is a coherent set of tools use in a compilation
   process. The idea is that a ToolChain holds roughly the information
   (specs, search paths, etc.) that is in a single gcc binary.
 - The default ToolChain is selected by the host and will generally
   correspond to what the default system compiler would do. However,
   this can be over-riden for a variety of purposes, for example the
   by the driver driver or for testing.
llvm-svn: 62021
Diffstat (limited to 'clang/tools/ccc/ccclib/HostInfo.py')
| -rw-r--r-- | clang/tools/ccc/ccclib/HostInfo.py | 24 | 
1 files changed, 16 insertions, 8 deletions
| diff --git a/clang/tools/ccc/ccclib/HostInfo.py b/clang/tools/ccc/ccclib/HostInfo.py index 507ac69cd5c..5f681495e13 100644 --- a/clang/tools/ccc/ccclib/HostInfo.py +++ b/clang/tools/ccc/ccclib/HostInfo.py @@ -1,10 +1,12 @@ +import ToolChain +  class HostInfo(object):      """HostInfo - Config information about a particular host which may      interact with driver behavior. This can be very different from the      target(s) of a particular driver invocation.""" -    def __init__(self): -        pass +    def __init__(self, driver): +        self.driver = driver      def getArchName(self):          abstract @@ -18,6 +20,9 @@ class DarwinHostInfo(HostInfo):      def useDriverDriver(self):          return True +    def getToolChain(self): +        return ToolChain.Darwin_ToolChain(self.driver) +  class DarwinPPCHostInfo(DarwinHostInfo):      def getArchName(self):          return 'ppc' @@ -39,14 +44,14 @@ def getDarwinHostInfo(driver):      bits = driver.getHostBits()      if machine == 'i386':          if bits == '32': -            return DarwinX86HostInfo() +            return DarwinX86HostInfo(driver)          if bits == '64': -            return DarwinX86_64HostInfo() +            return DarwinX86_64HostInfo(driver)      elif machine == 'ppc':          if bits == '32': -            return DarwinPPCHostInfo() +            return DarwinPPCHostInfo(driver)          if bits == '64': -            return DarwinPPC_64HostInfo() +            return DarwinPPC_64HostInfo(driver)      raise RuntimeError,'Unrecognized Darwin platform: %r:%r' % (machine, bits) @@ -59,8 +64,11 @@ class UnknownHostInfo(HostInfo):      def useDriverDriver(self):          return False +    def getToolChain(self): +        return ToolChain.Generic_GCC_ToolChain(self.driver) +  def getUnknownHostInfo(driver): -    return UnknownHostInfo() +    return UnknownHostInfo(driver)  #### @@ -76,4 +84,4 @@ def getHostInfo(driver):          return handler(driver)      driver.warning('Unknown host %r, using generic host information.' % system) -    return UnknownHostInfo() +    return UnknownHostInfo(driver) | 

