ccc: Get host information via Driver methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62011 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/ccc/ccclib/HostInfo.py b/tools/ccc/ccclib/HostInfo.py
index ccfd32b..507ac69 100644
--- a/tools/ccc/ccclib/HostInfo.py
+++ b/tools/ccc/ccclib/HostInfo.py
@@ -34,7 +34,9 @@
def getArchName(self):
return 'x86_64'
-def getDarwinHostInfo(machine, bits):
+def getDarwinHostInfo(driver):
+ machine = driver.getHostMachine()
+ bits = driver.getHostBits()
if machine == 'i386':
if bits == '32':
return DarwinX86HostInfo()
@@ -46,7 +48,7 @@
if bits == '64':
return DarwinPPC_64HostInfo()
- raise RuntimeError,'Unrecognized Darwin-i386 platform: %r:%r' % (machine, bits)
+ raise RuntimeError,'Unrecognized Darwin platform: %r:%r' % (machine, bits)
# Unknown
@@ -57,7 +59,7 @@
def useDriverDriver(self):
return False
-def getUnknownHostInfo(machine, bits):
+def getUnknownHostInfo(driver):
return UnknownHostInfo()
####
@@ -67,10 +69,11 @@
'unknown' : getUnknownHostInfo,
}
-def getHostInfo(driver, system, machine, bits):
+def getHostInfo(driver):
+ system = driver.getHostSystemName()
handler = kSystems.get(system)
if handler:
- return handler(machine, bits)
+ return handler(driver)
driver.warning('Unknown host %r, using generic host information.' % system)
return UnknownHostInfo()