diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-03-17 19:00:50 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-03-17 19:00:50 +0000 |
commit | b42a26c0a561e61eb2573a9803c46ccddaad8956 (patch) | |
tree | f56564bd9e3b21af9e11dae7e8eff63b87580680 /clang/lib/Driver/Driver.cpp | |
parent | c1b70b20390a5d6428b7b0c46a564b7821ba13ff (diff) | |
download | bcm5719-llvm-b42a26c0a561e61eb2573a9803c46ccddaad8956.tar.gz bcm5719-llvm-b42a26c0a561e61eb2573a9803c46ccddaad8956.zip |
Driver: Hide HostInfo implementations.
- Also, normalize arch names a tad and stub out getToolChain
implementations.
llvm-svn: 67091
Diffstat (limited to 'clang/lib/Driver/Driver.cpp')
-rw-r--r-- | clang/lib/Driver/Driver.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 726823b48c1..0da441f1520 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -816,7 +816,7 @@ llvm::sys::Path Driver::GetProgramPath(const char *Name, return llvm::sys::Path(Name); } -HostInfo *Driver::GetHostInfo(const char *Triple) { +const HostInfo *Driver::GetHostInfo(const char *Triple) { // Dice into arch, platform, and OS. This matches // arch,platform,os = '(.*?)-(.*?)-(.*?)' // and missing fields are left empty. @@ -833,8 +833,16 @@ HostInfo *Driver::GetHostInfo(const char *Triple) { } else Arch = Triple; + // Normalize Arch a bit. + // + // FIXME: This is very incomplete. + if (Arch == "i686") + Arch = "i386"; + else if (Arch == "amd64") + Arch = "x86_64"; + if (memcmp(&OS[0], "darwin", 6) == 0) - return new DarwinHostInfo(Arch.c_str(), Platform.c_str(), OS.c_str()); + return createDarwinHostInfo(Arch.c_str(), Platform.c_str(), OS.c_str()); - return new UnknownHostInfo(Arch.c_str(), Platform.c_str(), OS.c_str()); + return createUnknownHostInfo(Arch.c_str(), Platform.c_str(), OS.c_str()); } |