aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/Driver.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-03-17 19:00:50 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-03-17 19:00:50 +0000
commit1fd6c4b8abbbdcbae0e221f35100102112dabff2 (patch)
tree1f9f6a54f3080e64c57d6283df3f1bb98a49d27e /lib/Driver/Driver.cpp
parentcd4e186cdc1db0dcac937eb20afe8b5f5ff1a38d (diff)
Driver: Hide HostInfo implementations.
- Also, normalize arch names a tad and stub out getToolChain implementations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67091 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Driver.cpp')
-rw-r--r--lib/Driver/Driver.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp
index 726823b48c..0da441f152 100644
--- a/lib/Driver/Driver.cpp
+++ b/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());
}