diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2009-05-02 22:13:56 +0000 | 
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2009-05-02 22:13:56 +0000 | 
| commit | 49aff46fed32fee0f845278154597f0d03cfe7e3 (patch) | |
| tree | 37ce51c2abd4dfc1d3bdbb7604b104aa27d26578 /clang/tools/ccc/ccclib/HostInfo.py | |
| parent | 82f61f96ba0410a2e14044976b08ff39768eb659 (diff) | |
| download | bcm5719-llvm-49aff46fed32fee0f845278154597f0d03cfe7e3.tar.gz bcm5719-llvm-49aff46fed32fee0f845278154597f0d03cfe7e3.zip | |
ccc is dead.
llvm-svn: 70649
Diffstat (limited to 'clang/tools/ccc/ccclib/HostInfo.py')
| -rw-r--r-- | clang/tools/ccc/ccclib/HostInfo.py | 133 | 
1 files changed, 0 insertions, 133 deletions
| diff --git a/clang/tools/ccc/ccclib/HostInfo.py b/clang/tools/ccc/ccclib/HostInfo.py deleted file mode 100644 index c40a4f7c4d2..00000000000 --- a/clang/tools/ccc/ccclib/HostInfo.py +++ /dev/null @@ -1,133 +0,0 @@ -import ToolChain -import Types - -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, driver): -        self.driver = driver - -    def getArchName(self, args): -        abstract - -    def useDriverDriver(self): -        abstract - -    def lookupTypeForExtension(self, ext): -        abstract - -    def getToolChain(self): -        abstract - -    def getToolChainForArch(self, arch): -        raise RuntimeError,"getToolChainForArch() unsupported on this host." - -# Darwin - -class DarwinHostInfo(HostInfo): -    def __init__(self, driver): -        super(DarwinHostInfo, self).__init__(driver) -         -        # FIXME: Find right regex for this. -        import re -        m = re.match(r'([0-9]+)\.([0-9]+)\.([0-9]+)', driver.getHostReleaseName()) -        if not m: -            raise RuntimeError,"Unable to determine Darwin version." -        self.darwinVersion = tuple(map(int, m.groups())) -        self.gccVersion = (4,2,1) - -    def useDriverDriver(self): -        return True - -    def lookupTypeForExtension(self, ext): -        ty = Types.kTypeSuffixMap.get(ext) -        if ty is Types.AsmTypeNoPP: -            return Types.AsmType -        return ty - -    def getToolChain(self): -        return self.getToolChainForArch(self.getArchName(None)) - -    def getToolChainForArch(self, arch): -        if arch in ('i386', 'x86_64'): -            return ToolChain.Darwin_X86_ToolChain(self.driver, -                                                  arch, -                                                  self.darwinVersion, -                                                  self.gccVersion) - -        return ToolChain.Darwin_GCC_ToolChain(self.driver, arch) - -class DarwinPPCHostInfo(DarwinHostInfo): -    def getArchName(self, args): -        if args and args.getLastArg(args.parser.m_64Option): -            return 'ppc64' -        return 'ppc' - -class DarwinPPC_64HostInfo(DarwinHostInfo): -    def getArchName(self, args): -        if args and args.getLastArg(args.parser.m_32Option): -            return 'ppc' -        return 'ppc64' - -class DarwinX86HostInfo(DarwinHostInfo): -    def getArchName(self, args): -        if args and args.getLastArg(args.parser.m_64Option): -            return 'x86_64' -        return 'i386' - -class DarwinX86_64HostInfo(DarwinHostInfo): -    def getArchName(self, args): -        if args and args.getLastArg(args.parser.m_32Option): -            return 'i386' -        return 'x86_64' - -def getDarwinHostInfo(driver): -    machine = driver.getHostMachine() -    bits = driver.getHostBits() -    if machine == 'i386': -        if bits == '32': -            return DarwinX86HostInfo(driver) -        if bits == '64': -            return DarwinX86_64HostInfo(driver) -    elif machine == 'ppc': -        if bits == '32': -            return DarwinPPCHostInfo(driver) -        if bits == '64': -            return DarwinPPC_64HostInfo(driver) -             -    raise RuntimeError,'Unrecognized Darwin platform: %r:%r' % (machine, bits) - -# Unknown - -class UnknownHostInfo(HostInfo): -    def getArchName(self, args): -        raise RuntimeError,'getArchName() unsupported on unknown host.' - -    def useDriverDriver(self): -        return False - -    def lookupTypeForExtension(self, ext): -        return Types.kTypeSuffixMap.get(ext) - -    def getToolChain(self): -        return ToolChain.Generic_GCC_ToolChain(self.driver, '') - -def getUnknownHostInfo(driver): -    return UnknownHostInfo(driver) - -#### - -kSystems = { -    'darwin' : getDarwinHostInfo, -    'unknown' : getUnknownHostInfo, -    } - -def getHostInfo(driver): -    system = driver.getHostSystemName() -    handler = kSystems.get(system) -    if handler: -        return handler(driver) - -    return UnknownHostInfo(driver) | 

