diff options
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) |

